Kaydet (Commit) 064fb1f7 authored tarafından Andrzej Hunt's avatar Andrzej Hunt

Revert "sc lok: Cache viewdata zoom and reuse for cursor callback"

This reverts fab3c48a 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/19827Tested-by: 's avatarAndrzej Hunt <andrzej@ahunt.org>
Reviewed-by: 's avatarAndrzej Hunt <andrzej@ahunt.org>
üst 77ff5162
...@@ -199,15 +199,6 @@ class ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSou ...@@ -199,15 +199,6 @@ class ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSou
bool bAutoMarkVisible:1; bool bAutoMarkVisible:1;
bool bListValButton: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( PopupModeEndHdl, FloatingWindow*, void );
DECL_LINK_TYPED( PopupSpellingHdl, SpellCallbackInfo&, void ); DECL_LINK_TYPED( PopupSpellingHdl, SpellCallbackInfo&, void );
......
...@@ -5827,7 +5827,9 @@ void ScGridWindow::updateLibreOfficeKitCellCursor() ...@@ -5827,7 +5827,9 @@ void ScGridWindow::updateLibreOfficeKitCellCursor()
{ {
ScDocument* pDoc = pViewData->GetDocument(); ScDocument* pDoc = pViewData->GetDocument();
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); 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()); pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_CELL_CURSOR, aCursor.getStr());
} }
......
...@@ -953,11 +953,11 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, ...@@ -953,11 +953,11 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
// Similarly to Writer, we should set the mapmode once on the rDevice, and // Similarly to Writer, we should set the mapmode once on the rDevice, and
// not care about any zoom settings. // not care about any zoom settings.
mTiledZoomX = Fraction(long(nOutputWidth * TWIPS_PER_PIXEL), nTileWidth); Fraction aFracX(long(nOutputWidth * TWIPS_PER_PIXEL), nTileWidth);
mTiledZoomY = Fraction(long(nOutputHeight * TWIPS_PER_PIXEL), nTileHeight); Fraction aFracY(long(nOutputHeight * TWIPS_PER_PIXEL), nTileHeight);
// page break zoom, and aLogicMode in ScViewData // 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 fTilePosXPixel = static_cast<double>(nTilePosX) * nOutputWidth / nTileWidth;
double fTilePosYPixel = static_cast<double>(nTilePosY) * nOutputHeight / nTileHeight; double fTilePosYPixel = static_cast<double>(nTilePosY) * nOutputHeight / nTileHeight;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment