summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/layout.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 517fa3317fea..06f387b2520f 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1704,8 +1704,11 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation)
// horz. ScrollBar
if (GetStyle() & WB_AUTOHSCROLL)
{
- m_aHScroll.Show(nAvailWidth < aChildReq.Width());
- nAvailHeight -= getLayoutRequisition(m_aHScroll).Height();
+ bool bShowHScroll = nAvailWidth < aChildReq.Width();
+ m_aHScroll.Show(bShowHScroll);
+
+ if (bShowHScroll)
+ nAvailHeight -= getLayoutRequisition(m_aHScroll).Height();
if (GetStyle() & WB_AUTOVSCROLL)
m_aVScroll.Show(nAvailHeight < aChildReq.Height());