diff options
author | Henry Castro <hcastro@collabora.com> | 2020-12-17 10:33:19 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2021-01-19 00:48:54 +0100 |
commit | c73ad59e85dd56668bbd960ab27a27ea76971043 (patch) | |
tree | 45d2ee1892c1fc4a095e45bf7807b428433e7012 /vcl | |
parent | 5e4941d1c9ebfca900dd3a2414184e2f82472cc9 (diff) |
lok: check if the tree list box model has changed
It is necessary to know when the tree list model
has changed to notify client side changes.
Change-Id: I188a97223e06520d0b34cd9272eff6449a14d60e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107892
Tested-by: Jenkins
Reviewed-by: Henry Castro <hcastro@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109140
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/treelist/treelist.cxx | 8 | ||||
-rw-r--r-- | vcl/source/treelist/treelistbox.cxx | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx index 681bef4d0c7d..b9fb0112ec38 100644 --- a/vcl/source/treelist/treelist.cxx +++ b/vcl/source/treelist/treelist.cxx @@ -1077,6 +1077,7 @@ SvListView::SvListView() { pModel.reset(new SvTreeList(*this)); m_pImpl->InitTable(); + m_bDirtyModel = false; } void SvListView::dispose() @@ -1293,15 +1294,18 @@ void SvListView::Impl::ActionClear() void SvListView::ModelNotification( SvListAction nActionId, SvTreeListEntry* pEntry1, SvTreeListEntry* /*pEntry2*/, sal_uLong /*nPos*/ ) { + switch( nActionId ) { case SvListAction::INSERTED: m_pImpl->ActionInserted( pEntry1 ); ModelHasInserted( pEntry1 ); + m_bDirtyModel = true; break; case SvListAction::INSERTED_TREE: m_pImpl->ActionInsertedTree( pEntry1 ); ModelHasInsertedTree( pEntry1 ); + m_bDirtyModel = true; break; case SvListAction::REMOVING: ModelIsRemoving( pEntry1 ); @@ -1309,6 +1313,7 @@ void SvListView::ModelNotification( SvListAction nActionId, SvTreeListEntry* pEn break; case SvListAction::REMOVED: ModelHasRemoved( pEntry1 ); + m_bDirtyModel = true; break; case SvListAction::MOVING: ModelIsMoving( pEntry1 ); @@ -1317,12 +1322,14 @@ void SvListView::ModelNotification( SvListAction nActionId, SvTreeListEntry* pEn case SvListAction::MOVED: m_pImpl->ActionMoved(); ModelHasMoved( pEntry1 ); + m_bDirtyModel = true; break; case SvListAction::CLEARING: m_pImpl->ActionClear(); ModelHasCleared(); // sic! for compatibility reasons! break; case SvListAction::CLEARED: + m_bDirtyModel = true; break; case SvListAction::INVALIDATE_ENTRY: // no action for the base class @@ -1330,6 +1337,7 @@ void SvListView::ModelNotification( SvListAction nActionId, SvTreeListEntry* pEn break; case SvListAction::RESORTED: m_pImpl->m_bVisPositionsValid = false; + m_bDirtyModel = true; break; case SvListAction::RESORTING: break; diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index f6653c7b508d..b40a389f9325 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -389,6 +389,7 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits nWinStyle) : pImpl->SetModel( pModel.get() ); SetSublistOpenWithLeftRight(); + m_bDirtyModel = false; } void SvTreeListBox::Clear() |