sc/source/ui/app/inputhdl.cxx      |    9 ++++++++-
 sw/source/uibase/docvw/edtwin2.cxx |    1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit d6b18dc269625dede7c739770984cbe78c41d9a2
Author:     Gülşah Köse <[email protected]>
AuthorDate: Wed Feb 28 15:05:06 2024 +0300
Commit:     Gülşah Köse <[email protected]>
CommitDate: Thu Feb 29 19:53:25 2024 +0100

    Online: Make tooltip message specific to function usage tooltip
    
    Using same callback caused a regression about showing tooltip while
    reviewing a change in writer. So we need a type to understand which
    tooltip comes.
    
    Signed-off-by: Gülşah Köse <[email protected]>
    Change-Id: Iae26ff48f9c5c711af071fd66b5314e7bc96ff8b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164093
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164150
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 47416cf3c361..48b0fa6b6296 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -58,6 +58,7 @@
 #include <vcl/settings.hxx>
 #include <vcl/svapp.hxx>
 #include <tools/urlobj.hxx>
+#include <tools/json_writer.hxx>
 #include <formula/formulahelper.hxx>
 #include <formula/funcvarargs.h>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
@@ -1298,7 +1299,13 @@ void ScInputHandler::ShowArgumentsTip( OUString& 
rSelText )
 
                         const SfxViewShell* pViewShell = 
SfxViewShell::Current();
                         if (comphelper::LibreOfficeKit::isActive() && 
pViewShell->isLOKDesktop())
-                            
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, 
aNew.toUtf8().getStr());
+                        {
+                            tools::JsonWriter writer;
+                            writer.put("type", "formulausage");
+                            writer.put("text", aNew);
+                            OString sFunctionUsageTip = 
writer.extractAsOString();
+                            
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, 
sFunctionUsageTip.getStr());
+                        }
                     }
                 }
             }
diff --git a/sw/source/uibase/docvw/edtwin2.cxx 
b/sw/source/uibase/docvw/edtwin2.cxx
index ec3b76324e79..f985e0483911 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -114,6 +114,7 @@ static OString getTooltipPayload(const OUString& tooltip, 
const SwRect& rect)
 {
     tools::JsonWriter writer;
     {
+        writer.put("type", "generaltooltip");
         writer.put("text", tooltip);
         writer.put("rectangle", rect.SVRect().toString());
     }

Reply via email to