diff -r 557239819c45 -r 70c41284cb48 branchobj.cpp --- a/branchobj.cpp Wed Aug 30 12:16:25 2006 +0000 +++ b/branchobj.cpp Thu Aug 31 11:55:33 2006 +0000 @@ -812,7 +812,6 @@ // Save XLinks XLinkObj *xlo; - //FIXME exponential increase in xlinks... QString ol; // old link QString cl; // current link for (xlo=xlink.first(); xlo; xlo=xlink.next() ) @@ -882,7 +881,6 @@ calcBBoxSize(); positionBBox(); requestReposition(); - //FIXME undo needed } bool BranchObj::getIncludeImagesVer() @@ -896,7 +894,6 @@ calcBBoxSize(); positionBBox(); requestReposition(); - //FIXME undo needed } bool BranchObj::getIncludeImagesHor() @@ -930,7 +927,6 @@ positionBBox(); requestReposition(); return newfi; - //FIXME undo needed } LinkableMapObj* BranchObj::addFloatImage (FloatImageObj *fio) @@ -946,7 +942,6 @@ positionBBox(); requestReposition(); return newfi; - // FIMXE undo needed } FloatImageObj* BranchObj::getFirstFloatImage () @@ -1155,7 +1150,7 @@ bool BranchObj::canMoveBranchUp() { - if (!parObj) return false; + if (!parObj || depth==1) return false; BranchObj* par=(BranchObj*)parObj; if (this==par->getFirstBranch()) return false; @@ -1163,23 +1158,24 @@ return true; } -BranchObj* BranchObj::moveBranchUp(BranchObj* bo1) // move a branch up (modify myself) +BranchObj* BranchObj::moveBranchUp(BranchObj* bo1) // modify my childlist { savePosInAngle(); int i=branch.find(bo1); + cout << "BO: i="<0) { // -1 if bo1 not found branch.at(i)->angle--; branch.at(i-1)->angle++; branch.sort(); - return branch.at(i-1); + return branch.at(i); } else - return branch.at(i); + return NULL; } bool BranchObj::canMoveBranchDown() { - if (!parObj) return false; + if (!parObj|| depth==1) return false; BranchObj* par=(BranchObj*)parObj; if (this==par->getLastBranch()) return false; @@ -1187,7 +1183,7 @@ return true; } -BranchObj* BranchObj::moveBranchDown(BranchObj* bo1) +BranchObj* BranchObj::moveBranchDown(BranchObj* bo1)// modify my childlist { savePosInAngle(); int i=branch.find(bo1); @@ -1198,9 +1194,9 @@ branch.at(i)->angle++; branch.at(j)->angle--; branch.sort(); - return branch.at(j); + return branch.at(i); } else - return branch.at(i); + return NULL; } BranchObj* BranchObj::moveBranchTo (BranchObj* dst, int pos) @@ -1253,7 +1249,7 @@ // If I am the mapcenter or a mainbranch, reposition heading if (depth<2) - { //FIXME ugly! optimize this move for MCO needed to initially position text in box... + { if (depth==1) // Calc angle to mapCenter if I am a mainbranch // needed for reordering the mainbranches clockwise @@ -1452,7 +1448,7 @@ if (!status.isEmpty()) mainWindow->statusMessage (status); // Update Toolbar - standardFlags->updateToolbar(); + updateFlagsToolbar(); // Update actions in mapeditor mapEditor->updateActions();