diff options
author | Andrzej Hunt <andrzej@ahunt.org> | 2015-11-02 11:43:05 +0100 |
---|---|---|
committer | Andrzej Hunt <andrzej@ahunt.org> | 2015-11-05 12:54:21 +0100 |
commit | 799406068d34bb69a077fcc0548bfed002f05641 (patch) | |
tree | 277e6aecdbf8d56aeff2846256043a61795b73fa /sc | |
parent | eda52500c72c56149c10f2ef73474b4ac1ae0552 (diff) |
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.
Conflicts:
include/LibreOfficeKit/LibreOfficeKitEnums.h
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; |