diff options
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 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; |