summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2018-10-27 17:25:06 +0000
committerJan Holesovsky <kendy@collabora.com>2018-11-09 07:01:41 +0100
commite3ff84aed5be8e0d2780d80b178fa8fc0e388859 (patch)
treea2220c57ac376df6991804f436cd6d62285452f4
parent0b11ce9dd26c93d53f19dab23ef48a8587e72fc3 (diff)
lok: sc: make hi-dpi/zoom compatible with retrieving cell cursor
A bit different approach than trying to handle different zoom levels at the samet time: instead, always handle the spreadsheet at 100%, but use cairo to scale to the actual zoom level. Change-Id: I318aec8fa4baaab2ee1f271223b2e10e26d41fcf Reviewed-on: https://gerrit.libreoffice.org/63040 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx7
2 files changed, 6 insertions, 3 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 728af9163222..855bb398a570 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -784,7 +784,7 @@ void DesktopLOKTest::testCellCursor()
OString aRectangle(aTree.get<std::string>("commandValues").c_str());
// cell cursor geometry + col + row
- CPPUNIT_ASSERT_EQUAL(OString("0, 0, 1279, 255, 0, 0"), aRectangle);
+ CPPUNIT_ASSERT_EQUAL(OString("0, 0, 1274, 254, 0, 0"), aRectangle);
comphelper::LibreOfficeKit::setActive(false);
}
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index ba4d08dc874a..914640ce392e 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5658,7 +5658,7 @@ OString ScGridWindow::getCellCursor( int nOutputWidth, int nOutputHeight,
return getCellCursor(zoomX, zoomY);
}
-OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoomY) const
+OString ScGridWindow::getCellCursor(const Fraction& /*rZoomX*/, const Fraction& /*rZoomY*/) const
{
// GridWindow stores a shown cell cursor in mpOOCursors, hence
// we can use that to determine whether we would want to be showing
@@ -5674,7 +5674,10 @@ OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoo
Fraction defaultZoomX = pViewData->GetZoomX();
Fraction defaultZoomY = pViewData->GetZoomY();
- pViewData->SetZoom(rZoomX, rZoomY, true);
+ // hardcode to what we mean as 100% (256px tiles meaning 3840 twips)
+ Fraction aFracX(long(256 * TWIPS_PER_PIXEL), 3840);
+ Fraction aFracY(long(256 * TWIPS_PER_PIXEL), 3840);
+ pViewData->SetZoom(aFracX, aFracY, true);
Point aScrPos = pViewData->GetScrPos( nX, nY, eWhich, true );
long nSizeXPix;