diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-10-23 17:42:17 +0200 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-10-23 17:58:47 +0200 |
commit | 3fa955d701ee5c1bf74a216873390fb402ac7cb0 (patch) | |
tree | aa80291d63517d73247278f79229b78de1c5901d /dbaccess/source/ui/control | |
parent | d7a19a7e04c3ec2099ec5df562558f51327e8179 (diff) |
Make SvTreeEntryList private to svtools.
Change-Id: I283d897cd5a7c15b5b60e99c90c04b696d20c2a3
Diffstat (limited to 'dbaccess/source/ui/control')
-rw-r--r-- | dbaccess/source/ui/control/dbtreelistbox.cxx | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index ec14ea60525a..96b5ce3e5944 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -111,23 +111,24 @@ DBTreeListBox::~DBTreeListBox() SvTreeListEntry* DBTreeListBox::GetEntryPosByName( const String& aName, SvTreeListEntry* pStart, const IEntryFilter* _pFilter ) const { SvTreeList* myModel = GetModel(); - SvTreeEntryList* pChildren = myModel->GetChildList(pStart); + std::pair<SvTreeEntryList::iterator,SvTreeEntryList::iterator> aIters = + myModel->GetChildIterators(pStart); + SvTreeListEntry* pEntry = NULL; - if ( pChildren ) + SvTreeEntryList::const_iterator it = aIters.first, itEnd = aIters.second; + for (; it != itEnd; ++it) { - size_t nCount = pChildren->size(); - for (size_t i = 0; i < nCount; ++i) + pEntry = *it; + const SvLBoxString* pItem = static_cast<const SvLBoxString*>( + pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); + + if (pItem && pItem->GetText().equals(aName)) { - pEntry = static_cast<SvTreeListEntry*>((*pChildren)[ i ]); - SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - if ( pItem->GetText().equals(aName) ) - { - if ( !_pFilter || _pFilter->includeEntry( pEntry ) ) - // found - break; - } - pEntry = NULL; + if (!_pFilter || _pFilter->includeEntry(pEntry)) + // found + break; } + pEntry = NULL; } return pEntry; |