cui/source/dialogs/iconcdlg.cxx | 2 +- include/sfx2/basedlgs.hxx | 1 + sfx2/source/dialog/basedlgs.cxx | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-)
New commits: commit 7bcb9a8416d61bdd3c7fc345f87de5aa8c3054f9 Author: Pranav Kant <pran...@collabora.co.uk> Date: Tue Nov 28 16:59:26 2017 +0530 lokdialog: Make hyperlink dialog work Change-Id: Ifd8c721b001b09ddab8d4fe06ae6818980d6ee76 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 ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits