summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej@ahunt.org>2015-11-06 17:36:18 +0100
committerAndrzej Hunt <andrzej@ahunt.org>2015-11-06 17:06:55 +0000
commit064fb1f73abbc103226a8fce8a46b7e8b8347dac (patch)
tree039c9377589328035cebfd8eea36ce04aa6efd90 /sc/source
parent77ff51623eab0c5908c84400c6eb8448ddb1e9c8 (diff)
Revert "sc lok: Cache viewdata zoom and reuse for cursor callback"
This reverts fab3c48a0cd5a0517025993502a04358308fe5ef for now. The correct solution is to have the client "hint" at the current resolution, which is still being developed (gerrit-id: I34b5afcdcc06a671a8ac92c03e87404e42adf4cd). For now the cursor will be wrongly positioned when moved as the result of a mouse click. Change-Id: I68d56eac958e607e8e2e3ad16aff4e1a7dd0b6dd Reviewed-on: https://gerrit.libreoffice.org/19827 Tested-by: Andrzej Hunt <andrzej@ahunt.org> Reviewed-by: Andrzej Hunt <andrzej@ahunt.org>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/inc/gridwin.hxx9
-rw-r--r--sc/source/ui/view/gridwin.cxx4
-rw-r--r--sc/source/ui/view/gridwin4.cxx6
3 files changed, 6 insertions, 13 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index f02d09a9804f..4f82167ff775 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -199,15 +199,6 @@ class ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSou
bool bAutoMarkVisible:1;
bool bListValButton:1;
- // We cache the tiled rendering zoom level in order to be able to
- // calculate the correct cell cursor position (which is dependent
- // on the zoom level). The caching is necessary since
- // ScModelObj::postMouseEvent resets the zoom level to the default,
- // which means we have the default zoom level set during the
- // cell cursor position calculations in updateLibreOfficeKitCellCursor().
- Fraction mTiledZoomX;
- Fraction mTiledZoomY;
-
DECL_LINK_TYPED( PopupModeEndHdl, FloatingWindow*, void );
DECL_LINK_TYPED( PopupSpellingHdl, SpellCallbackInfo&, void );
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 1636a34f6820..3ab0f7387f69 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5827,7 +5827,9 @@ void ScGridWindow::updateLibreOfficeKitCellCursor()
{
ScDocument* pDoc = pViewData->GetDocument();
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
- OString aCursor = getCellCursor(mTiledZoomX, mTiledZoomY);
+ // TODO: the zoom levels here should be replaced by the setClientZoom values
+ // in a patch currently in gerrit (https://gerrit.libreoffice.org/#/c/19822/)
+ OString aCursor = getCellCursor(pViewData->GetZoomX(), pViewData->GetZoomY());
pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_CELL_CURSOR, aCursor.getStr());
}
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index e0f0a5182344..51ae5fdc8397 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -953,11 +953,11 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
// Similarly to Writer, we should set the mapmode once on the rDevice, and
// not care about any zoom settings.
- mTiledZoomX = Fraction(long(nOutputWidth * TWIPS_PER_PIXEL), nTileWidth);
- mTiledZoomY = Fraction(long(nOutputHeight * TWIPS_PER_PIXEL), nTileHeight);
+ Fraction aFracX(long(nOutputWidth * TWIPS_PER_PIXEL), nTileWidth);
+ Fraction aFracY(long(nOutputHeight * TWIPS_PER_PIXEL), nTileHeight);
// page break zoom, and aLogicMode in ScViewData
- pViewData->SetZoom(mTiledZoomX, mTiledZoomY, true);
+ pViewData->SetZoom(aFracX, aFracY, true);
double fTilePosXPixel = static_cast<double>(nTilePosX) * nOutputWidth / nTileWidth;
double fTilePosYPixel = static_cast<double>(nTilePosY) * nOutputHeight / nTileHeight;