From b197a47889a81b0181553a2a9c4db9683dd5d760 Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Tue, 11 Oct 2016 00:04:12 +0300 Subject: Height and Width seem to be swapped here when height takes left-right borders, and width top-bottom. And also - Why do we calculate the borders twice - as the call to CalcWindowSize does this again? Change-Id: I63a66939bd526a225ccac9bdd6262feba48da5c2 --- vcl/source/window/dockwin.cxx | 6 ++---- vcl/source/window/syswin.cxx | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'vcl') diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 8dff109b6b50..9a523c7a1311 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -1072,10 +1072,8 @@ Size DockingWindow::GetOptimalSize() const sal_Int32 nBorderWidth = get_border_width(); - aSize.Height() += mpWindowImpl->mnLeftBorder + mpWindowImpl->mnRightBorder - + 2*nBorderWidth; - aSize.Width() += mpWindowImpl->mnTopBorder + mpWindowImpl->mnBottomBorder - + 2*nBorderWidth; + aSize.Height() += 2 * nBorderWidth; + aSize.Width() += 2 * nBorderWidth; return Window::CalcWindowSize(aSize); } diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index f844eef16d1a..5e1a372aa568 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -1091,10 +1091,8 @@ Size SystemWindow::GetOptimalSize() const sal_Int32 nBorderWidth = get_border_width(); - aSize.Height() += mpWindowImpl->mnLeftBorder + mpWindowImpl->mnRightBorder - + 2*nBorderWidth; - aSize.Width() += mpWindowImpl->mnTopBorder + mpWindowImpl->mnBottomBorder - + 2*nBorderWidth; + aSize.Height() += 2 * nBorderWidth; + aSize.Width() += 2 * nBorderWidth; return Window::CalcWindowSize(aSize); } -- cgit