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

Dennis Francis (via logerrit) logerrit at kemper.freedesktop.org
Fri May 1 04:44:55 UTC 2020


 sc/source/ui/view/gridwin.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 86019fc76473cde457ecf1634bcff9df60ad7cbf
Author:     Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Fri May 1 05:39:53 2020 +0530
Commit:     Dennis Francis <dennis.francis at collabora.com>
CommitDate: Fri May 1 06:44:23 2020 +0200

    lokit: fix autofilter window position...
    
    when client zoom is not 100%. The fix and the reasoning
    is same as that in
    
    lokit: fix validation dropdown's wrong position
    3405f7f1b19738cad57b58259105ec87c1108466
    
    Change-Id: I04837721d82b1e178cf5aa1130bbdaf77d13edae
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93240
    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 97a73632ee22..c0fd0034c55c 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -641,10 +641,11 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
 {
     SCTAB nTab = pViewData->GetTabNo();
     ScDocument* pDoc = pViewData->GetDocument();
+    bool bLOKActive = comphelper::LibreOfficeKit::isActive();
 
     mpAutoFilterPopup.disposeAndClear();
     mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pDoc));
-    if (comphelper::LibreOfficeKit::isActive())
+    if (bLOKActive)
         mpAutoFilterPopup->SetLOKNotifier(SfxViewShell::Current());
     mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, AutoFilterMode::Normal));
     mpAutoFilterPopup->setPopupEndAction(
@@ -656,6 +657,18 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
     long nSizeX  = 0;
     long nSizeY  = 0;
     pViewData->GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY);
+    if (bLOKActive)
+    {
+        // Reverse the zoom factor from aPos and nSize[X|Y]
+        // before letting the autofilter window convert the to twips
+        // with no zoom information.
+        double fZoomX(pViewData->GetZoomX());
+        double fZoomY(pViewData->GetZoomY());
+        aPos.setX(aPos.getX() / fZoomX);
+        aPos.setY(aPos.getY() / fZoomY);
+        nSizeX = nSizeX / fZoomX;
+        nSizeY = nSizeY / fZoomY;
+    }
     tools::Rectangle aCellRect(OutputToScreenPixel(aPos), Size(nSizeX, nSizeY));
 
     ScDBData* pDBData = pDoc->GetDBAtCursor(nCol, nRow, nTab, ScDBDataPortion::AREA);


More information about the Libreoffice-commits mailing list