Kaydet (Commit) 53eca482 authored tarafından Andrzej Hunt's avatar Andrzej Hunt

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 79940606)

Conflicts:
	libreofficekit/source/gtk/lokdocview.cxx
	sc/source/ui/view/gridwin.cxx

Change-Id: Ie4f344fe771078fca10ad9d6f7a93e88fb93880a
üst cdebfc0f
......@@ -195,7 +195,14 @@ typedef enum
* // TODO "result": "..." // UNO Any converted to JSON (not implemented yet)
* }
*/
LOK_CALLBACK_UNO_COMMAND_RESULT
LOK_CALLBACK_UNO_COMMAND_RESULT,
/**
* The size and/or the position of the cell cursor changed.
*
* Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
*/
LOK_CALLBACK_CELL_CURSOR
}
LibreOfficeKitCallbackType;
......
......@@ -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;
......
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