diff -r bf3ea1f1520b -r 59614eaf5fbb branchobj.cpp --- a/branchobj.cpp Tue Apr 28 20:53:44 2009 +0000 +++ b/branchobj.cpp Wed Apr 29 18:46:31 2009 +0000 @@ -100,14 +100,6 @@ { OrnamentedObj::copy(other); -/* FIXME-3 not needed - for (int i=0; itreeItem->branchCount(); ++i) - // Make deep copy of b - // Because addBranch again calls copy for the children, - // Those will get a deep copy, too - addBranch(other->branch.at(i) ); -*/ - for (int i=0; ifloatimage.size(); ++i) addFloatImage (other->floatimage.at(i)); @@ -682,92 +674,11 @@ heading->setFont(font ); if (mod==NewBranch) - setColor (((BranchObj*)(parObj))->getColor()); - + setColor (treeItem->getHeadingColor() ); calcBBoxSize(); } -BranchObj* BranchObj::addBranch() // FIXME-3 still needed? -{ - BranchObj* newbo=new BranchObj(scene,this); - newbo->setParObj(this); - newbo->setDefAttr(NewBranch); - /* FIXME-2 treeItem not set yet!!! - if ( ((BranchItem*)treeItem)->isScrolled() ) - newbo->setVisibility (false); - else - newbo->setVisibility(visible); - */ - newbo->updateLink(); - requestReposition(); - return newbo; -} - -BranchObj* BranchObj::addBranch(BranchObj* bo) -{ - BranchObj* newbo=new BranchObj(scene,this); - //FIXME-1 branch.append (newbo); - newbo->copy(bo); - newbo->setParObj(this); - newbo->setDefAttr(MovedBranch); - if ( ((BranchItem*)treeItem)->isScrolled() ) - newbo->setVisibility (false); - else - newbo->setVisibility(bo->visible); - newbo->updateLink(); - requestReposition(); - return newbo; -} - -BranchObj* BranchObj::addBranchPtr(BranchObj* bo) -{ - //FIXME-1 branch.append (bo); - bo->setParObj (this); - //FIXME-2 bo->depth=depth+1; - bo->setDefAttr(MovedBranch); - BranchItem *bi=(BranchItem*)treeItem; - if ( bi->isScrolled() ) bi->tmpUnscroll(); - //setLastSelectedBranch (bo); //FIXME-3 needed? - return bo; -} - -BranchObj* BranchObj::insertBranch(int pos) -{ - savePosInAngle(); - // Add new bo and resort branches - BranchObj *newbo=addBranch (); - newbo->angle=pos-0.5; - //FIXME-1 qSort (branch.begin(),branch.end(), isAbove); - return newbo; -} - -BranchObj* BranchObj::insertBranch(BranchObj* bo, int pos) -{ - savePosInAngle(); - // Add new bo and resort branches - bo->angle=pos-0.5; - BranchObj *newbo=addBranch (bo); - //FIXME-1 qSort (branch.begin(),branch.end(), isAbove); - return newbo; -} - -BranchObj* BranchObj::insertBranchPtr (BranchObj* bo, int pos) -{ - savePosInAngle(); - // Add new bo and resort branches - bo->angle=pos-0.5; - //FIXME-4 branch.append (bo); - bo->setParObj (this); - //FIXME-2 bo->depth=depth+1; - bo->setDefAttr (MovedBranch); - BranchItem *bi=(BranchItem*)treeItem; - if ( bi->isScrolled() ) bi->tmpUnscroll(); - //setLastSelectedBranch (bo); //FIXME-3 needed? - //FIXME-2 qSort (branch.begin(),branch.end(), isAbove); - return bo; -} - -void BranchObj::removeBranchHere(BranchObj* borem) // FIXME-1 getNum no longer available +void BranchObj::removeBranchHere(BranchObj* borem) // FIXME-2 getNum no longer available { /* // This removes the branch bo from list, but @@ -789,7 +700,7 @@ clear(); } -void BranchObj::removeBranch(BranchObj* bo) // FIXME-1 not needed here +void BranchObj::removeBranch(BranchObj* bo) // FIXME-2 not needed here { /* // if bo is not in branch remove returns false, we @@ -806,7 +717,7 @@ */ } -void BranchObj::removeBranchPtr(BranchObj* bo) // FIXME-1 not needed here +void BranchObj::removeBranchPtr(BranchObj* bo) // FIXME-3 not needed here { /* int i=branch.indexOf(bo); @@ -819,9 +730,9 @@ */ } -bool BranchObj::canMoveBranchUp() +bool BranchObj::canMoveBranchUp() // FIXME-1 move to BranchItem { - /* FIXME-1 move to BranchItem +/* if (!parObj || depth==1) return false; BranchObj* par=(BranchObj*)parObj; if (this==par->getTreeItem()->getFirstBranch()) @@ -848,9 +759,9 @@ return NULL; } -bool BranchObj::canMoveBranchDown() +bool BranchObj::canMoveBranchDown() //FIXME-1 move to BranchItem { - /* FIXME-1 move to BranchItem + /* if (!parObj|| depth==1) return false; BranchObj* par=(BranchObj*)parObj; if (this==par->getTreeItem()->getLastBranch()) @@ -879,7 +790,7 @@ return NULL; } -void BranchObj::sortChildren() //FIXME-1 +void BranchObj::sortChildren() //FIXME-2 { /* int childCount=branch.count(); @@ -901,42 +812,6 @@ */ } - -BranchObj* BranchObj::linkTo (BranchObj* dst, int pos) -{ - // Find current parent and - // remove pointer to myself there - if (!dst) return NULL; - BranchObj *par=(BranchObj*)parObj; - if (par) - par->removeBranchPtr (this); - else - return NULL; - -/* FIXME-1 - // Create new pointer to myself at dst - if (pos<0||dst->getDepth()==0) - { - // links myself as last branch at dst - dst->addBranchPtr (this); - updateLink(); - return this; - } else - { - // inserts me at pos in parent of dst - if (par) - { - BranchObj *bo=dst->insertBranchPtr (this,pos); - bo->setDefAttr(MovedBranch); - updateLink(); - return bo; - - } else - return NULL; - } -*/ -} - void BranchObj::alignRelativeTo (QPointF ref,bool alignSelf) { qreal th = bboxTotal.height();