summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2019-12-10 20:34:51 -0400
committerHenry Castro <hcastro@collabora.com>2020-03-10 02:23:29 +0100
commitb546a7a461fd09d93e9b427b771353be9066720f (patch)
tree56820b13be181903f6c7f0a21e66f73b1eeddcb9 /vcl
parentb39c08773db9bea776001c6ccf043684c2dfe08d (diff)
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@gmail.com> Reviewed-by: Henry Castro <hcastro@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90243 Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/dialog.cxx22
1 files changed, 15 insertions, 7 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 35a4c8cafa47..ecc760625486 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -741,17 +741,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);
+ }
}
}