From dd199ccb46c036713c704a23e137d04623936e47 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 17 Feb 2019 16:30:55 +0300 Subject: tdf#98896: GetWidth/GetHeight vs getWidth/getHeight strikes back! Regression from commit d04ee940a04922f6fc511882cff956a03b39583b Before commit 73f89b5d36dbae26072a1e749f10dfd6ffb6dd6e, the code to calculate full-screen rectangle only had one mode, and used Rectangle::Width+1/Rectangle::Height+1, with a comment "difference between java/awt convention and vcl". Commit 73f89b5d36dbae26072a1e749f10dfd6ffb6dd6e added another calc mode, and used Rectangle::GetWidth()/Rectangle::GetHeight(), which compensate for the +1 themselves. Then, in commit 6b5059c7b7129c3b9f00d784b6fa5248a24a6d4b, the original mode was changed to Rectangle::GetWidth()+1/Rectangle::GetHeight()+1, which was incorrect (resulting in an extra +1 for that code path). And last, in commit d04ee940a04922f6fc511882cff956a03b39583b, both the original mode, and the new mode were changed from GetWidth()/ GetHeight() to getWidth()/getHeight(), which fixed the original mode, but broke second mode (the +1 wasn't added there, so it got lost). This change stangardises both modes to use the GetWidth()/GetHeight() pair. Yay for more functions differing by case and meaning! Change-Id: Id64684d01a55849d18557d06c59e91b5cb93385d Reviewed-on: https://gerrit.libreoffice.org/67941 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Mike Kaganski --- vcl/win/window/salframe.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index c6d4d9057981..4fcb4947bc89 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -762,8 +762,8 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, tools::Rectangle aRect = Application::GetScreenPosSizePixel( pFrame->mnDisplay ); nScreenX = aRect.Left(); nScreenY = aRect.Top(); - nScreenDX = aRect.getWidth()+1; // difference between java/awt convention and vcl - nScreenDY = aRect.getHeight()+1; // difference between java/awt convention and vcl + nScreenDX = aRect.GetWidth(); + nScreenDY = aRect.GetHeight(); } else { @@ -774,8 +774,8 @@ static void ImplSalCalcFullScreenSize( const WinSalFrame* pFrame, } nScreenX = aCombined.Left(); nScreenY = aCombined.Top(); - nScreenDX = aCombined.getWidth(); - nScreenDY = aCombined.getHeight(); + nScreenDX = aCombined.GetWidth(); + nScreenDY = aCombined.GetHeight(); } } catch( Exception& ) -- cgit v1.2.3