diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-20 16:42:34 +0200 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-07-20 01:33:10 -0400 |
commit | bce02c8547a87bc9c2270c341529d9a13142432a (patch) | |
tree | f084944c034e88f4f830033b9b40a6cfa79753c5 /sfx2 | |
parent | 9eb34b8099946688bbd6e828a44a77e5632a8555 (diff) |
sw lok: add LOK_CALLBACK_INVALIDATE_VIEW_CURSOR
So a view can be aware where cursors of other views are.
Reviewed-on: https://gerrit.libreoffice.org/26513
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit c544a8b674dd7ac9dd466a84a440ede030942438)
Change-Id: I6133fb55aa2869843c0284b7d76264bab3b3d5da
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 3a306cfbe362..ba42188c178b 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -60,16 +60,22 @@ void SfxLokHelper::setView(std::uintptr_t nId) } -std::uintptr_t SfxLokHelper::getView() +std::uintptr_t SfxLokHelper::getView(SfxViewShell *pViewShell) { - return reinterpret_cast<std::uintptr_t>(SfxViewShell::Current()); + if (!pViewShell) + pViewShell = SfxViewShell::Current(); + return reinterpret_cast<std::uintptr_t>(pViewShell); } std::size_t SfxLokHelper::getViews() { std::size_t nRet = 0; - SfxObjectShell* pObjectShell = SfxViewFrame::Current()->GetObjectShell(); + SfxViewFrame* pViewFrame = SfxViewFrame::Current(); + if (!pViewFrame) + return nRet; + + SfxObjectShell* pObjectShell = pViewFrame->GetObjectShell(); SfxViewShellArr_Impl& rViewArr = SfxGetpApp()->GetViewShells_Impl(); for (SfxViewShell* i : rViewArr) { |