summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-11-28 16:59:26 +0530
committerAndras Timar <andras.timar@collabora.com>2018-03-19 14:56:09 +0100
commit9db03f5fdc322dbffe8b2b22cd0244bf41d78d4a (patch)
tree1b1a74d5430b9888f669e09613110b8f3c3ac2c8
parentc5af1d2ec785387f1358f91ea62b27ae5db3c1d9 (diff)
lokdialog: Make hyperlink dialog work
Change-Id: Ifd8c721b001b09ddab8d4fe06ae6818980d6ee76 (cherry picked from commit 7bcb9a8416d61bdd3c7fc345f87de5aa8c3054f9)
-rw-r--r--cui/source/dialogs/iconcdlg.cxx2
-rw-r--r--include/sfx2/basedlgs.hxx1
-rw-r--r--sfx2/source/dialog/basedlgs.cxx22
3 files changed, 24 insertions, 1 deletions
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 41475c00233b..ce3d292b97b0 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -245,7 +245,7 @@ void IconChoiceDialog::dispose()
m_pHelpBtn.clear();
m_pResetBtn.clear();
m_pTabContainer.clear();
- ModalDialog::dispose();
+ SfxModalDialog::dispose();
}
/**********************************************************************
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 6fdb41784ade..db885c7173a2 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -75,6 +75,7 @@ public:
virtual short Execute() override;
const SfxItemSet* GetOutputItemSet() const { return pOutputSet; }
const SfxItemSet* GetInputItemSet() const { return pInputSet; }
+ void StateChanged( StateChangedType nStateChange ) override;
};
// class SfxModelessDialog --------------------------------------------------
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 1de5c4fb2f79..f44ed4c15446 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -206,6 +206,28 @@ void SfxModalDialog::CreateOutputItemSet( const SfxItemSet& rSet )
}
+void SfxModalDialog::StateChanged( StateChangedType nType )
+{
+ if (comphelper::LibreOfficeKit::isActive() && nType == StateChangedType::InitShow)
+ {
+ // There are some dialogs, like Hyperlink dialog, which inherit from
+ // SfxModalDialog even though they are modeless, i.e., their Execute method
+ // isn't called.
+ if (!GetLOKNotifier())
+ {
+ SetLOKNotifier(SfxViewShell::Current());
+ const Size aSize = GetOptimalSize();
+ std::vector<vcl::LOKPayloadItem> aItems;
+ aItems.emplace_back(std::make_pair("type", "dialog"));
+ aItems.emplace_back(std::make_pair("size", aSize.toString()));
+ SfxViewShell::Current()->notifyWindow(GetLOKWindowId(), "created", aItems);
+ }
+ }
+
+ ModalDialog::StateChanged(nType);
+}
+
+
void SfxModelessDialog::StateChanged( StateChangedType nStateChange )
{
if ( nStateChange == StateChangedType::InitShow )