diff -r 9ff332964015 -r ff3b01ce0960 branchobj.cpp --- a/branchobj.cpp Wed Apr 01 15:06:57 2009 +0000 +++ b/branchobj.cpp Thu Apr 02 09:46:29 2009 +0000 @@ -102,7 +102,7 @@ OrnamentedObj::copy(other); branch.clear(); - for (int i=0; ibranch.size(); ++i) + 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 @@ -182,7 +182,7 @@ { // new parent is just a branch, link to it QRectF t=o->getBBoxSizeWithChildren(); - if (o->getLastBranch()) + if (o->getTreeItem()->getLastBranch()) y=t.y() + t.height() ; else y=t.y(); @@ -242,7 +242,7 @@ if (! bi->isScrolled() && (bi->depth() < toDepth)) { // Now go recursivly through all children - for (i=0; ibranchCount(); ++i) branch.at(i)->setVisibility (v,toDepth); } } // depth <= toDepth @@ -272,7 +272,7 @@ void BranchObj::setColorSubtree(QColor col) { setColor (col); - for (int i=0; ibranchCount(); ++i) branch.at(i)->setColorSubtree(col); } @@ -299,7 +299,7 @@ void BranchObj::moveBy (double x, double y) { OrnamentedObj::moveBy (x,y); - for (int i=0; ibranchCount(); ++i) branch.at(i)->moveBy (x,y); positionBBox(); } @@ -424,7 +424,7 @@ { // Search branches LinkableMapObj *lmo; - for (int i=0; ibranchCount(); ++i) { lmo=branch.at(i)->findMapObj(p, excludeLMO); if (lmo != NULL) return lmo; @@ -450,7 +450,7 @@ { // Search branches LinkableMapObj *lmo; - for (int i=0; ibranchCount(); ++i) { lmo=branch.at(i)->findID (sid); if (lmo != NULL) return lmo; @@ -498,7 +498,7 @@ } // And take care of my children - for (int i=0; ibranchCount(); ++i) branch.at(i)->setHideTmp (mode); } @@ -579,7 +579,7 @@ s+=treeItem->getNoteObj().saveToDir(); // Save branches - for (int i=0; ibranchCount(); ++i) s+=branch.at(i)->saveToDir(tmpdir,prefix,offset); // Save XLinks @@ -742,7 +742,7 @@ void BranchObj::savePosInAngle () { // Save position in angle - for (int i=0; ibranchCount(); ++i) branch.at(i)->angle=i; } @@ -898,9 +898,10 @@ requestReposition(); } +/* FIXME-1 not needed BranchObj* BranchObj::getFirstBranch () { - if (branch.size()>0) + if (treeItem->branchCount()>0) return branch.first(); else return NULL; @@ -908,7 +909,7 @@ BranchObj* BranchObj::getLastBranch () { - if (branch.size()>0) + if (treeItem->branchCount()>0) return branch.last(); else return NULL; @@ -916,20 +917,24 @@ BranchObj* BranchObj::getBranchNum (int i) { - if (i>=0 && i=0 && ibranchCount()) return branch.at(i); else return NULL; } +*/ bool BranchObj::canMoveBranchUp() { + /* FIXME-1 move to BranchItem if (!parObj || depth==1) return false; BranchObj* par=(BranchObj*)parObj; - if (this==par->getFirstBranch()) + if (this==par->getTreeItem()->getFirstBranch()) return false; else return true; + */ +return false; } BranchObj* BranchObj::moveBranchUp(BranchObj* bo1) // modify my childlist @@ -948,12 +953,15 @@ bool BranchObj::canMoveBranchDown() { + /* FIXME-1 move to BranchItem if (!parObj|| depth==1) return false; BranchObj* par=(BranchObj*)parObj; - if (this==par->getLastBranch()) + if (this==par->getTreeItem()->getLastBranch()) return false; else return true; + */ +return false; } BranchObj* BranchObj::moveBranchDown(BranchObj* bo1)// modify my childlist @@ -961,7 +969,7 @@ savePosInAngle(); int i=branch.indexOf(bo1); int j; - if (i branchCount()) { j = i+1; branch.at(i)->angle++; @@ -1111,7 +1119,7 @@ ref2.setY(ref.y() ); // Align the children depending on reference point - for (int i=0; ibranchCount(); ++i) { if (!branch.at(i)->isHidden()) { @@ -1160,7 +1168,7 @@ void BranchObj::unsetAllRepositionRequests() { repositionRequest=false; - for (int i=0; ibranchCount(); ++i) branch.at(i)->unsetAllRepositionRequests(); } @@ -1193,7 +1201,7 @@ if ( ((BranchItem*)treeItem)->isScrolled() ) return r; - for (int i=0; ibranchCount(); ++i) if (!branch.at(i)->isHidden()) r=addBBox(branch.at(i)->getTotalBBox(),r); @@ -1251,7 +1259,7 @@ // sum of heights // maximum of widths // minimum of y - for (int i=0; ibranchCount(); ++i) { if (!branch.at(i)->isHidden()) {