diff -r f1006de05c54 -r 6b0a5f4923d3 branchitem.cpp --- a/branchitem.cpp Mon Sep 07 15:36:57 2009 +0000 +++ b/branchitem.cpp Thu Sep 17 09:41:09 2009 +0000 @@ -45,6 +45,11 @@ tmpUnscrolled=other->tmpUnscrolled; } +BranchItem* BranchItem::parentBranch () +{ + return (BranchItem*) parentItem; +} + void BranchItem::insertBranch (int pos, BranchItem *branch) { if (pos<0) pos=0; @@ -216,7 +221,7 @@ } } } - model->reposition(); // FIXME-3 we don't really want to update view from here... + //model->reposition(); // FIXME-3 we don't really want to update view from here... return true; } @@ -273,10 +278,30 @@ } } +void BranchItem::sortChildren() +{ + int childCount=branchCounter; + int curChildIndex; + bool madeChanges=false; + do + { + madeChanges=false; + for(curChildIndex=1;curChildIndexgetHeading().compare(curChild->getHeading())>0) + { + model->moveUp(curChild); + madeChanges=true; + } + } + }while(madeChanges); +} + void BranchItem::setIncludeImagesVer(bool b) { includeImagesVer=b; - /* calcBBoxSize(); FIXME-2 + /* calcBBoxSize(); FIXME-3 positionBBox(); requestReposition(); */ @@ -290,7 +315,7 @@ void BranchItem::setIncludeImagesHor(bool b) { includeImagesHor=b; - /* calcBBoxSize(); FIXME-2 + /* calcBBoxSize(); FIXME-3 positionBBox(); requestReposition(); */ @@ -377,7 +402,7 @@ } return NULL; } - +/* TreeItem* BranchItem::findID (QString sid) //FIXME-3 move to TreeItem //FIXME-4 search images { // Search branches @@ -392,7 +417,6 @@ if (sid==objID) return this; -/* // Search float images for (int i=0; iinBox(p) && @@ -400,10 +424,9 @@ floatimage.at(i)->getParObj()!= excludeLMO && floatimage.at(i)->isVisibleObj() ) return floatimage.at(i); -*/ return NULL; } - +*/ void BranchItem::updateStyles() { // FIXME-5 compare also MapItem::initLMO...