diff -r 3d43b46a8564 -r 6dc0a20031f7 vymmodel.cpp --- a/vymmodel.cpp Wed Feb 04 11:52:52 2009 +0000 +++ b/vymmodel.cpp Wed Feb 04 16:33:16 2009 +0000 @@ -703,7 +703,7 @@ return fio; } return NULL; - } +} void VymModel::loadFloatImage () { @@ -1353,36 +1353,6 @@ return mapScene; } -BranchObj* VymModel::first() -{ - if (mapCenters.count()>0) - return mapCenters.first(); - else - return NULL; -} - -BranchObj* VymModel::next(BranchObj *bo_start) -{ - BranchObj *rbo; - BranchObj *bo=bo_start; - if (bo) - { - // Try to find next branch in current MapCenter - rbo=bo->next(); - if (rbo) return rbo; - - // Try to find MapCenter of bo - while (bo->getDepth()>0) bo=(BranchObj*)bo->getParObj(); - - // Try to find next MapCenter - int i=mapCenters.indexOf ((MapCenterObj*)bo); - if (i+2 > mapCenters.count() || i<0) return NULL; - if (mapCenters.at(i+1)!=bo_start) - return mapCenters.at(i+1); - } - return NULL; -} - LinkableMapObj* VymModel::findMapObj(QPointF p, LinkableMapObj *excludeLMO) { LinkableMapObj *lmo; @@ -1520,8 +1490,9 @@ } } -BranchObj* VymModel::findText (QString s, bool cs) +BranchObj* VymModel::findText (QString s, bool cs) // FIXME needs to converted to first() next() next (ti) { + /* QTextDocument::FindFlags flags=0; if (cs) flags=QTextDocument::FindCaseSensitively; @@ -1571,6 +1542,7 @@ return getSelectedBranch(); else return NULL; + */ } void VymModel::findReset() @@ -3925,13 +3897,13 @@ else linkstyle=LinkableMapObj::UndefinedStyle; + TreeItem *ti=first(); BranchObj *bo; - bo=first(); - bo=next(bo); - while (bo) + while (ti) { + bo=(BranchObj*)(ti->getLMO() ); bo->setLinkStyle(bo->getDefLinkStyle()); - bo=next(bo); + ti=next(); } reposition(); } @@ -3951,12 +3923,14 @@ ); defLinkColor=col; + TreeItem *ti; BranchObj *bo; - bo=first(); - while (bo) + ti=first(); + while (ti) { + bo=(BranchObj*)(ti->getLMO() ); bo->setLinkColor(); - bo=next(bo); + ti=next(); } updateActions(); } @@ -3964,12 +3938,14 @@ void VymModel::setMapLinkColorHintInt() { // called from setMapLinkColorHint(lch) or at end of parse + TreeItem *ti; BranchObj *bo; - bo=first(); - while (bo) + ti=first(); + while (ti) { + bo=(BranchObj*)(ti->getLMO() ); bo->setLinkColor(); - bo=next(bo); + ti=next(); } } @@ -3985,12 +3961,14 @@ linkcolorhint=LinkableMapObj::DefaultColor; else linkcolorhint=LinkableMapObj::HeadingColor; + TreeItem *ti; BranchObj *bo; - bo=first(); + ti=first(); while (bo) { + bo=(BranchObj*)(ti->getLMO() ); bo->setLinkColor(); - bo=next(bo); + ti=next(); } }