diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-11-23 16:40:23 +0000 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2020-11-25 14:14:56 +0100 |
commit | 5d5f10b3fa7c59c25f1b85d909db6909548ee111 (patch) | |
tree | 37b558346cfdee0d464648ceba7b2f37d194d27c /svtools | |
parent | ec5adc39cbea6d754ef68ab3d03fb16066b27e40 (diff) |
tdf#138430 toolbar bullet dropdown should have a scrolledwindow
as should the matching dialog pages
Change-Id: Ib327d3c02d1bc5ae11a6a76d52c9e17803f05534
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106436
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/valueset.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 4070630fe44a..8e679562ad48 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -539,14 +539,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() @@ -561,11 +562,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() |