[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 16 08:50:23 UTC 2020


 vcl/source/app/salvtables.cxx |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 14f7f17d63cc15896b3b502a349640c15c90d08f
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Nov 9 16:05:43 2020 +0000
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Nov 16 09:49:40 2020 +0100

    tdf#136962 only do implicit SetUpdateMode optimization if the widget is hidden
    
    callers can always opt-in with freeze/thaw for the lesser optimization
    available if shown
    
    Change-Id: Ib9317451a3059cc33f70d0c23543d8024bd21ede
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105487
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105515
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index acd296cf3223..d7c93164a676 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3184,7 +3184,9 @@ static SalInstanceTreeView* g_DragSource;
 
 namespace
 {
-    class UpdateGuard
+    // tdf#131581 if the TreeView is hidden then there are possibly additional
+    // optimizations available
+    class UpdateGuardIfHidden
     {
     private:
         SvTabListBox& m_rTreeView;
@@ -3192,10 +3194,11 @@ namespace
         bool m_bOrigEnableInvalidate;
 
     public:
-        UpdateGuard(SvTabListBox& rTreeView)
+        UpdateGuardIfHidden(SvTabListBox& rTreeView)
             : m_rTreeView(rTreeView)
-            , m_bOrigUpdate(m_rTreeView.IsUpdateMode())
-            // tdf#137432 only do the EnableInvalidate(false) optimization if the widget is currently hidden
+            // tdf#136962 only do SetUpdateMode(false) optimization if the widget is currently hidden
+            , m_bOrigUpdate(!m_rTreeView.IsVisible() && m_rTreeView.IsUpdateMode())
+            // tdf#137432 only do EnableInvalidate(false) optimization if the widget is currently hidden
             , m_bOrigEnableInvalidate(!m_rTreeView.IsVisible() && m_rTreeView.GetModel()->IsEnableInvalidate())
         {
             if (m_bOrigUpdate)
@@ -3204,7 +3207,7 @@ namespace
                 m_rTreeView.GetModel()->EnableInvalidate(false);
         }
 
-        ~UpdateGuard()
+        ~UpdateGuardIfHidden()
         {
             if (m_bOrigEnableInvalidate)
                 m_rTreeView.GetModel()->EnableInvalidate(true);
@@ -4342,7 +4345,7 @@ public:
 
     virtual void all_foreach(const std::function<bool(weld::TreeIter&)>& func) override
     {
-        UpdateGuard aGuard(*m_xTreeView);
+        UpdateGuardIfHidden aGuard(*m_xTreeView);
 
         SalInstanceTreeIter aVclIter(m_xTreeView->First());
         while (aVclIter.iter)


More information about the Libreoffice-commits mailing list