sc/source/ui/view/gridwin.cxx |   35 ++++++++++++++++++++++++++++++++---
 1 file changed, 32 insertions(+), 3 deletions(-)

New commits:
commit fdf39bcc9bc1eb1a867e9d1536e8daa437cf0553
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Sun May 24 22:40:51 2020 +0530
Commit:     Dennis Francis <dennis.fran...@collabora.com>
CommitDate: Sun Jul 5 09:41:14 2020 +0200

    lokit: scPrintTwipsMsgs: LOK_CALLBACK_CELL_VIEW_CURSOR
    
    Allow print twips coordinates in LOK_CALLBACK_CELL_VIEW_CURSOR
    
    Change-Id: I0373cbd2b87b4d1088af41453ab548274de6ca23
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97965
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>
    (cherry picked from commit 14b8f2009f3c5a3d189eba4b82786274ad30d544)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97976
    Tested-by: Jenkins

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index b6b3e634c902..2742965c1b31 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5756,8 +5756,13 @@ void ScGridWindow::notifyKitCellViewCursor(const 
SfxViewShell* pForShell) const
         auto pForTabView = dynamic_cast<const ScTabViewShell *>(pForShell);
         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);
 }
@@ -5767,9 +5772,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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to