summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/gridwin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/gridwin.cxx')
-rw-r--r--sc/source/ui/view/gridwin.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 205a9e6829e5..bbb18e0eb666 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5817,7 +5817,8 @@ OString ScGridWindow::getCellCursor( int nOutputWidth, int nOutputHeight,
return getCellCursor(zoomX, zoomY);
}
-OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoomY) {
+OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoomY) const
+{
// GridWindow stores a shown cell cursor in mpOOCursors, hence
// we can use that to determine whether we would want to be showing
// one (client-side) for tiled rendering too.
@@ -5849,12 +5850,22 @@ OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoo
return aRect.toString();
}
-void ScGridWindow::updateLibreOfficeKitCellCursor()
+void ScGridWindow::updateLibreOfficeKitCellCursor(SfxViewShell* pOtherShell) const
{
OString aCursor = getCellCursor(pViewData->GetZoomX(), pViewData->GetZoomY());
ScTabViewShell* pViewShell = pViewData->GetViewShell();
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_CURSOR, aCursor.getStr());
- SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", aCursor);
+ if (pOtherShell)
+ {
+ if (pOtherShell == pViewShell)
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_CURSOR, aCursor.getStr());
+ else
+ SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", aCursor);
+ }
+ else
+ {
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_CURSOR, aCursor.getStr());
+ SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", aCursor);
+ }
}
void ScGridWindow::CursorChanged()
@@ -6145,7 +6156,7 @@ void ScGridWindow::UpdateCursorOverlay()
if (comphelper::LibreOfficeKit::isActive())
{
mpOOCursors.reset(new sdr::overlay::OverlayObjectList);
- updateLibreOfficeKitCellCursor();
+ updateLibreOfficeKitCellCursor(nullptr);
}
else
{