include/vcl/toolkit/treelist.hxx | 77 ++++++++++---- include/vcl/toolkit/treelistbox.hxx | 27 +---- vcl/source/treelist/svimpbox.cxx | 6 - vcl/source/treelist/treelist.cxx | 193 +++++++++++++----------------------- vcl/source/treelist/treelistbox.cxx | 82 +++++++-------- 5 files changed, 178 insertions(+), 207 deletions(-)
New commits: commit bf8b5d155b5ab65ee8218c1a6438c3a6d9d7383f Author: Michael Weghorn <[email protected]> AuthorDate: Mon Feb 16 11:20:37 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Feb 16 23:07:49 2026 +0100 vcl: Merge SvListView::InitTable into ctor Also drop two DBG_ASSERT that are superfluous now as it iss obvious that the members have just been initialized accordingly. Change-Id: I9227bc86b74810b94ff52fd3f2f24128b5822346 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199469 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/toolkit/treelist.hxx b/include/vcl/toolkit/treelist.hxx index 19b175b14c74..fd1d91ec16ff 100644 --- a/include/vcl/toolkit/treelist.hxx +++ b/include/vcl/toolkit/treelist.hxx @@ -320,8 +320,6 @@ public: virtual void ModelHasEntryInvalidated( SvTreeListEntry* pEntry ); private: - void InitTable(); - void RemoveViewData(SvTreeListEntry* pParent); void ActionMoving(SvTreeListEntry* pEntry); diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx index 7a867a92064d..93aa3595f1df 100644 --- a/vcl/source/treelist/treelist.cxx +++ b/vcl/source/treelist/treelist.cxx @@ -967,25 +967,6 @@ SvListView::SvListView() , m_bVisPositionsValid(false) { m_pModel.reset(new SvTreeList(*this)); - InitTable(); -} - -void SvListView::dispose() { m_pModel.reset(); } - -SvListView::~SvListView() -{ - m_DataTable.clear(); -} - -sal_uInt32 SvListView::GetSelectionCount() const { return m_nSelectionCount; } - -bool SvListView::HasViewData() const { return m_DataTable.size() > 1; } // There's always a ROOT - -void SvListView::InitTable() -{ - DBG_ASSERT(m_pModel, "InitTable:No Model"); - DBG_ASSERT(!m_nSelectionCount && !m_nVisibleCount && !m_bVisPositionsValid, - "InitTable: Not cleared!"); if (!m_DataTable.empty()) { @@ -1014,6 +995,17 @@ void SvListView::InitTable() } } +void SvListView::dispose() { m_pModel.reset(); } + +SvListView::~SvListView() +{ + m_DataTable.clear(); +} + +sal_uInt32 SvListView::GetSelectionCount() const { return m_nSelectionCount; } + +bool SvListView::HasViewData() const { return m_DataTable.size() > 1; } // There's always a ROOT + void SvListView::Clear() { m_DataTable.clear(); commit 47e142f16a7f68b37f9e92b0515c8e9f4ff8764a Author: Michael Weghorn <[email protected]> AuthorDate: Mon Feb 16 11:16:05 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Feb 16 23:07:42 2026 +0100 vcl: Merge SvListView::Impl into SvListView Let SvListView the logic previously split between itself and an impl class SvListView::Impl, both of which were holding a pointer/reference to the other cand calling each others' methods. Change-Id: I0272c2af872461d11be67f13d06830ed18fed960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199468 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/toolkit/treelist.hxx b/include/vcl/toolkit/treelist.hxx index e13f079f530f..19b175b14c74 100644 --- a/include/vcl/toolkit/treelist.hxx +++ b/include/vcl/toolkit/treelist.hxx @@ -31,6 +31,7 @@ #include <tools/contnr.hxx> #include <memory> +#include <unordered_map> enum class SvListAction { @@ -205,8 +206,12 @@ class UNLESS_MERGELIBS_MORE(VCL_DLLPUBLIC) SvListView { friend class SvTreeList; - struct SAL_DLLPRIVATE Impl; - std::unique_ptr<Impl> m_pImpl; + using SvDataTable = std::unordered_map<SvTreeListEntry*, std::unique_ptr<SvViewDataEntry>>; + SvDataTable m_DataTable; // Mapping SvTreeListEntry -> ViewData + + sal_uInt32 m_nVisibleCount; + sal_uInt32 m_nSelectionCount; + bool m_bVisPositionsValid; protected: std::unique_ptr<SvTreeList> m_pModel; @@ -313,6 +318,17 @@ public: virtual void ModelIsRemoving( SvTreeListEntry* pEntry ); virtual void ModelHasRemoved( SvTreeListEntry* pEntry ); virtual void ModelHasEntryInvalidated( SvTreeListEntry* pEntry ); + +private: + void InitTable(); + + void RemoveViewData(SvTreeListEntry* pParent); + + void ActionMoving(SvTreeListEntry* pEntry); + void ActionMoved(); + void ActionInserted(SvTreeListEntry* pEntry); + void ActionInsertedTree(SvTreeListEntry* pEntry); + void ActionRemoving(SvTreeListEntry* pEntry); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx index e6d405b46975..7a867a92064d 100644 --- a/vcl/source/treelist/treelist.cxx +++ b/vcl/source/treelist/treelist.cxx @@ -25,40 +25,8 @@ #include <cassert> #include <memory> -#include <unordered_map> #include <utility> - -typedef std::unordered_map<SvTreeListEntry*, std::unique_ptr<SvViewDataEntry>> SvDataTable; - -struct SvListView::Impl -{ - SvListView & m_rThis; - - SvDataTable m_DataTable; // Mapping SvTreeListEntry -> ViewData - - sal_uInt32 m_nVisibleCount; - sal_uInt32 m_nSelectionCount; - bool m_bVisPositionsValid; - - explicit Impl(SvListView & rThis) - : m_rThis(rThis) - , m_nVisibleCount(0) - , m_nSelectionCount(0) - , m_bVisPositionsValid(false) - {} - - void InitTable(); - void RemoveViewData( SvTreeListEntry* pParent ); - - void ActionMoving(SvTreeListEntry* pEntry); - void ActionMoved(); - void ActionInserted(SvTreeListEntry* pEntry); - void ActionInsertedTree(SvTreeListEntry* pEntry); - void ActionRemoving(SvTreeListEntry* pEntry); -}; - - SvTreeList::SvTreeList(SvListView& listView) : mrOwnerListView(listView), mbEnableInvalidate(true) @@ -540,10 +508,10 @@ sal_uInt32 SvTreeList::GetVisiblePos( const SvListView* pView, SvTreeListEntry c assert(pView && "View?"); DBG_ASSERT(pEntry,"Entry?"); - if (!pView->m_pImpl->m_bVisPositionsValid) + if (!pView->m_bVisPositionsValid) { // to make GetVisibleCount refresh the positions - const_cast<SvListView*>(pView)->m_pImpl->m_nVisibleCount = 0; + const_cast<SvListView*>(pView)->m_nVisibleCount = 0; GetVisibleCount( const_cast<SvListView*>(pView) ); } const SvViewDataEntry* pViewData = pView->GetViewData( pEntry ); @@ -557,8 +525,8 @@ sal_uInt32 SvTreeList::GetVisibleCount( SvListView* pView ) const assert(pView && "GetVisCount:No View"); if( !pView->HasViewData() ) return 0; - if (pView->m_pImpl->m_nVisibleCount) - return pView->m_pImpl->m_nVisibleCount; + if (pView->m_nVisibleCount) + return pView->m_nVisibleCount; sal_uInt32 nPos = 0; SvTreeListEntry* pEntry = First(); // first entry is always visible @@ -575,8 +543,8 @@ sal_uInt32 SvTreeList::GetVisibleCount( SvListView* pView ) const OSL_FAIL("nVisibleCount bad"); } #endif - pView->m_pImpl->m_nVisibleCount = nPos; - pView->m_pImpl->m_bVisPositionsValid = true; + pView->m_nVisibleCount = nPos; + pView->m_bVisPositionsValid = true; return nPos; } @@ -692,9 +660,9 @@ SvTreeListEntry* SvTreeList::NextVisible(const SvListView* pView,SvTreeListEntry // nDelta entries existent? // example: 0,1,2,3,4,5,6,7,8,9 nVisPos=5 nDelta=7 // nNewDelta = 10-nVisPos-1 == 4 - if (nVisPos+nDelta >= pView->m_pImpl->m_nVisibleCount) + if (nVisPos + nDelta >= pView->m_nVisibleCount) { - nDelta = static_cast<sal_uInt16>(pView->m_pImpl->m_nVisibleCount-nVisPos); + nDelta = static_cast<sal_uInt16>(pView->m_nVisibleCount - nVisPos); nDelta--; } sal_uInt16 nDeltaTmp = nDelta; @@ -834,8 +802,8 @@ void SvListView::ExpandListEntry( SvTreeListEntry* pEntry ) // if parent is visible, invalidate status data if ( IsExpanded( pParent ) ) { - m_pImpl->m_bVisPositionsValid = false; - m_pImpl->m_nVisibleCount = 0; + m_bVisPositionsValid = false; + m_nVisibleCount = 0; } } @@ -856,8 +824,8 @@ void SvListView::CollapseListEntry( SvTreeListEntry* pEntry ) SvTreeListEntry* pParent = pEntry->pParent; if ( IsExpanded(pParent) ) { - m_pImpl->m_nVisibleCount = 0; - m_pImpl->m_bVisPositionsValid = false; + m_nVisibleCount = 0; + m_bVisPositionsValid = false; } } @@ -876,7 +844,7 @@ bool SvListView::SelectListEntry( SvTreeListEntry* pEntry, bool bSelect ) else { pViewData->SetSelected(true); - m_pImpl->m_nSelectionCount++; + m_nSelectionCount++; } } else @@ -886,7 +854,7 @@ bool SvListView::SelectListEntry( SvTreeListEntry* pEntry, bool bSelect ) else { pViewData->SetSelected(false); - m_pImpl->m_nSelectionCount--; + m_nSelectionCount--; } } return true; @@ -994,29 +962,28 @@ void SvTreeList::InvalidateEntry( SvTreeListEntry* pEntry ) } SvListView::SvListView() - : m_pImpl(new Impl(*this)) + : m_nVisibleCount(0) + , m_nSelectionCount(0) + , m_bVisPositionsValid(false) { m_pModel.reset(new SvTreeList(*this)); - m_pImpl->InitTable(); + InitTable(); } void SvListView::dispose() { m_pModel.reset(); } SvListView::~SvListView() { - m_pImpl->m_DataTable.clear(); + m_DataTable.clear(); } -sal_uInt32 SvListView::GetSelectionCount() const -{ return m_pImpl->m_nSelectionCount; } +sal_uInt32 SvListView::GetSelectionCount() const { return m_nSelectionCount; } -bool SvListView::HasViewData() const -{ return m_pImpl->m_DataTable.size() > 1; } // There's always a ROOT +bool SvListView::HasViewData() const { return m_DataTable.size() > 1; } // There's always a ROOT - -void SvListView::Impl::InitTable() +void SvListView::InitTable() { - DBG_ASSERT(m_rThis.m_pModel, "InitTable:No Model"); + DBG_ASSERT(m_pModel, "InitTable:No Model"); DBG_ASSERT(!m_nSelectionCount && !m_nVisibleCount && !m_bVisPositionsValid, "InitTable: Not cleared!"); @@ -1032,34 +999,34 @@ void SvListView::Impl::InitTable() SvTreeListEntry* pEntry; // insert root entry - pEntry = m_rThis.m_pModel->pRootItem.get(); + pEntry = m_pModel->pRootItem.get(); std::unique_ptr<SvViewDataEntry> pViewData(new SvViewDataEntry); pViewData->SetExpanded(true); m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData))); // now all the other entries - pEntry = m_rThis.m_pModel->First(); + pEntry = m_pModel->First(); while( pEntry ) { pViewData = std::make_unique<SvViewDataEntry>(); - m_rThis.InitViewData( pViewData.get(), pEntry ); + InitViewData(pViewData.get(), pEntry); m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData))); - pEntry = m_rThis.m_pModel->Next(pEntry); + pEntry = m_pModel->Next(pEntry); } } void SvListView::Clear() { - m_pImpl->m_DataTable.clear(); - m_pImpl->m_nSelectionCount = 0; - m_pImpl->m_nVisibleCount = 0; - m_pImpl->m_bVisPositionsValid = false; + m_DataTable.clear(); + m_nSelectionCount = 0; + m_nVisibleCount = 0; + m_bVisPositionsValid = false; if (m_pModel) { // insert root entry SvTreeListEntry* pEntry = m_pModel->pRootItem.get(); std::unique_ptr<SvViewDataEntry> pViewData(new SvViewDataEntry); pViewData->SetExpanded(true); - m_pImpl->m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData))); + m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData))); } } @@ -1099,11 +1066,11 @@ void SvListView::ModelHasEntryInvalidated( SvTreeListEntry*) { } -void SvListView::Impl::ActionMoving( SvTreeListEntry* pEntry ) +void SvListView::ActionMoving(SvTreeListEntry* pEntry) { SvTreeListEntry* pParent = pEntry->pParent; assert(pParent && "Model not consistent"); - if (pParent != m_rThis.m_pModel->pRootItem.get() && pParent->m_Children.size() == 1) + if (pParent != m_pModel->pRootItem.get() && pParent->m_Children.size() == 1) { const auto iter = m_DataTable.find(pParent); assert(iter != m_DataTable.end()); @@ -1115,50 +1082,50 @@ void SvListView::Impl::ActionMoving( SvTreeListEntry* pEntry ) m_bVisPositionsValid = false; } -void SvListView::Impl::ActionMoved() +void SvListView::ActionMoved() { m_nVisibleCount = 0; m_bVisPositionsValid = false; } -void SvListView::Impl::ActionInserted( SvTreeListEntry* pEntry ) +void SvListView::ActionInserted(SvTreeListEntry* pEntry) { DBG_ASSERT(pEntry,"Insert:No Entry"); std::unique_ptr<SvViewDataEntry> pData(new SvViewDataEntry()); - m_rThis.InitViewData( pData.get(), pEntry ); + InitViewData(pData.get(), pEntry); std::pair<SvDataTable::iterator, bool> aSuccess = m_DataTable.insert(std::make_pair(pEntry, std::move(pData))); DBG_ASSERT(aSuccess.second,"Entry already in View"); - if (m_nVisibleCount && m_rThis.m_pModel->IsEntryVisible(&m_rThis, pEntry)) + if (m_nVisibleCount && m_pModel->IsEntryVisible(this, pEntry)) { m_nVisibleCount = 0; m_bVisPositionsValid = false; } } -void SvListView::Impl::ActionInsertedTree( SvTreeListEntry* pEntry ) +void SvListView::ActionInsertedTree(SvTreeListEntry* pEntry) { - if (m_rThis.m_pModel->IsEntryVisible(&m_rThis, pEntry)) + if (m_pModel->IsEntryVisible(this, pEntry)) { m_nVisibleCount = 0; m_bVisPositionsValid = false; } // iterate over entry and its children SvTreeListEntry* pCurEntry = pEntry; - sal_uInt16 nRefDepth = m_rThis.m_pModel->GetDepth(pCurEntry); + sal_uInt16 nRefDepth = m_pModel->GetDepth(pCurEntry); while( pCurEntry ) { DBG_ASSERT(m_DataTable.find(pCurEntry) != m_DataTable.end(),"Entry already in Table"); std::unique_ptr<SvViewDataEntry> pViewData(new SvViewDataEntry()); - m_rThis.InitViewData( pViewData.get(), pEntry ); + InitViewData(pViewData.get(), pEntry); m_DataTable.insert(std::make_pair(pCurEntry, std::move(pViewData))); - pCurEntry = m_rThis.m_pModel->Next(pCurEntry); - if (pCurEntry && m_rThis.m_pModel->GetDepth(pCurEntry) <= nRefDepth) + pCurEntry = m_pModel->Next(pCurEntry); + if (pCurEntry && m_pModel->GetDepth(pCurEntry) <= nRefDepth) pCurEntry = nullptr; } } -void SvListView::Impl::RemoveViewData( SvTreeListEntry* pParent ) +void SvListView::RemoveViewData(SvTreeListEntry* pParent) { for (auto const& it : pParent->m_Children) { @@ -1169,8 +1136,7 @@ void SvListView::Impl::RemoveViewData( SvTreeListEntry* pParent ) } } - -void SvListView::Impl::ActionRemoving( SvTreeListEntry* pEntry ) +void SvListView::ActionRemoving(SvTreeListEntry* pEntry) { assert(pEntry && "Remove:No Entry"); const auto iter = m_DataTable.find(pEntry); @@ -1178,11 +1144,11 @@ void SvListView::Impl::ActionRemoving( SvTreeListEntry* pEntry ) SvViewDataEntry* pViewData = iter->second.get(); sal_uInt32 nSelRemoved = 0; if ( pViewData->IsSelected() ) - nSelRemoved = 1 + m_rThis.m_pModel->GetChildSelectionCount(&m_rThis, pEntry); + nSelRemoved = 1 + m_pModel->GetChildSelectionCount(this, pEntry); m_nSelectionCount -= nSelRemoved; sal_uInt32 nVisibleRemoved = 0; - if (m_rThis.m_pModel->IsEntryVisible(&m_rThis, pEntry)) - nVisibleRemoved = 1 + m_rThis.m_pModel->GetVisibleChildCount(&m_rThis, pEntry); + if (m_pModel->IsEntryVisible(this, pEntry)) + nVisibleRemoved = 1 + m_pModel->GetVisibleChildCount(this, pEntry); if( m_nVisibleCount ) { #ifdef DBG_UTIL @@ -1199,7 +1165,7 @@ void SvListView::Impl::ActionRemoving( SvTreeListEntry* pEntry ) RemoveViewData( pEntry ); SvTreeListEntry* pCurEntry = pEntry->pParent; - if (pCurEntry && pCurEntry != m_rThis.m_pModel->pRootItem.get() + if (pCurEntry && pCurEntry != m_pModel->pRootItem.get() && pCurEntry->m_Children.size() == 1) { SvDataTable::iterator itr = m_DataTable.find(pCurEntry); @@ -1216,26 +1182,26 @@ void SvListView::ModelNotification( SvListAction nActionId, SvTreeListEntry* pEn switch( nActionId ) { case SvListAction::INSERTED: - m_pImpl->ActionInserted( pEntry1 ); + ActionInserted(pEntry1); ModelHasInserted( pEntry1 ); break; case SvListAction::INSERTED_TREE: - m_pImpl->ActionInsertedTree( pEntry1 ); + ActionInsertedTree(pEntry1); ModelHasInsertedTree( pEntry1 ); break; case SvListAction::REMOVING: ModelIsRemoving( pEntry1 ); - m_pImpl->ActionRemoving( pEntry1 ); + ActionRemoving(pEntry1); break; case SvListAction::REMOVED: ModelHasRemoved( pEntry1 ); break; case SvListAction::MOVING: ModelIsMoving( pEntry1 ); - m_pImpl->ActionMoving( pEntry1 ); + ActionMoving(pEntry1); break; case SvListAction::MOVED: - m_pImpl->ActionMoved(); + ActionMoved(); ModelHasMoved( pEntry1 ); break; case SvListAction::CLEARING: @@ -1249,7 +1215,7 @@ void SvListView::ModelNotification( SvListAction nActionId, SvTreeListEntry* pEn ModelHasEntryInvalidated( pEntry1 ); break; case SvListAction::RESORTED: - m_pImpl->m_bVisPositionsValid = false; + m_bVisPositionsValid = false; break; case SvListAction::RESORTING: break; @@ -1265,8 +1231,8 @@ void SvListView::InitViewData( SvViewDataEntry*, SvTreeListEntry* ) bool SvListView::IsExpanded( SvTreeListEntry* pEntry ) const { DBG_ASSERT(pEntry,"IsExpanded:No Entry"); - SvDataTable::const_iterator itr = m_pImpl->m_DataTable.find(pEntry); - if (itr == m_pImpl->m_DataTable.end()) + SvDataTable::const_iterator itr = m_DataTable.find(pEntry); + if (itr == m_DataTable.end()) return false; return itr->second->IsExpanded(); } @@ -1291,8 +1257,8 @@ bool SvListView::IsAllExpanded( SvTreeListEntry* pEntry ) const bool SvListView::IsSelected(const SvTreeListEntry* pEntry) const { DBG_ASSERT(pEntry,"IsExpanded:No Entry"); - SvDataTable::const_iterator itr = m_pImpl->m_DataTable.find(const_cast<SvTreeListEntry*>(pEntry)); - if (itr == m_pImpl->m_DataTable.end()) + SvDataTable::const_iterator itr = m_DataTable.find(const_cast<SvTreeListEntry*>(pEntry)); + if (itr == m_DataTable.end()) return false; return itr->second->IsSelected(); } @@ -1300,17 +1266,16 @@ bool SvListView::IsSelected(const SvTreeListEntry* pEntry) const void SvListView::SetEntryFocus( SvTreeListEntry* pEntry, bool bFocus ) { DBG_ASSERT(pEntry,"SetEntryFocus:No Entry"); - SvDataTable::iterator itr = m_pImpl->m_DataTable.find(pEntry); - assert(itr != m_pImpl->m_DataTable.end() && "Entry not in Table"); + SvDataTable::iterator itr = m_DataTable.find(pEntry); + assert(itr != m_DataTable.end() && "Entry not in Table"); itr->second->SetFocus(bFocus); } const SvViewDataEntry* SvListView::GetViewData( const SvTreeListEntry* pEntry ) const { - SvDataTable::const_iterator itr = - m_pImpl->m_DataTable.find(const_cast<SvTreeListEntry*>(pEntry)); - assert(itr != m_pImpl->m_DataTable.end() && "Entry not in model or wrong view"); - if (itr == m_pImpl->m_DataTable.end()) + SvDataTable::const_iterator itr = m_DataTable.find(const_cast<SvTreeListEntry*>(pEntry)); + assert(itr != m_DataTable.end() && "Entry not in model or wrong view"); + if (itr == m_DataTable.end()) return nullptr; return itr->second.get(); } commit e6575213968e4713019b72ce4b17c79afc322848 Author: Michael Weghorn <[email protected]> AuthorDate: Mon Feb 16 10:26:02 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Feb 16 23:07:35 2026 +0100 vcl: Prefix SvListView's "pModel" member with "m_" Change-Id: Ibb164da6b67efe61b5a4757d9ee7077f12c2346b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199467 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/toolkit/treelist.hxx b/include/vcl/toolkit/treelist.hxx index 24b634f3f8f2..e13f079f530f 100644 --- a/include/vcl/toolkit/treelist.hxx +++ b/include/vcl/toolkit/treelist.hxx @@ -209,7 +209,7 @@ class UNLESS_MERGELIBS_MORE(VCL_DLLPUBLIC) SvListView std::unique_ptr<Impl> m_pImpl; protected: - std::unique_ptr<SvTreeList> pModel; + std::unique_ptr<SvTreeList> m_pModel; void ExpandListEntry( SvTreeListEntry* pParent ); void CollapseListEntry( SvTreeListEntry* pParent ); @@ -228,51 +228,72 @@ public: ); sal_uInt32 GetVisibleCount() const - { return pModel->GetVisibleCount( const_cast<SvListView*>(this) ); } + { + return m_pModel->GetVisibleCount(const_cast<SvListView*>(this)); + } - SvTreeListEntry* FirstVisible() const - { return pModel->FirstVisible(); } + SvTreeListEntry* FirstVisible() const { return m_pModel->FirstVisible(); } SvTreeListEntry* NextVisible( SvTreeListEntry* pEntry ) const - { return pModel->NextVisible(this,pEntry); } + { + return m_pModel->NextVisible(this, pEntry); + } SvTreeListEntry* PrevVisible( SvTreeListEntry* pEntry ) const - { return pModel->PrevVisible(this,pEntry); } + { + return m_pModel->PrevVisible(this, pEntry); + } - SvTreeListEntry* LastVisible() const - { return pModel->LastVisible(this); } + SvTreeListEntry* LastVisible() const { return m_pModel->LastVisible(this); } SvTreeListEntry* NextVisible( SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const - { return pModel->NextVisible(this,pEntry,rDelta); } + { + return m_pModel->NextVisible(this, pEntry, rDelta); + } SvTreeListEntry* PrevVisible( SvTreeListEntry* pEntry, sal_uInt16& rDelta ) const - { return pModel->PrevVisible(this,pEntry,rDelta); } + { + return m_pModel->PrevVisible(this, pEntry, rDelta); + } sal_uInt32 GetSelectionCount() const; - SvTreeListEntry* FirstSelected() const - { return pModel->FirstSelected(this); } + SvTreeListEntry* FirstSelected() const { return m_pModel->FirstSelected(this); } SvTreeListEntry* NextSelected( SvTreeListEntry* pEntry ) const - { return pModel->NextSelected(this,pEntry); } + { + return m_pModel->NextSelected(this, pEntry); + } SvTreeListEntry* GetEntryAtAbsPos( sal_uInt32 nAbsPos ) const - { return pModel->GetEntryAtAbsPos(nAbsPos); } + { + return m_pModel->GetEntryAtAbsPos(nAbsPos); + } SvTreeListEntry* GetEntryAtVisPos( sal_uInt32 nVisPos ) const - { return pModel->GetEntryAtVisPos(this,nVisPos); } + { + return m_pModel->GetEntryAtVisPos(this, nVisPos); + } sal_uInt32 GetAbsPos( SvTreeListEntry const * pEntry ) const - { return pModel->GetAbsPos(pEntry); } + { + return m_pModel->GetAbsPos(pEntry); + } sal_uInt32 GetVisiblePos( SvTreeListEntry const * pEntry ) const - { return pModel->GetVisiblePos(this,pEntry); } + { + return m_pModel->GetVisiblePos(this, pEntry); + } sal_uInt32 GetVisibleChildCount(SvTreeListEntry* pParent ) const - { return pModel->GetVisibleChildCount(this,pParent); } + { + return m_pModel->GetVisibleChildCount(this, pParent); + } bool IsEntryVisible( SvTreeListEntry* pEntry ) const - { return pModel->IsEntryVisible(this,pEntry); } + { + return m_pModel->IsEntryVisible(this, pEntry); + } bool IsExpanded( SvTreeListEntry* pEntry ) const; bool IsAllExpanded( SvTreeListEntry* pEntry) const; diff --git a/include/vcl/toolkit/treelistbox.hxx b/include/vcl/toolkit/treelistbox.hxx index 3e929b27c0b5..61241ef89398 100644 --- a/include/vcl/toolkit/treelistbox.hxx +++ b/include/vcl/toolkit/treelistbox.hxx @@ -339,27 +339,12 @@ public: virtual ~SvTreeListBox() override; virtual void dispose() override; - SvTreeList* GetModel() const - { - return pModel.get(); - } - - sal_uInt32 GetEntryCount() const - { - return pModel ? pModel->GetEntryCount() : 0; - } - SvTreeListEntry* First() const - { - return pModel ? pModel->First() : nullptr; - } - SvTreeListEntry* Next( SvTreeListEntry* pEntry ) const - { - return pModel->Next(pEntry); - } - SvTreeListEntry* Last() const - { - return pModel ? pModel->Last() : nullptr; - } + SvTreeList* GetModel() const { return m_pModel.get(); } + + sal_uInt32 GetEntryCount() const { return m_pModel ? m_pModel->GetEntryCount() : 0; } + SvTreeListEntry* First() const { return m_pModel ? m_pModel->First() : nullptr; } + SvTreeListEntry* Next(SvTreeListEntry* pEntry) const { return m_pModel->Next(pEntry); } + SvTreeListEntry* Last() const { return m_pModel ? m_pModel->Last() : nullptr; } SvTreeListEntry* FirstChild(const SvTreeListEntry* pParent) const; diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index b1676725a67c..66ed4f706c18 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -152,9 +152,9 @@ void SvImpLBox::UpdateStringSorter() short SvImpLBox::UpdateContextBmpWidthVector( SvTreeListEntry const * pEntry, short nWidth ) { - DBG_ASSERT( m_pView->pModel, "View and Model aren't valid!" ); + DBG_ASSERT(m_pView->m_pModel, "View and Model aren't valid!"); - sal_uInt16 nDepth = m_pView->pModel->GetDepth( pEntry ); + sal_uInt16 nDepth = m_pView->m_pModel->GetDepth(pEntry); // initialize vector if necessary std::vector< short >::size_type nSize = m_aContextBmpWidthVector.size(); while ( nDepth > nSize ) @@ -202,7 +202,7 @@ void SvImpLBox::UpdateContextBmpWidthVectorFromMovedEntry( SvTreeListEntry* pEnt void SvImpLBox::UpdateContextBmpWidthMax( SvTreeListEntry const * pEntry ) { - sal_uInt16 nDepth = m_pView->pModel->GetDepth( pEntry ); + sal_uInt16 nDepth = m_pView->m_pModel->GetDepth(pEntry); if( m_aContextBmpWidthVector.empty() ) return; short nWidth = m_aContextBmpWidthVector[ nDepth ]; diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx index c392fc41e7c1..e6d405b46975 100644 --- a/vcl/source/treelist/treelist.cxx +++ b/vcl/source/treelist/treelist.cxx @@ -996,14 +996,11 @@ void SvTreeList::InvalidateEntry( SvTreeListEntry* pEntry ) SvListView::SvListView() : m_pImpl(new Impl(*this)) { - pModel.reset(new SvTreeList(*this)); + m_pModel.reset(new SvTreeList(*this)); m_pImpl->InitTable(); } -void SvListView::dispose() -{ - pModel.reset(); -} +void SvListView::dispose() { m_pModel.reset(); } SvListView::~SvListView() { @@ -1019,7 +1016,7 @@ bool SvListView::HasViewData() const void SvListView::Impl::InitTable() { - DBG_ASSERT(m_rThis.pModel,"InitTable:No Model"); + DBG_ASSERT(m_rThis.m_pModel, "InitTable:No Model"); DBG_ASSERT(!m_nSelectionCount && !m_nVisibleCount && !m_bVisPositionsValid, "InitTable: Not cleared!"); @@ -1035,18 +1032,18 @@ void SvListView::Impl::InitTable() SvTreeListEntry* pEntry; // insert root entry - pEntry = m_rThis.pModel->pRootItem.get(); + pEntry = m_rThis.m_pModel->pRootItem.get(); std::unique_ptr<SvViewDataEntry> pViewData(new SvViewDataEntry); pViewData->SetExpanded(true); m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData))); // now all the other entries - pEntry = m_rThis.pModel->First(); + pEntry = m_rThis.m_pModel->First(); while( pEntry ) { pViewData = std::make_unique<SvViewDataEntry>(); m_rThis.InitViewData( pViewData.get(), pEntry ); m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData))); - pEntry = m_rThis.pModel->Next( pEntry ); + pEntry = m_rThis.m_pModel->Next(pEntry); } } @@ -1056,10 +1053,10 @@ void SvListView::Clear() m_pImpl->m_nSelectionCount = 0; m_pImpl->m_nVisibleCount = 0; m_pImpl->m_bVisPositionsValid = false; - if( pModel ) + if (m_pModel) { // insert root entry - SvTreeListEntry* pEntry = pModel->pRootItem.get(); + SvTreeListEntry* pEntry = m_pModel->pRootItem.get(); std::unique_ptr<SvViewDataEntry> pViewData(new SvViewDataEntry); pViewData->SetExpanded(true); m_pImpl->m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData))); @@ -1106,7 +1103,7 @@ void SvListView::Impl::ActionMoving( SvTreeListEntry* pEntry ) { SvTreeListEntry* pParent = pEntry->pParent; assert(pParent && "Model not consistent"); - if (pParent != m_rThis.pModel->pRootItem.get() && pParent->m_Children.size() == 1) + if (pParent != m_rThis.m_pModel->pRootItem.get() && pParent->m_Children.size() == 1) { const auto iter = m_DataTable.find(pParent); assert(iter != m_DataTable.end()); @@ -1132,7 +1129,7 @@ void SvListView::Impl::ActionInserted( SvTreeListEntry* pEntry ) std::pair<SvDataTable::iterator, bool> aSuccess = m_DataTable.insert(std::make_pair(pEntry, std::move(pData))); DBG_ASSERT(aSuccess.second,"Entry already in View"); - if (m_nVisibleCount && m_rThis.pModel->IsEntryVisible(&m_rThis, pEntry)) + if (m_nVisibleCount && m_rThis.m_pModel->IsEntryVisible(&m_rThis, pEntry)) { m_nVisibleCount = 0; m_bVisPositionsValid = false; @@ -1141,22 +1138,22 @@ void SvListView::Impl::ActionInserted( SvTreeListEntry* pEntry ) void SvListView::Impl::ActionInsertedTree( SvTreeListEntry* pEntry ) { - if (m_rThis.pModel->IsEntryVisible(&m_rThis, pEntry)) + if (m_rThis.m_pModel->IsEntryVisible(&m_rThis, pEntry)) { m_nVisibleCount = 0; m_bVisPositionsValid = false; } // iterate over entry and its children SvTreeListEntry* pCurEntry = pEntry; - sal_uInt16 nRefDepth = m_rThis.pModel->GetDepth( pCurEntry ); + sal_uInt16 nRefDepth = m_rThis.m_pModel->GetDepth(pCurEntry); while( pCurEntry ) { DBG_ASSERT(m_DataTable.find(pCurEntry) != m_DataTable.end(),"Entry already in Table"); std::unique_ptr<SvViewDataEntry> pViewData(new SvViewDataEntry()); m_rThis.InitViewData( pViewData.get(), pEntry ); m_DataTable.insert(std::make_pair(pCurEntry, std::move(pViewData))); - pCurEntry = m_rThis.pModel->Next( pCurEntry ); - if ( pCurEntry && m_rThis.pModel->GetDepth(pCurEntry) <= nRefDepth) + pCurEntry = m_rThis.m_pModel->Next(pCurEntry); + if (pCurEntry && m_rThis.m_pModel->GetDepth(pCurEntry) <= nRefDepth) pCurEntry = nullptr; } } @@ -1181,11 +1178,11 @@ void SvListView::Impl::ActionRemoving( SvTreeListEntry* pEntry ) SvViewDataEntry* pViewData = iter->second.get(); sal_uInt32 nSelRemoved = 0; if ( pViewData->IsSelected() ) - nSelRemoved = 1 + m_rThis.pModel->GetChildSelectionCount(&m_rThis, pEntry); + nSelRemoved = 1 + m_rThis.m_pModel->GetChildSelectionCount(&m_rThis, pEntry); m_nSelectionCount -= nSelRemoved; sal_uInt32 nVisibleRemoved = 0; - if (m_rThis.pModel->IsEntryVisible(&m_rThis, pEntry)) - nVisibleRemoved = 1 + m_rThis.pModel->GetVisibleChildCount(&m_rThis, pEntry); + if (m_rThis.m_pModel->IsEntryVisible(&m_rThis, pEntry)) + nVisibleRemoved = 1 + m_rThis.m_pModel->GetVisibleChildCount(&m_rThis, pEntry); if( m_nVisibleCount ) { #ifdef DBG_UTIL @@ -1202,7 +1199,8 @@ void SvListView::Impl::ActionRemoving( SvTreeListEntry* pEntry ) RemoveViewData( pEntry ); SvTreeListEntry* pCurEntry = pEntry->pParent; - if (pCurEntry && pCurEntry != m_rThis.pModel->pRootItem.get() && pCurEntry->m_Children.size() == 1) + if (pCurEntry && pCurEntry != m_rThis.m_pModel->pRootItem.get() + && pCurEntry->m_Children.size() == 1) { SvDataTable::iterator itr = m_DataTable.find(pCurEntry); assert(itr != m_DataTable.end() && "Entry not in Table"); diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index cb84119c359a..d5f2c504d5ac 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -421,22 +421,22 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits nWinStyle) : nImpFlags = SvTreeListBoxFlags::NONE; pTargetEntry = nullptr; nDragDropMode = DragDropMode::NONE; - pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl )); + m_pModel->SetCloneLink(LINK(this, SvTreeListBox, CloneHdl_Impl)); pHdlEntry = nullptr; eSelMode = SelectionMode::Single; nDragDropMode = DragDropMode::NONE; SetType(WindowType::TREELISTBOX); InitTreeView(); - pImpl->SetModel( pModel.get() ); + pImpl->SetModel(m_pModel.get()); SetSublistOpenWithLeftRight(); } void SvTreeListBox::Clear() { - if (pModel) - pModel->Clear(); // Model calls SvTreeListBox::ModelHasCleared() + if (m_pModel) + m_pModel->Clear(); // Model calls SvTreeListBox::ModelHasCleared() } IMPL_LINK( SvTreeListBox, CloneHdl_Impl, SvTreeListEntry*, pEntry, SvTreeListEntry* ) @@ -446,12 +446,12 @@ IMPL_LINK( SvTreeListBox, CloneHdl_Impl, SvTreeListEntry*, pEntry, SvTreeListEnt void SvTreeListBox::Insert(SvTreeListEntry* pEntry, SvTreeListEntry* pParent, sal_uInt32 nPos) { - pModel->Insert(pEntry, pParent, nPos); + m_pModel->Insert(pEntry, pParent, nPos); } void SvTreeListBox::Insert(SvTreeListEntry* pEntry, sal_uInt32 nRootPos) { - pModel->Insert(pEntry, nRootPos); + m_pModel->Insert(pEntry, nRootPos); } bool SvTreeListBox::ExpandingHdl() @@ -559,7 +559,7 @@ TriState SvTreeListBox::NotifyCopying( SvTreeListEntry* SvTreeListBox::FirstChild(const SvTreeListEntry* pParent) const { - return pModel->FirstChild(pParent); + return m_pModel->FirstChild(pParent); } sal_uInt32 SvTreeListBox::GetEntryPos(const SvTreeListEntry* pEntry) const @@ -583,8 +583,8 @@ bool SvTreeListBox::CopySelection( SvTreeListBox* pSource, SvTreeListEntry* pTar bool bSuccess = true; std::vector<SvTreeListEntry*> aList; bool bClone = ( pSource->GetModel() != GetModel() ); - Link<SvTreeListEntry*,SvTreeListEntry*> aCloneLink( pModel->GetCloneLink() ); - pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl )); + Link<SvTreeListEntry*, SvTreeListEntry*> aCloneLink(m_pModel->GetCloneLink()); + m_pModel->SetCloneLink(LINK(this, SvTreeListBox, CloneHdl_Impl)); // cache selection to simplify iterating over the selection when doing a D&D // exchange within the same listbox @@ -608,12 +608,12 @@ bool SvTreeListBox::CopySelection( SvTreeListBox* pSource, SvTreeListEntry* pTar if ( bClone ) { sal_uInt32 nCloneCount = 0; - pSourceEntry = pModel->Clone(pSourceEntry, nCloneCount); - pModel->InsertTree(pSourceEntry, pNewParent, nInsertionPos); + pSourceEntry = m_pModel->Clone(pSourceEntry, nCloneCount); + m_pModel->InsertTree(pSourceEntry, pNewParent, nInsertionPos); } else { - sal_uInt32 nListPos = pModel->Copy(pSourceEntry, pNewParent, nInsertionPos); + sal_uInt32 nListPos = m_pModel->Copy(pSourceEntry, pNewParent, nInsertionPos); pSourceEntry = GetEntry( pNewParent, nListPos ); } } @@ -623,7 +623,7 @@ bool SvTreeListBox::CopySelection( SvTreeListBox* pSource, SvTreeListEntry* pTar if (nOk == TRISTATE_INDET) // HACK: make visible moved entry MakeVisible( pSourceEntry ); } - pModel->SetCloneLink( aCloneLink ); + m_pModel->SetCloneLink(aCloneLink); return bSuccess; } @@ -634,9 +634,9 @@ bool SvTreeListBox::MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, S bool bSuccess = true; std::vector<SvTreeListEntry*> aList; bool bClone = ( pSource->GetModel() != GetModel() ); - Link<SvTreeListEntry*,SvTreeListEntry*> aCloneLink( pModel->GetCloneLink() ); + Link<SvTreeListEntry*, SvTreeListEntry*> aCloneLink(m_pModel->GetCloneLink()); if ( bClone ) - pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl )); + m_pModel->SetCloneLink(LINK(this, SvTreeListBox, CloneHdl_Impl)); SvTreeListEntry* pSourceEntry = pSource->FirstSelected(); while ( pSourceEntry ) @@ -665,15 +665,15 @@ bool SvTreeListBox::MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, S if ( bClone ) { sal_uInt32 nCloneCount = 0; - pSourceEntry = pModel->Clone(pSourceEntry, nCloneCount); - pModel->InsertTree(pSourceEntry, pNewParent, nInsertionPos); + pSourceEntry = m_pModel->Clone(pSourceEntry, nCloneCount); + m_pModel->InsertTree(pSourceEntry, pNewParent, nInsertionPos); } else { if ( nOk ) - pModel->Move(pSourceEntry, pNewParent, nInsertionPos); + m_pModel->Move(pSourceEntry, pNewParent, nInsertionPos); else - pModel->Copy(pSourceEntry, pNewParent, nInsertionPos); + m_pModel->Copy(pSourceEntry, pNewParent, nInsertionPos); } } else @@ -682,7 +682,7 @@ bool SvTreeListBox::MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, S if (nOk == TRISTATE_INDET) // HACK: make moved entry visible MakeVisible( pSourceEntry ); } - pModel->SetCloneLink( aCloneLink ); + m_pModel->SetCloneLink(aCloneLink); return bSuccess; } @@ -702,13 +702,10 @@ void SvTreeListBox::RemoveSelection() } for (auto const& elem : aList) - pModel->Remove(elem); + m_pModel->Remove(elem); } -void SvTreeListBox::RemoveEntry(SvTreeListEntry const * pEntry) -{ - pModel->Remove(pEntry); -} +void SvTreeListBox::RemoveEntry(SvTreeListEntry const* pEntry) { m_pModel->Remove(pEntry); } void SvTreeListBox::RecalcViewData() { @@ -748,12 +745,12 @@ void SvTreeListBox::OnCurrentEntryChanged() SvTreeListEntry* SvTreeListBox::GetEntry( SvTreeListEntry* pParent, sal_uInt32 nPos ) const { - return pModel->GetEntry(pParent, nPos); + return m_pModel->GetEntry(pParent, nPos); } SvTreeListEntry* SvTreeListBox::GetEntry( sal_uInt32 nRootPos ) const { - return pModel->GetEntry(nRootPos); + return m_pModel->GetEntry(nRootPos); } SvTreeListEntry* SvTreeListBox::GetEntryFromPath( const ::std::deque< sal_Int32 >& _rPath ) const @@ -805,12 +802,12 @@ void SvTreeListBox::FillEntryPath( SvTreeListEntry* pEntry, ::std::deque< sal_In SvTreeListEntry* SvTreeListBox::GetParent( SvTreeListEntry* pEntry ) const { - return pModel->GetParent(pEntry); + return m_pModel->GetParent(pEntry); } sal_uInt32 SvTreeListBox::GetChildCount( SvTreeListEntry const * pParent ) const { - return pModel->GetChildCount(pParent); + return m_pModel->GetChildCount(pParent); } sal_uInt32 SvTreeListBox::GetLevelChildCount( SvTreeListEntry* _pParent ) const @@ -883,9 +880,9 @@ void SvTreeListBox::EnableSelectionAsDropTarget( bool bEnable ) if ( !bEnable ) { pSelEntry->nEntryFlags |= SvTLEntryFlags::DISABLE_DROP; - nRefDepth = pModel->GetDepth( pSelEntry ); + nRefDepth = m_pModel->GetDepth(pSelEntry); pTemp = Next( pSelEntry ); - while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth ) + while (pTemp && m_pModel->GetDepth(pTemp) > nRefDepth) { pTemp->nEntryFlags |= SvTLEntryFlags::DISABLE_DROP; pTemp = Next( pTemp ); @@ -894,9 +891,9 @@ void SvTreeListBox::EnableSelectionAsDropTarget( bool bEnable ) else { pSelEntry->nEntryFlags &= ~SvTLEntryFlags::DISABLE_DROP; - nRefDepth = pModel->GetDepth( pSelEntry ); + nRefDepth = m_pModel->GetDepth(pSelEntry); pTemp = Next( pSelEntry ); - while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth ) + while (pTemp && m_pModel->GetDepth(pTemp) > nRefDepth) { pTemp->nEntryFlags &= ~SvTLEntryFlags::DISABLE_DROP; pTemp = Next( pTemp ); @@ -1683,8 +1680,7 @@ void SvTreeListBox::CheckBoxInserted(SvTreeListEntry* pEntry) void SvTreeListBox::ImpEntryInserted( SvTreeListEntry* pEntry ) { - - SvTreeListEntry* pParent = pModel->GetParent( pEntry ); + SvTreeListEntry* pParent = m_pModel->GetParent(pEntry); if( pParent ) { SvTLEntryFlags nFlags = pParent->GetFlags(); @@ -2176,13 +2172,13 @@ sal_uInt32 SvTreeListBox::SelectChildren( SvTreeListEntry* pParent, bool bSelect sal_uInt32 nRet = 0; if( !pParent->HasChildren() ) return 0; - sal_uInt16 nRefDepth = pModel->GetDepth( pParent ); + sal_uInt16 nRefDepth = m_pModel->GetDepth(pParent); SvTreeListEntry* pChild = FirstChild( pParent ); do { nRet++; Select( pChild, bSelect ); pChild = Next( pChild ); - } while( pChild && pModel->GetDepth( pChild ) > nRefDepth ); + } while (pChild && m_pModel->GetDepth(pChild) > nRefDepth); return nRet; } @@ -2196,13 +2192,13 @@ void SvTreeListBox::SelectAll( bool bSelect ) void SvTreeListBox::ModelHasInsertedTree( SvTreeListEntry* pEntry ) { - sal_uInt16 nRefDepth = pModel->GetDepth( pEntry ); + sal_uInt16 nRefDepth = m_pModel->GetDepth(pEntry); SvTreeListEntry* pTmp = pEntry; do { ImpEntryInserted( pTmp ); pTmp = Next( pTmp ); - } while( pTmp && nRefDepth < pModel->GetDepth( pTmp ) ); + } while (pTmp && nRefDepth < m_pModel->GetDepth(pTmp)); pImpl->TreeInserted( pEntry ); } @@ -2514,7 +2510,7 @@ void SvTreeListBox::EditedText( const OUString& rStr ) if( EditedEntry( pEdEntry, rStr ) ) { pEdItem->SetText( rStr ); - pModel->InvalidateEntry( pEdEntry ); + m_pModel->InvalidateEntry(pEdEntry); } if( GetSelectionCount() == 0 ) Select( pEdEntry ); @@ -2680,7 +2676,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, tools::Long nLine, vcl: if (pNextTab && (GetTabPos(&rEntry, pNextTab) <= nDynTabPos)) return; - if (!((nWindowStyle & WB_HASBUTTONSATROOT) || pModel->GetDepth(&rEntry) > 0)) + if (!((nWindowStyle & WB_HASBUTTONSATROOT) || m_pModel->GetDepth(&rEntry) > 0)) return; aImagePos = Point(GetTabPos(&rEntry, pFirstDynamicTab), nLine); @@ -3053,7 +3049,7 @@ sal_IntPtr SvTreeListBox::GetTabPos(const SvTreeListEntry* pEntry, const SvLBoxT sal_IntPtr nPos = pTab->GetPos(); if( pTab->IsDynamic() ) { - sal_uInt16 nDepth = pModel->GetDepth( pEntry ); + sal_uInt16 nDepth = m_pModel->GetDepth(pEntry); nDepth = nDepth * static_cast<sal_uInt16>(nIndent); nPos += static_cast<sal_IntPtr>(nDepth); } @@ -3423,7 +3419,7 @@ void SvTreeListBox::ModelNotification( SvListAction nActionId, SvTreeListEntry* case SvListAction::RESORTED: // after a selection: show first entry and also keep the selection - MakeVisible( pModel->First(), true ); + MakeVisible(m_pModel->First(), true); SetUpdateMode( true ); break;
