summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-11-24 02:27:09 +0530
committerJan Holesovsky <kendy@collabora.com>2017-11-29 10:16:55 +0100
commitf2b6bffdedb12983d4ca2bab21fb68eeb3c3d08d (patch)
tree24a866473b09397e41949beebefc816ce4614b7f
parentb19f74aab0d1d2a8071952bc5a2e2f6cb341ee0c (diff)
lokdialog: Let all modal dialogs notify about creation, disposal
Change-Id: I8ec0ad81abcf1adf628906b02f7f94ab74a550b5
-rw-r--r--include/sfx2/basedlgs.hxx2
-rw-r--r--sfx2/source/dialog/basedlgs.cxx24
2 files changed, 26 insertions, 0 deletions
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index cb403c78a075..6fdb41784ade 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -71,6 +71,8 @@ protected:
public:
virtual ~SfxModalDialog() override;
virtual void dispose() override;
+
+ virtual short Execute() override;
const SfxItemSet* GetOutputItemSet() const { return pOutputSet; }
const SfxItemSet* GetInputItemSet() const { return pInputSet; }
};
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 7877e878e129..73a110038d95 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -160,9 +160,33 @@ void SfxModalDialog::dispose()
{
SetDialogData_Impl();
delete pOutputSet;
+
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ if (comphelper::LibreOfficeKit::isActive() && pViewShell)
+ {
+ pViewShell->notifyDialog(maID, "close");
+ pViewShell->UnregisterDlg(maID);
+ }
+
ModalDialog::dispose();
}
+short SfxModalDialog::Execute()
+{
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ if (comphelper::LibreOfficeKit::isActive() && pViewShell)
+ {
+ pViewShell->RegisterDlg(maID, this);
+ registerDialogNotifier(static_cast<vcl::IDialogNotifier*>(pViewShell));
+ const Size aSize = GetOptimalSize();
+ std::vector<vcl::LOKPayloadItem> aItems;
+ aItems.emplace_back(std::make_pair("size", aSize.toString()));
+ pViewShell->notifyDialog(maID, "created", aItems);
+ }
+
+ return ModalDialog::Execute();
+}
+
void SfxModalDialog::CreateOutputItemSet( SfxItemPool& rPool )
{
DBG_ASSERT( !pOutputSet, "Double creation of OutputSet!" );