diff -r 6269016c9905 -r c6bb4fdcc55f branchitem.cpp --- a/branchitem.cpp Thu Aug 06 10:42:17 2009 +0000 +++ b/branchitem.cpp Sat Aug 08 21:58:26 2009 +0000 @@ -17,6 +17,9 @@ includeImagesVer=false; includeImagesHor=false; + + lastSelectedBranchNum=-1; + lastSelectedBranchNumAlt=-1; } BranchItem::~BranchItem() @@ -299,6 +302,41 @@ return a; } +void BranchItem::setLastSelectedBranch() +{ + int d=depth(); + if (d>=0) + { + if (d==1) + // Hack to save an additional lastSelected for mapcenters in MapEditor + // depending on orientation + // this allows to go both left and right from there + if (lmo && lmo->getOrientation()==LinkableMapObj::LeftOfCenter) + { + ((BranchItem*)parentItem)->lastSelectedBranchNumAlt=parentItem->num(this); + return; + } + ((BranchItem*)parentItem)->lastSelectedBranchNum=parentItem->num(this); + } +} + +void BranchItem::setLastSelectedBranch(int i) +{ + lastSelectedBranchNum=i; +} + +BranchItem* BranchItem::getLastSelectedBranch() +{ + return getBranchNum (lastSelectedBranchNum); +} + +BranchItem* BranchItem::getLastSelectedBranchAlt() +{ + return getBranchNum (lastSelectedBranchNumAlt); +} + + + TreeItem* BranchItem::findMapItem (QPointF p, TreeItem* excludeTI)