diff --git a/common/treeitem.cpp b/common/treeitem.cpp index 3081bb9..ce65a0b 100644 --- a/common/treeitem.cpp +++ b/common/treeitem.cpp @@ -91,3 +91,10 @@ int TreeItem::row() const } return 0; } + +TreeItem* TreeItem::child(int row) +{ + std::list::iterator child = childItems.begin(); + std::advance(child, row); + return *child; +} \ No newline at end of file diff --git a/common/treeitem.h b/common/treeitem.h index b28d076..b4971b8 100644 --- a/common/treeitem.h +++ b/common/treeitem.h @@ -21,16 +21,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "ustring.h" #include "basetypes.h" -template -ForwardIt u_std_next( - ForwardIt it, - typename std::iterator_traits::difference_type n = 1 -) -{ - std::advance(it, n); - return it; -} - class TreeItem { public: @@ -47,14 +37,14 @@ public: UINT8 insertChildAfter(TreeItem *item, TreeItem *newItem); // Non-trivial implementation in CPP file // Model support operations - TreeItem *child(int row) { return *u_std_next(childItems.begin(), row); } + TreeItem *child(int row); // Non-trivial implementation in CPP file int childCount() const {return childItems.size(); } int columnCount() const { return 5; } UString data(int column) const; // Non-trivial implementation in CPP file int row() const; // Non-trivial implementation in CPP file TreeItem *parent() { return parentItem; } - // Reading operations for item parameters + // Getters and setters for item parameters UString name() const { return itemName; } void setName(const UString &text) { itemName = text; }