summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-04-29 16:58:03 +0200
committerAndras Timar <andras.timar@collabora.com>2019-09-18 16:11:40 +0200
commit89f8b55eb469fc35afeabd1b1193582cc3e9b71a (patch)
tree180fedb96c73bcf9657455a52b78221fe1ec6f7f
parent34790afec30024569a66108fa4d875ab054ab938 (diff)
libreofficekit: send show/hide messages for dialogs
Change-Id: I2b3ff5e5122b2be099be500ac544bf81f8d1b2ae Reviewed-on: https://gerrit.libreoffice.org/71544 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit e575a5e8f89beb3ce1df5a1d83edc0f9d1d8ac43) Reviewed-on: https://gerrit.libreoffice.org/79091 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitEnums.h2
-rw-r--r--vcl/source/window/dialog.cxx10
2 files changed, 12 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 5a7782566a06..c34ed86e8f59 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -616,6 +616,8 @@ typedef enum
* - "cursor_visible" - cursor visible status is changed. Status is available
* in "visible" field
* - "close" - window is closed
+ * - "show" - show the window
+ * - "hide" - hide the window
*/
LOK_CALLBACK_WINDOW = 36,
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 314d135d973b..a90d0c022513 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -779,6 +779,16 @@ void Dialog::StateChanged( StateChangedType nType )
ImplInitSettings();
Invalidate();
}
+
+ if (!mbModalMode && nType == StateChangedType::Visible)
+ {
+ if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+ {
+ std::vector<vcl::LOKPayloadItem> aPayload;
+ aPayload.emplace_back("title", GetText().toUtf8());
+ pNotifier->notifyWindow(GetLOKWindowId(), IsVisible()? OUString("show"): OUString("hide"), aPayload);
+ }
+ }
}
void Dialog::DataChanged( const DataChangedEvent& rDCEvt )