Blame SOURCES/0286-Revert-sc-lok-Cache-viewdata-zoom-and-reuse-for-curs.patch

f325b2
From cc6294f25ba79ab1ad55f5cae600666eb8700d7b Mon Sep 17 00:00:00 2001
f325b2
From: Andrzej Hunt <andrzej@ahunt.org>
f325b2
Date: Fri, 6 Nov 2015 17:36:18 +0100
f325b2
Subject: [PATCH 286/398] Revert "sc lok: Cache viewdata zoom and reuse for
f325b2
 cursor callback"
f325b2
f325b2
This reverts fab3c48a0cd5a0517025993502a04358308fe5ef for now.
f325b2
The correct solution is to have the client "hint" at the current
f325b2
resolution, which is still being developed
f325b2
(gerrit-id: I34b5afcdcc06a671a8ac92c03e87404e42adf4cd).
f325b2
For now the cursor will be wrongly positioned when moved as the result
f325b2
of a mouse click.
f325b2
f325b2
Reviewed-on: https://gerrit.libreoffice.org/19827
f325b2
Tested-by: Andrzej Hunt <andrzej@ahunt.org>
f325b2
Reviewed-by: Andrzej Hunt <andrzej@ahunt.org>
f325b2
(cherry picked from commit 064fb1f73abbc103226a8fce8a46b7e8b8347dac)
f325b2
f325b2
Change-Id: I68d56eac958e607e8e2e3ad16aff4e1a7dd0b6dd
f325b2
---
f325b2
 sc/source/ui/inc/gridwin.hxx   | 9 ---------
f325b2
 sc/source/ui/view/gridwin.cxx  | 4 +++-
f325b2
 sc/source/ui/view/gridwin4.cxx | 6 +++---
f325b2
 3 files changed, 6 insertions(+), 13 deletions(-)
f325b2
f325b2
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
f325b2
index 8081f107409c..dc1cec7fd8c7 100644
f325b2
--- a/sc/source/ui/inc/gridwin.hxx
f325b2
+++ b/sc/source/ui/inc/gridwin.hxx
f325b2
@@ -200,15 +200,6 @@ class ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSou
f325b2
     bool                    bAutoMarkVisible:1;
f325b2
     bool                    bListValButton:1;
f325b2
 
f325b2
-    // We cache the tiled rendering zoom level in order to be able to
f325b2
-    // calculate the correct cell cursor position (which is dependent
f325b2
-    // on the zoom level). The caching is necessary since
f325b2
-    // ScModelObj::postMouseEvent resets the zoom level to the default,
f325b2
-    // which means we have the default zoom level set during the
f325b2
-    // cell cursor position calculations in updateLibreOfficeKitCellCursor().
f325b2
-    Fraction                mTiledZoomX;
f325b2
-    Fraction                mTiledZoomY;
f325b2
-
f325b2
     DECL_LINK( PopupModeEndHdl, void* );
f325b2
     DECL_LINK( PopupSpellingHdl, SpellCallbackInfo* );
f325b2
 
f325b2
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
f325b2
index efa8d332ad2a..d6887b6f4e07 100644
f325b2
--- a/sc/source/ui/view/gridwin.cxx
f325b2
+++ b/sc/source/ui/view/gridwin.cxx
f325b2
@@ -5834,7 +5834,9 @@ void ScGridWindow::updateLibreOfficeKitCellCursor()
f325b2
 {
f325b2
     ScDocument* pDoc = pViewData->GetDocument();
f325b2
     ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
f325b2
-    OString aCursor = getCellCursor(mTiledZoomX, mTiledZoomY);
f325b2
+    // TODO: the zoom levels here should be replaced by the setClientZoom values
f325b2
+    // in a patch currently in gerrit (https://gerrit.libreoffice.org/#/c/19822/)
f325b2
+    OString aCursor = getCellCursor(pViewData->GetZoomX(), pViewData->GetZoomY());
f325b2
     pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_CELL_CURSOR, aCursor.getStr());
f325b2
 }
f325b2
 
f325b2
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
f325b2
index cfdde43e1a04..ceaf3d8d7c3a 100644
f325b2
--- a/sc/source/ui/view/gridwin4.cxx
f325b2
+++ b/sc/source/ui/view/gridwin4.cxx
f325b2
@@ -955,11 +955,11 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
f325b2
     // Similarly to Writer, we should set the mapmode once on the rDevice, and
f325b2
     // not care about any zoom settings.
f325b2
 
f325b2
-    mTiledZoomX = Fraction(long(nOutputWidth * TWIPS_PER_PIXEL), nTileWidth);
f325b2
-    mTiledZoomY = Fraction(long(nOutputHeight * TWIPS_PER_PIXEL), nTileHeight);
f325b2
+    Fraction aFracX(long(nOutputWidth * TWIPS_PER_PIXEL), nTileWidth);
f325b2
+    Fraction aFracY(long(nOutputHeight * TWIPS_PER_PIXEL), nTileHeight);
f325b2
 
f325b2
     // page break zoom, and aLogicMode in ScViewData
f325b2
-    pViewData->SetZoom(mTiledZoomX, mTiledZoomY, true);
f325b2
+    pViewData->SetZoom(aFracX, aFracY, true);
f325b2
 
f325b2
     double fTilePosXPixel = static_cast<double>(nTilePosX) * nOutputWidth / nTileWidth;
f325b2
     double fTilePosYPixel = static_cast<double>(nTilePosY) * nOutputHeight / nTileHeight;
f325b2
-- 
f325b2
2.12.0
f325b2