diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2020-05-24 22:40:51 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2020-05-25 00:40:01 +0530 |
commit | e7546301e8569847b9236bd859792079e97e0c50 (patch) | |
tree | 55ede613f7ecf642ea821e52a0ccde66c9db0426 /sc/source/ui/view | |
parent | 07cb2b5b8ab7624868e19e0aa687d36195400fd7 (diff) |
lokit: scPrintTwipsMsgs: LOK_CALLBACK_CELL_VIEW_CURSOR
Allow print twips coordinates in LOK_CALLBACK_CELL_VIEW_CURSOR
Change-Id: I0373cbd2b87b4d1088af41453ab548274de6ca23
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index b1da568c3128..405dd5e7de1a 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5754,8 +5754,13 @@ void ScGridWindow::notifyKitCellViewCursor(const SfxViewShell* pForShell) const assert(pForTabView); if (!pForTabView) return; - aCursor = pForTabView->GetViewData().describeCellCursorAt( - pViewData->GetCurX(), pViewData->GetCurY()); // our position. + + if (comphelper::LibreOfficeKit::isCompatFlagSet( + comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs)) + aCursor = pViewData->describeCellCursorInPrintTwips(); + else + aCursor = pForTabView->GetViewData().describeCellCursorAt( + pViewData->GetCurX(), pViewData->GetCurY()); // our position. } SfxLokHelper::notifyOtherView(pViewShell, pForShell, LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", aCursor); } @@ -5765,9 +5770,33 @@ void ScGridWindow::notifyKitCellViewCursor(const SfxViewShell* pForShell) const // event, and others a cell_view_cursor event. // // NB. we need to re-construct the cursor details for each other view in their -// own zoomed co-ordinate system. +// own zoomed co-ordinate system (but not in scPrintTwipsMsgs mode). void ScGridWindow::updateKitCellCursor(const SfxViewShell* pForShell) const { + if (comphelper::LibreOfficeKit::isCompatFlagSet( + comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs)) + { + ScTabViewShell* pViewShell = pViewData->GetViewShell(); + // Generate the cursor info string just once and directly send to all. + // Calling notifyKitCellViewCursor() would regenerate the + // cursor-string unnecessarily. + OString aCursor = getCellCursor(); + + if (pForShell) + { + SfxLokHelper::notifyOtherView(pViewShell, pForShell, + LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", aCursor); + } + else + { + notifyKitCellCursor(); + SfxLokHelper::notifyOtherViews(pViewShell, + LOK_CALLBACK_CELL_VIEW_CURSOR, "rectangle", aCursor); + } + + return; + } + if (!pForShell) { for (SfxViewShell* it = SfxViewShell::GetFirst(); it; |