diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-12-01 13:54:45 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-19 14:56:01 +0100 |
commit | f96c9e1a2cecff3fcda32989487fc2c91f90daa1 (patch) | |
tree | c01bb1c3f9e46be87798d19dda697511940fdacc /sfx2/source/dialog | |
parent | 18dffe2e1952264c78ef35c71731d41a99de5ccd (diff) |
lokdialog: Simplify; make the LOK dialog API more generic
Merge the dialog floating window callbacks and function calls into one.
Unique window ids across vcl::Window is enough to distinguish between
them.
Floating windows don't have a LOK notifier as they are created in the
vcl itself (so we can't access them from sfx2). Use the parent LOK
notifier in that case (which would be a dialog).
This API should also help in autopopup filter tunneling later.
(cherry picked from commit b5e27fd809845577a90cc1811de062c070110078)
Change-Id: I63a2c97ffdd84695dc967e14c793089a7c50b41b
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index e9cadef82db0..16b69cd9c0aa 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -179,6 +179,7 @@ short SfxModalDialog::Execute() SetLOKNotifier(pViewShell); 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())); pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems); } @@ -252,6 +253,7 @@ void SfxModelessDialog::StateChanged( StateChangedType nStateChange ) // Check GetSizePixel() ? const Size aOptimalSize = GetOptimalSize(); std::vector<vcl::LOKPayloadItem> aItems; + aItems.emplace_back(std::make_pair("type", "dialog")); aItems.emplace_back(std::make_pair("size", aOptimalSize.toString())); pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems); } @@ -522,6 +524,7 @@ bool SfxFloatingWindow::Close() pBindings->GetDispatcher_Impl()->ExecuteList( pImpl->pMgr->GetType(), SfxCallMode::RECORD|SfxCallMode::SYNCHRON, { &aValue }); + return true; } diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index ce9e1a753984..eac3ea1968ae 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -524,6 +524,7 @@ short SfxTabDialog::Execute() SetLOKNotifier(pViewShell); 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())); pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems); } |