[Libreoffice-commits] core.git: sc/source
Dennis Francis (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 10 06:22:03 UTC 2020
sc/source/ui/view/gridwin.cxx | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
New commits:
commit 0310c591eb5f4010de8f6d12298491d9c13634a3
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: Wed Jun 10 08:21:25 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
Conflicts:
sc/source/ui/view/gridwin.cxx
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>
(cherry picked from commit 86019fc76473cde457ecf1634bcff9df60ad7cbf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95965
Tested-by: Jenkins
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index ce9df4fe4c33..85f2cd517085 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -628,6 +628,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
{
SCTAB nTab = pViewData->GetTabNo();
ScDocument* pDoc = pViewData->GetDocument();
+ bool bLOKActive = comphelper::LibreOfficeKit::isActive();
mpAutoFilterPopup.disposeAndClear();
int nColWidth = ScViewData::ToPixel(pDoc->GetColWidth(nCol, nTab), pViewData->GetPPTX());
@@ -638,7 +639,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
// If NWF renders the focus rects itself, that breaks double-buffering.
mpAutoFilterPopup->RequestDoubleBuffering(true);
- if (comphelper::LibreOfficeKit::isActive())
+ if (bLOKActive)
mpAutoFilterPopup->SetLOKNotifier(SfxViewShell::Current());
mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, AutoFilterMode::Normal));
mpAutoFilterPopup->setPopupEndAction(
@@ -650,6 +651,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