summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej@ahunt.org>2015-11-02 11:43:05 +0100
committerAndrzej Hunt <andrzej@ahunt.org>2015-11-06 08:02:44 +0100
commit53eca4823a300f4845227500ec19a824db073f93 (patch)
treec68f625e2d60bcadabba40a24d8bf4b3edb34776 /sc
parentcdebfc0f5a230668d9630492118c06ceda339543 (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 (cherry picked from commit 799406068d34bb69a077fcc0548bfed002f05641) Conflicts: libreofficekit/source/gtk/lokdocview.cxx sc/source/ui/view/gridwin.cxx Change-Id: Ie4f344fe771078fca10ad9d6f7a93e88fb93880a
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/gridwin.cxx31
1 files changed, 28 insertions, 3 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index f24b42f3b27e..89de17294d37 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5782,6 +5782,30 @@ 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());
+
+}
+
// #114409#
void ScGridWindow::CursorChanged()
{
@@ -5789,6 +5813,8 @@ void ScGridWindow::CursorChanged()
// now, just re-create them
UpdateCursorOverlay();
+
+ updateLibreOfficeKitCellCursor(pViewData, eWhich);
}
// #114409#
@@ -5942,9 +5968,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;