diff options
author | Jan Holesovsky <kendy@collabora.com> | 2017-11-27 19:23:22 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-29 10:16:58 +0100 |
commit | d516c5c9819dcd7dc6dded2f8f9d9e44061b23c0 (patch) | |
tree | 0304dd3f677801f4d189fd29bc1b9e2b31f2c86a /sfx2 | |
parent | b4487b0fd22ce1fc595851f63a3f7bba36681f2c (diff) |
lokdialog: Move the LOKWindowId <-> VclPtr<Window> mapping to Window.
This allows registering & de-registering of non-sfx windows too, and makes the
Calc autofilter popup to appear.
Change-Id: I7cbbe94d208115aabcb6fa5f964646c7b7ce4c93
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 31 |
3 files changed, 3 insertions, 37 deletions
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index fba79fdcc1b0..e9cadef82db0 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -165,7 +165,7 @@ void SfxModalDialog::dispose() if (comphelper::LibreOfficeKit::isActive() && pViewShell) { pViewShell->notifyWindow(GetLOKWindowId(), "close"); - pViewShell->UnregisterDlg(GetLOKWindowId()); + ReleaseLOKNotifier(); } ModalDialog::dispose(); @@ -177,7 +177,6 @@ short SfxModalDialog::Execute() if (comphelper::LibreOfficeKit::isActive() && pViewShell) { SetLOKNotifier(pViewShell); - pViewShell->RegisterDlg(GetLOKWindowId(), this); const Size aSize = GetOptimalSize(); std::vector<vcl::LOKPayloadItem> aItems; aItems.emplace_back(std::make_pair("size", aSize.toString())); @@ -249,7 +248,6 @@ void SfxModelessDialog::StateChanged( StateChangedType nStateChange ) if (comphelper::LibreOfficeKit::isActive() && pViewShell) { SetLOKNotifier(pViewShell); - pViewShell->RegisterDlg(GetLOKWindowId(), this); // Below method doesn't really give the exact dimensions, // Check GetSizePixel() ? const Size aOptimalSize = GetOptimalSize(); @@ -394,7 +392,7 @@ void SfxModelessDialog::dispose() if (comphelper::LibreOfficeKit::isActive() && pViewShell) { pViewShell->notifyWindow(GetLOKWindowId(), "close"); - pViewShell->UnregisterDlg(GetLOKWindowId()); + ReleaseLOKNotifier(); } ModelessDialog::dispose(); diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 10cacfb0eee2..ce9e1a753984 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -407,7 +407,7 @@ void SfxTabDialog::dispose() if (comphelper::LibreOfficeKit::isActive() && pViewShell) { pViewShell->notifyWindow(GetLOKWindowId(), "close"); - pViewShell->UnregisterDlg(GetLOKWindowId()); + ReleaseLOKNotifier(); } TabDialog::dispose(); @@ -522,7 +522,6 @@ short SfxTabDialog::Execute() if (comphelper::LibreOfficeKit::isActive() && pViewShell) { SetLOKNotifier(pViewShell); - pViewShell->RegisterDlg(GetLOKWindowId(), this); const Size aSize = GetOptimalSize(); std::vector<vcl::LOKPayloadItem> aItems; aItems.emplace_back(std::make_pair("size", aSize.toString())); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index c286992d168e..4f08ef2298d6 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1958,37 +1958,6 @@ void SfxViewShell::notifyWindowChild(vcl::LOKWindowId nDialogId, const OUString& SfxLokHelper::notifyWindowChild(nDialogId, rAction, rPos); } -void SfxViewShell::RegisterDlg(vcl::LOKWindowId nDialogId, VclPtr<Dialog> pDlg) -{ - if (pDlg) - maOpenedDialogs.push_back(std::make_pair(nDialogId, pDlg)); -} - -VclPtr<Dialog> SfxViewShell::GetOpenedDlg(vcl::LOKWindowId nDialogId) -{ - const auto it = std::find_if(maOpenedDialogs.begin(), - maOpenedDialogs.end(), - [&nDialogId](const std::pair<vcl::LOKWindowId, VclPtr<Dialog>> aItem) { - return nDialogId == aItem.first; - }); - - Dialog* ret = nullptr; - if (it != maOpenedDialogs.end()) - { - ret = it->second; - } - return ret; -} - -void SfxViewShell::UnregisterDlg(vcl::LOKWindowId nDialogId) -{ - maOpenedDialogs.erase(std::remove_if(maOpenedDialogs.begin(), - maOpenedDialogs.end(), - [&nDialogId](const std::pair<vcl::LOKWindowId, VclPtr<Dialog>> aItem) { - return aItem.first == nDialogId; - })); -} - uno::Reference< datatransfer::clipboard::XClipboardNotifier > SfxViewShell::GetClipboardNotifier() { uno::Reference< datatransfer::clipboard::XClipboardNotifier > xClipboardNotifier; |