Kaydet (Commit) f003eba0 authored tarafından Pranav Kant's avatar Pranav Kant Kaydeden (comit) Jan Holesovsky

lokdialog: Let all modal dialogs notify about creation, disposal

Change-Id: I8ec0ad81abcf1adf628906b02f7f94ab74a550b5
üst 533e23cb
......@@ -71,6 +71,8 @@ protected:
public:
virtual ~SfxModalDialog() override;
virtual void dispose() override;
virtual short Execute() override;
const SfxItemSet* GetOutputItemSet() const { return pOutputSet; }
const SfxItemSet* GetInputItemSet() const { return pInputSet; }
};
......
......@@ -166,9 +166,33 @@ void SfxModalDialog::dispose()
{
SetDialogData_Impl();
delete pOutputSet;
SfxViewShell* pViewShell = SfxViewShell::Current();
if (comphelper::LibreOfficeKit::isActive() && pViewShell)
{
pViewShell->notifyDialog(maID, "close");
pViewShell->UnregisterDlg(maID);
}
ModalDialog::dispose();
}
short SfxModalDialog::Execute()
{
SfxViewShell* pViewShell = SfxViewShell::Current();
if (comphelper::LibreOfficeKit::isActive() && pViewShell)
{
pViewShell->RegisterDlg(maID, this);
registerDialogNotifier(static_cast<vcl::IDialogNotifier*>(pViewShell));
const Size aSize = GetOptimalSize();
std::vector<vcl::LOKPayloadItem> aItems;
aItems.emplace_back(std::make_pair("size", aSize.toString()));
pViewShell->notifyDialog(maID, "created", aItems);
}
return ModalDialog::Execute();
}
void SfxModalDialog::CreateOutputItemSet( SfxItemPool& rPool )
{
DBG_ASSERT( !pOutputSet, "Double creation of OutputSet!" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment