diff options
author | Andrzej Hunt <andrzej@ahunt.org> | 2015-11-02 11:43:05 +0100 |
---|---|---|
committer | Andrzej Hunt <andrzej@ahunt.org> | 2015-11-03 10:43:17 +0100 |
commit | 24112a233626416e554f97420cb5f5c235b05b28 (patch) | |
tree | 1736242c77ff4a6148dbc7d09949ed30f6b92435 /sc | |
parent | Solved CID 1338058 and CID 1338057 (diff) | |
download | core-24112a233626416e554f97420cb5f5c235b05b28.tar.gz core-24112a233626416e554f97420cb5f5c235b05b28.zip |
sc lok: Cell Cursor callback
This only works correctly for the default zoom level - since
the updateLibreOfficeKitCellCursor call happens during the
internal / hidden rendering, it uses the internal zoom values,
which can differ from the tiled-rendering zoom values.
Change-Id: Ie4f344fe771078fca10ad9d6f7a93e88fb93880a
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 0c37ab92fe60..59bf9e00b09c 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5775,12 +5775,38 @@ bool ScGridWindow::InsideVisibleRange( SCCOL nPosX, SCROW nPosY ) return maVisibleRange.isInside(nPosX, nPosY); } +static void updateLibreOfficeKitCellCursor(ScViewData* pViewData, ScSplitPos eWhich) { + ScDocument* pDoc = pViewData->GetDocument(); + ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); + + if (!pDrawLayer->isTiledRendering()) + return; + + SCCOL nX = pViewData->GetCurX(); + SCROW nY = pViewData->GetCurY(); + Point aScrPos = pViewData->GetScrPos( nX, nY, eWhich, true ); + + long nSizeXPix; + long nSizeYPix; + pViewData->GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix ); + + double fPPTX = pViewData->GetPPTX(); + double fPPTY = pViewData->GetPPTY(); + Rectangle aRect(Point(aScrPos.getX() / fPPTX, aScrPos.getY() / fPPTY), + Size(nSizeXPix / fPPTX, nSizeYPix / fPPTY)); + + pDrawLayer->libreOfficeKitCallback(LOK_CALLBACK_CELL_CURSOR, aRect.toString().getStr()); + +} + void ScGridWindow::CursorChanged() { // here the created OverlayObjects may be transformed in later versions. For // now, just re-create them UpdateCursorOverlay(); + + updateLibreOfficeKitCellCursor(pViewData, eWhich); } void ScGridWindow::ImpCreateOverlayObjects() @@ -5932,9 +5958,8 @@ void ScGridWindow::UpdateCursorOverlay() { ScDocument* pDoc = pViewData->GetDocument(); - // never show the cell cursor when the tiled rendering is going on; either - // we want to show the editeng selection, or the cell selection, but not - // the cell cursor by itself + // The cursor is rendered client-side in tiled rendering - + // see updateLibreOfficeKitCellCursor. if (pDoc->GetDrawLayer()->isTiledRendering()) return; |