[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/source

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Wed May 20 22:48:41 UTC 2020


 vcl/source/window/dialog.cxx |   22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

New commits:
commit fbd274a72d995c41bca7c12a9719e6d4e4884324
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Dec 10 20:34:51 2019 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Thu May 21 00:48:11 2020 +0200

    lok: dialog: check if exists a LOK Window Notifier
    
    When the dialog is about to show, it requires to
    send to client side the "created" message. However,
    in the constructor has already assigned a notifier
    from the parent window.
    
    Change-Id: I1120ad1c1c70449048d6739b8564d1c1f6b1c7e3
    Reviewed-on: https://gerrit.libreoffice.org/84908
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90243
    Tested-by: Jenkins
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94506
    Tested-by: Henry Castro <hcastro at collabora.com>

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 4fd582d1eaf8..89f1580c34e8 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -740,17 +740,25 @@ void Dialog::StateChanged( StateChangedType nType )
         const bool bKitActive = comphelper::LibreOfficeKit::isActive();
         if (bKitActive)
         {
-            if (!GetLOKNotifier())
-                SetLOKNotifier(mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr));
+            std::vector<vcl::LOKPayloadItem> aItems;
+            aItems.emplace_back("type", "dialog");
+            aItems.emplace_back("size", GetSizePixel().toString());
+            if (!GetText().isEmpty())
+                aItems.emplace_back("title", GetText().toUtf8());
 
             if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
             {
-                std::vector<vcl::LOKPayloadItem> aItems;
-                aItems.emplace_back("type", "dialog");
-                aItems.emplace_back("size", GetSizePixel().toString());
-                if (!GetText().isEmpty())
-                    aItems.emplace_back("title", GetText().toUtf8());
                 pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
+                pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
+            }
+            else
+            {
+                vcl::ILibreOfficeKitNotifier* pViewShell = mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr);
+                if (pViewShell)
+                {
+                    SetLOKNotifier(pViewShell);
+                    pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems);
+                }
             }
         }
 


More information about the Libreoffice-commits mailing list