summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-11-09 16:05:43 +0000
committerMiklos Vajna <vmiklos@collabora.com>2020-11-16 09:49:40 +0100
commit14f7f17d63cc15896b3b502a349640c15c90d08f (patch)
treeac5d989b5bf693cf922e6d50562a7250ee78e10f /vcl
parentfbee4f38664eada791789b36514932aa66e65571 (diff)
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@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105515 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/salvtables.cxx15
1 files changed, 9 insertions, 6 deletions
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)