summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-11-27 19:23:22 +0100
committerJan Holesovsky <kendy@collabora.com>2017-11-28 19:49:27 +0100
commiteba961f518774d467b03c5a77828a2a7c21b42ed (patch)
treeae65a0d16ae85e5a4227e7a8b34f9df115ba94bb /sfx2
parent57c0ccf77627b485e8ed05cad295c4eef5eb16e4 (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.cxx6
-rw-r--r--sfx2/source/dialog/tabdlg.cxx3
-rw-r--r--sfx2/source/view/viewsh.cxx31
3 files changed, 3 insertions, 37 deletions
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index e1afc854afd5..ce028f908472 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -171,7 +171,7 @@ void SfxModalDialog::dispose()
if (comphelper::LibreOfficeKit::isActive() && pViewShell)
{
pViewShell->notifyWindow(GetLOKWindowId(), "close");
- pViewShell->UnregisterDlg(GetLOKWindowId());
+ ReleaseLOKNotifier();
}
ModalDialog::dispose();
@@ -183,7 +183,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()));
@@ -255,7 +254,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();
@@ -398,7 +396,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 64bbc97727f9..23113c7836ea 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -409,7 +409,7 @@ void SfxTabDialog::dispose()
if (comphelper::LibreOfficeKit::isActive() && pViewShell)
{
pViewShell->notifyWindow(GetLOKWindowId(), "close");
- pViewShell->UnregisterDlg(GetLOKWindowId());
+ ReleaseLOKNotifier();
}
TabDialog::dispose();
@@ -524,7 +524,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 36229bd51ef4..78c43ed863f2 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -2046,37 +2046,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;