diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
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 ) |