diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-10-29 16:11:36 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-10-29 21:33:16 -0400 |
commit | fb01d8e132ab9097ed30b3bc4c7585622df591ad (patch) | |
tree | f55c2f05ac8a474c21b9a164743992e62f5c62dc /dbaccess | |
parent | 9545c85db39144705fb50409b7f4b7a3cf472150 (diff) |
Use SvTreeListEntries to store child entries.
This replaces SvTreeEntryList. The only thing to be wary of is that
now we use ptr_vector to store child entries, which changes the scheme
on the life cycle management of tree entries.
Change-Id: I92b6e41ea500bc9b9227259c010887b798194909
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/browser/dsEntriesNoExp.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/unodatbr.cxx | 12 | ||||
-rw-r--r-- | dbaccess/source/ui/control/dbtreelistbox.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/tablespage.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/unodatbr.hxx | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx index d19a2bbfb560..e425c557dfdc 100644 --- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx +++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx @@ -59,13 +59,13 @@ String SbaTableQueryBrowser::GetEntryText( SvTreeListEntry* _pEntry ) const } // ----------------------------------------------------------------------------- -SbaTableQueryBrowser::EntryType SbaTableQueryBrowser::getEntryType( SvTreeListEntry* _pEntry ) const +SbaTableQueryBrowser::EntryType SbaTableQueryBrowser::getEntryType( const SvTreeListEntry* _pEntry ) const { if (!_pEntry) return etUnknown; - SvTreeListEntry* pRootEntry = m_pTreeView->getListBox().GetRootLevelParent(_pEntry); - SvTreeListEntry* pEntryParent = m_pTreeView->getListBox().GetParent(_pEntry); + SvTreeListEntry* pRootEntry = m_pTreeView->getListBox().GetRootLevelParent(const_cast<SvTreeListEntry*>(_pEntry)); + SvTreeListEntry* pEntryParent = m_pTreeView->getListBox().GetParent(const_cast<SvTreeListEntry*>(_pEntry)); SvTreeListEntry* pTables = m_pTreeView->getListBox().GetEntry(pRootEntry, CONTAINER_TABLES); SvTreeListEntry* pQueries = m_pTreeView->getListBox().GetEntry(pRootEntry, CONTAINER_QUERIES); diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 357558b42a06..a0484e56a0b5 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -3440,8 +3440,8 @@ sal_Bool SbaTableQueryBrowser::ensureConnection( SvTreeListEntry* _pDSEntry, voi // ----------------------------------------------------------------------------- IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortData ) { - SvTreeListEntry* pLHS = static_cast<SvTreeListEntry*>(_pSortData->pLeft); - SvTreeListEntry* pRHS = static_cast<SvTreeListEntry*>(_pSortData->pRight); + const SvTreeListEntry* pLHS = static_cast<const SvTreeListEntry*>(_pSortData->pLeft); + const SvTreeListEntry* pRHS = static_cast<const SvTreeListEntry*>(_pSortData->pRight); OSL_ENSURE(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); // we want the table entry and the end so we have to do a check @@ -3455,7 +3455,7 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa // every other container should be placed _before_ the bookmark container return -1; - const String sLeft = m_pTreeView->getListBox().GetEntryText(pLHS); + const String sLeft = m_pTreeView->getListBox().GetEntryText(const_cast<SvTreeListEntry*>(pLHS)); EntryType eLeft = etTableContainer; if (String(ModuleRes(RID_STR_TABLES_CONTAINER)) == sLeft) @@ -3866,14 +3866,14 @@ 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 - std::pair<SvTreeEntryList::iterator,SvTreeEntryList::iterator> aIters = + std::pair<SvTreeListEntries::iterator, SvTreeListEntries::iterator> aIters = m_pTreeModel->GetChildIterators(pDataSourceEntry); - SvTreeEntryList::const_iterator it = aIters.first, itEnd = aIters.second; + SvTreeListEntries::iterator it = aIters.first, itEnd = aIters.second; for (; it != itEnd; ++it) { - SvTreeListEntry* pEntry = *it; + SvTreeListEntry* pEntry = &(*it); const DBTreeListUserData* pData = static_cast<const DBTreeListUserData*>(pEntry->GetUserData()); pEntry->SetUserData(NULL); delete pData; diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index c62068e533fc..1c53330cb4a4 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -111,14 +111,14 @@ DBTreeListBox::~DBTreeListBox() SvTreeListEntry* DBTreeListBox::GetEntryPosByName( const String& aName, SvTreeListEntry* pStart, const IEntryFilter* _pFilter ) const { SvTreeList* myModel = GetModel(); - std::pair<SvTreeEntryList::iterator,SvTreeEntryList::iterator> aIters = + std::pair<SvTreeListEntries::iterator,SvTreeListEntries::iterator> aIters = myModel->GetChildIterators(pStart); SvTreeListEntry* pEntry = NULL; - SvTreeEntryList::const_iterator it = aIters.first, itEnd = aIters.second; + SvTreeListEntries::iterator it = aIters.first, itEnd = aIters.second; for (; it != itEnd; ++it) { - pEntry = *it; + pEntry = &(*it); const SvLBoxString* pItem = static_cast<const SvLBoxString*>( pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index 6113743b19b8..c58e5c4c6640 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -434,12 +434,12 @@ DBG_NAME(OTableSubscriptionPage) //------------------------------------------------------------------------ IMPL_LINK( OTableSubscriptionPage, OnTreeEntryCompare, const SvSortData*, _pSortData ) { - SvTreeListEntry* pLHS = static_cast<SvTreeListEntry*>(_pSortData->pLeft); - SvTreeListEntry* pRHS = static_cast<SvTreeListEntry*>(_pSortData->pRight); + const SvTreeListEntry* pLHS = static_cast<const SvTreeListEntry*>(_pSortData->pLeft); + const SvTreeListEntry* pRHS = static_cast<const SvTreeListEntry*>(_pSortData->pRight); OSL_ENSURE(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); - SvLBoxString* pLeftTextItem = static_cast<SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - SvLBoxString* pRightTextItem = static_cast<SvLBoxString*>(pRHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); + const SvLBoxString* pLeftTextItem = static_cast<const SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); + const SvLBoxString* pRightTextItem = static_cast<const SvLBoxString*>(pRHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); OSL_ENSURE(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); String sLeftText = pLeftTextItem->GetText(); diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index c40f077abf3c..5d6fbe63f6a1 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -342,11 +342,11 @@ namespace dbaui TransferableHelper* implCopyObject( SvTreeListEntry* _pApplyTo, sal_Int32 _nCommandType, sal_Bool _bAllowConnection = sal_True ); - EntryType getEntryType( SvTreeListEntry* _pEntry ) const; + EntryType getEntryType( const SvTreeListEntry* _pEntry ) const; EntryType getChildType( SvTreeListEntry* _pEntry ) const; sal_Bool isObject( EntryType _eType ) const { return ( etTableOrView== _eType ) || ( etQuery == _eType ); } sal_Bool isContainer( EntryType _eType ) const { return (etTableContainer == _eType) || (etQueryContainer == _eType); } - sal_Bool isContainer( SvTreeListEntry* _pEntry ) const { return isContainer( getEntryType( _pEntry ) ); } + bool isContainer( const SvTreeListEntry* _pEntry ) const { return isContainer( getEntryType( _pEntry ) ); } // ensure that the xObject for the given entry is set on the user data sal_Bool ensureEntryObject( SvTreeListEntry* _pEntry ); |