[Libreoffice-commits] core.git: sd/source

Pranav Kant pranavk at collabora.co.uk
Mon Mar 19 07:17:52 UTC 2018


 sd/source/ui/view/sdwindow.cxx |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit be8883bcb250bdbfbb77a76b244d97a30a97d77a
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Mon Mar 19 11:50:26 2018 +0530

    sd: fix incorrect visible center calculation
    
    Don't call PixelToLogic twice. Thanks Ashod for noticing.
    
    Change-Id: Id280dad7e310ceaf8678f900e6e70214848dd925
    Reviewed-on: https://gerrit.libreoffice.org/51529
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: pranavk <pranavk at collabora.co.uk>

diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 2d17fbe5ec3b..aa7cdc59de09 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -685,14 +685,8 @@ double Window::GetVisibleHeight()
 
 Point Window::GetVisibleCenter()
 {
-    Size aWinSize = PixelToLogic(GetOutputSizePixel());
-    if ( aWinSize.Height() > maViewSize.Height() )
-        aWinSize.setHeight( maViewSize.Height() );
-    if ( aWinSize.Width() > maViewSize.Width() )
-        aWinSize.setWidth( maViewSize.Width() );
-
     Point aPos;
-    aPos = ::tools::Rectangle(aPos, aWinSize).Center();
+    aPos = ::tools::Rectangle(aPos, GetOutputSizePixel()).Center();
 
     // For LOK
     bool bMapModeWasEnabled(IsMapModeEnabled());


More information about the Libreoffice-commits mailing list