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

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Sat Jun 22 14:36:04 UTC 2019


 vcl/source/window/window.cxx |   16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

New commits:
commit a2dad3e10ada8adcc9b5bdb60d3d516e33aa3f07
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sat Jun 22 02:00:50 2019 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Sat Jun 22 16:35:20 2019 +0200

    VCL don't mirror Y position
    
    I don't know why Y values should be affected by mirroring at all. This
    produced a lot of negative Y values for me.
    
    Change-Id: I2b147ede948510a7bc1a5838cf89a8fd02e2ed46
    Reviewed-on: https://gerrit.libreoffice.org/74547
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 5a0b505e2aef..c9c4a93da413 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2744,22 +2744,18 @@ void Window::setPosSizePixel( long nX, long nY,
                 OutputDevice *pParentOutDev = pWinParent->GetOutDev();
                 if( pParentOutDev->HasMirroredGraphics() )
                 {
+                    const SalFrameGeometry& aSysGeometry = mpWindowImpl->mpFrame->GetUnmirroredGeometry();
+                    const SalFrameGeometry& aParentSysGeometry =
+                        pWinParent->mpWindowImpl->mpFrame->GetUnmirroredGeometry();
                     long myWidth = nOldWidth;
                     if( !myWidth )
-                        myWidth = mpWindowImpl->mpFrame->GetUnmirroredGeometry().nWidth;
+                        myWidth = aSysGeometry.nWidth;
                     if( !myWidth )
                         myWidth = nWidth;
                     nFlags |= PosSizeFlags::X;
                     nSysFlags |= SAL_FRAME_POSSIZE_X;
-                    nX = pWinParent->mpWindowImpl->mpFrame->GetUnmirroredGeometry().nX - mpWindowImpl->mpFrame->GetUnmirroredGeometry().nLeftDecoration +
-                        pWinParent->mpWindowImpl->mpFrame->GetUnmirroredGeometry().nWidth - myWidth - 1 - mpWindowImpl->mpFrame->GetUnmirroredGeometry().nX;
-                    if(!(nFlags & PosSizeFlags::Y))
-                    {
-                        nFlags |= PosSizeFlags::Y;
-                        nSysFlags |= SAL_FRAME_POSSIZE_Y;
-                        nY = mpWindowImpl->mpFrame->GetUnmirroredGeometry().nY - pWinParent->mpWindowImpl->mpFrame->GetUnmirroredGeometry().nY -
-                            mpWindowImpl->mpFrame->GetUnmirroredGeometry().nTopDecoration;
-                    }
+                    nX = aParentSysGeometry.nX - aSysGeometry.nLeftDecoration + aParentSysGeometry.nWidth
+                        - myWidth - 1 - aSysGeometry.nX;
                 }
             }
         }


More information about the Libreoffice-commits mailing list