[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source

Dennis Francis (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 28 12:11:37 UTC 2020


 sc/source/ui/view/gridwin.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit a68bfe87f6c720dd2b4721edf869c6801fa2d967
Author:     Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Sun Apr 26 04:56:11 2020 +0530
Commit:     Dennis Francis <dennis.francis at collabora.com>
CommitDate: Tue Apr 28 14:11:04 2020 +0200

    lokit: fix validation dropdown's wrong position
    
    Reverse the zoom scale on the position of the dropdown before
    letting the vcl::FloatingWindow convert this to twips without
    any scale information. Without this reverse scaling, the
    dropdown will be incorrect due to double application of the same zoom
    (one in core and one in client).
    
    Change-Id: I73de12593b13e1bc9fb0514bec23c20d440d8923
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92913
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Dennis Francis <dennis.francis at collabora.com>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index a3e3cc793118..495c74db0522 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1061,6 +1061,22 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
     long nHeight = 0;
     pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
     Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich );
+
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        // aPos is now view-zoom adjusted and in pixels an more importantly this is pixel aligned to the view-zoom,
+        // but once we use this to set the position of the floating window, it has no information of view-zoom level
+        // so if we don't reverse the zoom now, a simple PixelToLogic(aPos, MapMode(MapUnit::MapTwip)) employed in
+        // FloatingWindow::ImplCalcPos will produce a 'scaled' twips position which will again get zoom scaled in the
+        // client (effective double scaling) causing wrong positioning/size.
+        double fZoomX(pViewData->GetZoomX());
+        double fZoomY(pViewData->GetZoomY());
+        aPos.setX(aPos.getX() / fZoomX);
+        aPos.setY(aPos.getY() / fZoomY);
+        nSizeX = nSizeX / fZoomX;
+        nSizeY = nSizeY / fZoomY;
+    }
+
     if ( bLayoutRTL )
         aPos.AdjustX( -nSizeX );
 


More information about the Libreoffice-commits mailing list