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 | |
parent | d7a19a7e04c3ec2099ec5df562558f51327e8179 (diff) |
Make SvTreeEntryList private to svtools.
Change-Id: I283d897cd5a7c15b5b60e99c90c04b696d20c2a3
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/browser/unodatbr.cxx | 19 | ||||
-rw-r--r-- | dbaccess/source/ui/control/dbtreelistbox.cxx | 27 |
2 files changed, 24 insertions, 22 deletions
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index c5d9242d34c5..357558b42a06 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -3866,16 +3866,17 @@ void SbaTableQueryBrowser::impl_cleanupDataSourceEntry( const String& _rDataSour "SbaTableQueryBrowser::impl_cleanupDataSourceEntry: inconsistence (2)!"); // delete any user data of the child entries of the to-be-removed entry - SvTreeEntryList* pList = m_pTreeModel->GetChildList( pDataSourceEntry ); - if ( pList ) + std::pair<SvTreeEntryList::iterator,SvTreeEntryList::iterator> aIters = + m_pTreeModel->GetChildIterators(pDataSourceEntry); + + SvTreeEntryList::const_iterator it = aIters.first, itEnd = aIters.second; + + for (; it != itEnd; ++it) { - for ( size_t i = 0, n = pList->size(); i < n; ++i ) - { - SvTreeListEntry* pEntryLoop = static_cast<SvTreeListEntry*>((*pList)[ i ]); - DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( pEntryLoop->GetUserData() ); - pEntryLoop->SetUserData( NULL ); - delete pData; - } + SvTreeListEntry* pEntry = *it; + const DBTreeListUserData* pData = static_cast<const DBTreeListUserData*>(pEntry->GetUserData()); + pEntry->SetUserData(NULL); + delete pData; } // remove the entry 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; |