summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-11-24 01:49:21 +0530
committerJan Holesovsky <kendy@collabora.com>2017-11-28 17:57:30 +0100
commitc5b0fab2c2378bbdd924a2a2963b24cd015a72b9 (patch)
tree80c69e3630c96194bcd70d14ca6a791c6fbbd33f
parenta99ce78f4fdf4689c3e3f9ce9d7d0ffebf069c94 (diff)
lokdialog: Let modeless dialogs emit "created" callback too
Change-Id: Ie81f8bd19696e6f0abceb86369545766918ae46a
-rw-r--r--sfx2/source/dialog/basedlgs.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 280610988d8b..a80c43c906d0 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -227,6 +227,19 @@ void SfxModelessDialog::StateChanged( StateChangedType nStateChange )
}
}
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ if (comphelper::LibreOfficeKit::isActive() && pViewShell)
+ {
+ pViewShell->RegisterDlg(maID, this);
+ registerDialogNotifier(static_cast<vcl::IDialogNotifier*>(pViewShell));
+ // Below method doesn't really give the exact dimensions,
+ // Check GetSizePixel() ?
+ const Size aOptimalSize = GetOptimalSize();
+ std::vector<vcl::LOKPayloadItem> aItems;
+ aItems.emplace_back(std::make_pair("size", aOptimalSize.toString()));
+ pViewShell->notifyDialog(maID, "created", aItems);
+ }
+
pImpl->bConstructed = true;
}
@@ -356,6 +369,14 @@ void SfxModelessDialog::dispose()
if ( pImpl->pMgr->GetFrame().is() && pImpl->pMgr->GetFrame() == pBindings->GetActiveFrame() )
pBindings->SetActiveFrame( nullptr );
pImpl.reset();
+
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ if (comphelper::LibreOfficeKit::isActive() && pViewShell)
+ {
+ pViewShell->notifyDialog(maID, "close");
+ pViewShell->UnregisterDlg(maID);
+ }
+
ModelessDialog::dispose();
}