summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Cecchetti <mrcekets@gmail.com>2018-10-27 17:25:06 +0000
committerJan Holesovsky <kendy@collabora.com>2018-11-07 16:31:59 +0100
commitbe67fab68eb974e78686f8f9a2583af27d1119d4 (patch)
tree683ea9af67388c7ffabebea4a45658c6ed3c562c
parent681f771daf74e3a788cd1be0f85636a57000c46c (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 (cherry picked from commit 201045f9c47d219a2aa3a6571a48a92e6ac6569e)
-rw-r--r--sc/source/ui/view/gridwin.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 400b2ee959a7..5bce39050830 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5631,7 +5631,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
@@ -5647,7 +5647,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;