[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl vcl/source

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Mon Jan 18 23:49:30 UTC 2021


 include/vcl/treelist.hxx            |    6 ++++++
 vcl/source/treelist/treelist.cxx    |    8 ++++++++
 vcl/source/treelist/treelistbox.cxx |    1 +
 3 files changed, 15 insertions(+)

New commits:
commit c73ad59e85dd56668bbd960ab27a27ea76971043
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Dec 17 10:33:19 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Tue Jan 19 00:48:54 2021 +0100

    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 at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109140
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/include/vcl/treelist.hxx b/include/vcl/treelist.hxx
index ffb359a4e8f8..1b1b28979a95 100644
--- a/include/vcl/treelist.hxx
+++ b/include/vcl/treelist.hxx
@@ -214,6 +214,7 @@ class VCL_DLLPUBLIC SvListView
     std::unique_ptr<Impl> m_pImpl;
 
 protected:
+    bool                        m_bDirtyModel;
     std::unique_ptr<SvTreeList> pModel;
 
     void                ExpandListEntry( SvTreeListEntry* pParent );
@@ -232,6 +233,11 @@ public:
                             sal_uLong nPos
                         );
 
+    bool                IsDirtyModel() const
+    { return m_bDirtyModel; }
+    void                SetDirtyModel(bool bValue)
+    { m_bDirtyModel = bValue; }
+
     sal_uLong           GetVisibleCount() const
     { return pModel->GetVisibleCount( const_cast<SvListView*>(this) ); }
 
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()


More information about the Libreoffice-commits mailing list