diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-11-24 01:20:56 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-29 10:16:53 +0100 |
commit | f3f4c039072657739d2bedb7210f2a22b85fdb55 (patch) | |
tree | 62c9bb21bee0ac5e497416be7e3b4ba00866aa85 /sfx2/source/view/viewsh.cxx | |
parent | 2798e1aae5311094c30d8e667c1e8be4e4314f8d (diff) |
lokdialog: Make vcl::DialogID an integer
This will help launching multiple instances of dialog from multiple
views. The earlier approach of using the UNO command strings as dialog
id would not have been useful for multi-view case.
Change-Id: I01cfb3c8b204d5654df2417efdac6b50dc920f0e
Diffstat (limited to 'sfx2/source/view/viewsh.cxx')
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 2d4d8af19a70..92dcfa48cdcf 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1948,31 +1948,28 @@ Reference< view::XRenderable > SfxViewShell::GetRenderable() return xRender; } -void SfxViewShell::notifyDialog(const vcl::DialogID& rDialogID, const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload) +void SfxViewShell::notifyDialog(const vcl::DialogID& rDialogId, const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload) { - SfxLokHelper::notifyDialog(rDialogID, rAction, rPayload); + SfxLokHelper::notifyDialog(rDialogId, rAction, rPayload); } -void SfxViewShell::notifyDialogChild(const vcl::DialogID& rDialogID, const OUString& rAction, const Point& rPos) +void SfxViewShell::notifyDialogChild(const vcl::DialogID& rDialogId, const OUString& rAction, const Point& rPos) { - SfxLokHelper::notifyDialog(rDialogID, rAction); + SfxLokHelper::notifyDialog(rDialogId, rAction); } -void SfxViewShell::RegisterDlg(const vcl::DialogID& rDialogId, VclPtr<Dialog> pDlg) +void SfxViewShell::RegisterDlg(vcl::DialogID nDialogId, VclPtr<Dialog> pDlg) { if (pDlg) - maOpenedDialogs.push_back(std::make_pair(rName, pDlg)); + maOpenedDialogs.push_back(std::make_pair(nDialogId, pDlg)); } -VclPtr<Dialog> SfxViewShell::GetOpenedDlg(const vcl::DialogID& rDialogId) +VclPtr<Dialog> SfxViewShell::GetOpenedDlg(vcl::DialogID nDialogId) { - if (rName.startsWith(".uno:")) - rName = rName.replaceFirst(".uno:", ""); - const auto it = std::find_if(maOpenedDialogs.begin(), maOpenedDialogs.end(), - [&rDialogId](const std::pair<vcl::DialogID, VclPtr<Dialog>> aItem) { - return rDialogId == aItem.first; + [&nDialogId](const std::pair<vcl::DialogID, VclPtr<Dialog>> aItem) { + return nDialogId == aItem.first; }); Dialog* ret = nullptr; @@ -1983,12 +1980,12 @@ VclPtr<Dialog> SfxViewShell::GetOpenedDlg(const vcl::DialogID& rDialogId) return ret; } -void SfxViewShell::UnregisterDlg(const OUString& rName) +void SfxViewShell::UnregisterDlg(vcl::DialogID nDialogId) { maOpenedDialogs.erase(std::remove_if(maOpenedDialogs.begin(), maOpenedDialogs.end(), - [&rDialogId](const std::pair<vcl::DialogID, VclPtr<Dialog>> aItem) { - return aItem.first == rDialogId; + [&nDialogId](const std::pair<vcl::DialogID, VclPtr<Dialog>> aItem) { + return aItem.first == nDialogId; })); } |