branchitem.cpp
changeset 779 1fb50e79661c
parent 777 8acac4fade1b
child 780 fe839bdfd10c
     1.1 --- a/branchitem.cpp	Mon Jun 29 10:28:28 2009 +0000
     1.2 +++ b/branchitem.cpp	Tue Jul 07 09:34:24 2009 +0000
     1.3 @@ -7,7 +7,7 @@
     1.4  
     1.5  using namespace std;
     1.6  
     1.7 -BranchItem::BranchItem(const QList<QVariant> &data, TreeItem *parent):TreeItem (data,parent)
     1.8 +BranchItem::BranchItem(const QList<QVariant> &data, TreeItem *parent):MapItem (data,parent)
     1.9  {
    1.10  	//cout << "Constr. BranchItem\n";
    1.11  
    1.12 @@ -93,7 +93,8 @@
    1.13  		elementName="branch";
    1.14  
    1.15      s=beginElement (elementName
    1.16 -		+getAttr()
    1.17 +		+getMapAttr()
    1.18 +		+getGeneralAttr()
    1.19  		+scrolledAttr 
    1.20  	//	+areaAttr 
    1.21  	//	+idAttr 
    1.22 @@ -249,10 +250,11 @@
    1.23  	// find out, if we are scrolled at all.
    1.24  	// But ignore myself, just look at parents.
    1.25  
    1.26 +	//cout << "BI::hasScrolledParent this="<<this<<"  "<<getHeadingStd()<<endl;
    1.27  	if (this !=start && scrolled) return true;
    1.28  
    1.29  	BranchItem* bi=(BranchItem*)parentItem;
    1.30 -	if (bi && bi->isBranchLikeType() ) 
    1.31 +	if (bi && bi!=rootItem && bi->isBranchLikeType() ) 
    1.32  		return bi->hasScrolledParent(start);
    1.33  	else
    1.34  		return false;
    1.35 @@ -350,9 +352,9 @@
    1.36  {
    1.37  	// FIXME-5 compare also MapItem::initLMO...
    1.38  
    1.39 -	if (lmo)
    1.40 +	if (lmo && parentItem != rootItem)
    1.41  	{
    1.42 -		lmo->setParObj ( parentItem->getLMO() );
    1.43 +		lmo->setParObj ( ((MapItem*)parentItem)->getLMO() );
    1.44  	}
    1.45  }
    1.46  
    1.47 @@ -374,9 +376,9 @@
    1.48  		newbo->setFrameType (FrameObj::Rectangle);
    1.49  	} else
    1.50  	{
    1.51 -		newbo->setParObj( parentItem->getLMO() );
    1.52 +		newbo->setParObj( ((MapItem*)parentItem)->getLMO() );
    1.53  		// Set visibility depending on parents
    1.54 -		if (((BranchItem*)parentItem)->scrolled || !parentItem->getLMO()->isVisibleObj() )
    1.55 +		if (((BranchItem*)parentItem)->scrolled || !((MapItem*)parentItem)->getLMO()->isVisibleObj() )
    1.56  			newbo->setVisibility (false);
    1.57  	}
    1.58  	newbo->setDefAttr(BranchObj::NewBranch);
    1.59 @@ -388,7 +390,7 @@
    1.60  		newbo->setColor (headingColor);
    1.61  	}	
    1.62  		
    1.63 -	//newbo->updateLink();	//FIXME-3
    1.64 +	//newbo->updateLinkGeometry();	//FIXME-3
    1.65  
    1.66  	return newbo;
    1.67  }