summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-11-28 16:59:26 +0530
committerPranav Kant <pranavk@collabora.co.uk>2017-11-29 16:12:50 +0530
commit45d17c5a19b74d9942e3550f6bb8eb75815b7c04 (patch)
tree3e6607cfb11842d9c32ce9eae148989fc5e57c0e
parent3f4f6771e939fbe2fd12be6897ca0e27aaa4d55e (diff)
lokdialog: Make hyperlink dialog work
(cherry picked from commit 29f23a47f02b05ddd9a3a626a6cf8bfa7083d1bc) (cherry picked from commit 9ad0c1815e137c55f2d356c46630e67570262196) Change-Id: Ifd8c721b001b09ddab8d4fe06ae6818980d6ee76
-rw-r--r--cui/source/dialogs/iconcdlg.cxx2
-rw-r--r--include/sfx2/basedlgs.hxx1
-rw-r--r--sfx2/source/dialog/basedlgs.cxx21
3 files changed, 23 insertions, 1 deletions
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index ba096454466e..152d272c7b8a 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -256,7 +256,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 30ad2fb0a2d5..b16aec1bd83d 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 ce028f908472..97d3c1c8b45e 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -211,6 +211,27 @@ 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("size", aSize.toString()));
+ SfxViewShell::Current()->notifyWindow(GetLOKWindowId(), "created", aItems);
+ }
+ }
+
+ ModalDialog::StateChanged(nType);
+}
+
+
void SfxModelessDialog::StateChanged( StateChangedType nStateChange )
{
if ( nStateChange == StateChangedType::InitShow )