diff -r 9ff332964015 -r ff3b01ce0960 treeitem.cpp --- a/treeitem.cpp Wed Apr 01 15:06:57 2009 +0000 +++ b/treeitem.cpp Thu Apr 02 09:46:29 2009 +0000 @@ -3,8 +3,10 @@ #include +#include "treeitem.h" + #include "branchobj.h" -#include "treeitem.h" +#include "branchitem.h" #include "vymmodel.h" TreeItem::TreeItem(const QList &data, TreeItem *parent) @@ -261,7 +263,7 @@ return NULL; } -TreeItem* TreeItem::getFirstBranch() +BranchItem* TreeItem::getFirstBranch() { if (branchCounter>0) return getBranchNum (branchOffset); @@ -269,7 +271,7 @@ return NULL; } -TreeItem* TreeItem::getLastBranch() +BranchItem* TreeItem::getLastBranch() { if (branchCounter>0) return getBranchNum (branchOffset + branchCounter-1); @@ -278,14 +280,23 @@ } -TreeItem* TreeItem::getBranchNum(const int &n) +BranchItem* TreeItem::getBranchNum(const int &n) { if (branchCounter>0) - return getChildNum (branchOffset + n); + return (BranchItem*)getChildNum (branchOffset + n); else return NULL; } +BranchObj* TreeItem::getBranchObjNum(const int &n) +{ + if (branchCounter>0) + { + return (BranchObj*)(getChildNum (branchOffset+n)->lmo); + } else + return NULL; +} + void TreeItem::setLastSelectedBranch() { if (parentItem)