summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-11-24 10:03:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-11-24 16:47:15 +0100
commit72b8a3f93dfc77b336b15fe30b302edb849a2702 (patch)
treebddc1a463a24e74fa3c70786eeb379f90a53ddca /svtools
parentfbf92ea796a398f0fceb1613aad0a3d682dd2403 (diff)
tdf#138430 schedule a reformat if we turned off the scrollbar
Change-Id: Ida7d7419f0513624071b31820660add93ac78615 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106445 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/valueset.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index e81aeb2745bd..c9a94de237a1 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -549,14 +549,15 @@ void ValueSet::RemoveItem( sal_uInt16 nItemId )
QueueReformat();
}
-void ValueSet::TurnOffScrollBar()
+bool ValueSet::TurnOffScrollBar()
{
if (mxScrolledWindow->get_vpolicy() == VclPolicyType::NEVER)
- return;
+ return false;
mxScrolledWindow->set_vpolicy(VclPolicyType::NEVER);
weld::DrawingArea* pDrawingArea = GetDrawingArea();
Size aPrefSize(pDrawingArea->get_preferred_size());
pDrawingArea->set_size_request(aPrefSize.Width() + GetScrollWidth(), aPrefSize.Height());
+ return true;
}
void ValueSet::TurnOnScrollBar()
@@ -571,11 +572,16 @@ void ValueSet::TurnOnScrollBar()
void ValueSet::RecalcScrollBar()
{
- // reset scrolled window state to initial value
- // so it will get configured to the right adjustment
- WinBits nStyle = GetStyle();
- if (mxScrolledWindow && (nStyle & WB_VSCROLL))
- TurnOffScrollBar();
+ if (!mxScrolledWindow)
+ return;
+ const bool bScrollAllowed = GetStyle() & WB_VSCROLL;
+ if (!bScrollAllowed)
+ return;
+ // reset scrolled window state to initial value so it will get configured
+ // to the right adjustment on the next format which we toggle on to happen
+ // if the scrolledwindow wasn't in its initial state already
+ if (TurnOffScrollBar())
+ mbFormat = true;
}
void ValueSet::Clear()