[Libreoffice-commits] core.git: vcl/jsdialog

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Sun Jan 10 18:19:50 UTC 2021


 vcl/jsdialog/jsdialogbuilder.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit f55266b456b1534bdbc9c3ce6d04d2b65f152a6e
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Dec 29 09:36:50 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Sun Jan 10 19:19:16 2021 +0100

    jsdialog: updates in similar fashion like other messages
    
    to unify all jsdialog interactions
    
    Change-Id: I22e14282f5a2c52ef44e68cb39338600004c4e24
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108435
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 3352bac904d1..f33d0be85fd5 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -102,6 +102,7 @@ void JSDialogNotifyIdle::updateStatus(VclPtr<vcl::Window> pWindow)
     if (!m_aNotifierWindow)
         return;
 
+    // will be deprecated soon
     if (m_aNotifierWindow->IsReallyVisible())
     {
         if (const vcl::ILibreOfficeKitNotifier* pNotifier = m_aNotifierWindow->GetLOKNotifier())
@@ -124,6 +125,21 @@ void JSDialogNotifyIdle::updateStatus(VclPtr<vcl::Window> pWindow)
                                                   aJsonWriter.extractData());
         }
     }
+
+    // new approach - update also if hidden
+    if (const vcl::ILibreOfficeKitNotifier* pNotifier = m_aNotifierWindow->GetLOKNotifier())
+    {
+        tools::JsonWriter aJsonWriter;
+
+        aJsonWriter.put("jsontype", m_sTypeOfJSON);
+        aJsonWriter.put("action", "update");
+        aJsonWriter.put("id", m_aNotifierWindow->GetLOKWindowId());
+        {
+            auto aEntries = aJsonWriter.startNode("control");
+            pWindow->DumpAsPropertyTree(aJsonWriter);
+        }
+        pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, aJsonWriter.extractData());
+    }
 }
 
 std::unique_ptr<tools::JsonWriter> JSDialogNotifyIdle::generateCloseMessage() const


More information about the Libreoffice-commits mailing list