diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-16 12:38:31 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-16 14:48:23 +0200 |
commit | dcc92a7cb5aa1faa711c8da7f7d8ecee0a192c25 (patch) | |
tree | f6ed2e55dd7dad168af83e266dc53acbe2926af9 /sfx2 | |
parent | 9035f00ede7925eb699864d17baf7c897a8c7e53 (diff) |
sfx2: add SfxLokHelper::getViewIds
and also expose it in the LOK API. This way clients don't have to keep
track of what views they created / destroyed, they can also get an up to
date list with this method.
Change-Id: Ibaee42c545803e04a31e7c13ab6ec370b99465c4
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 5769127c299d..619e48e61d22 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -94,6 +94,20 @@ std::size_t SfxLokHelper::getViewsCount() return rViewArr.size(); } +bool SfxLokHelper::getViewIds(int* pArray, size_t nSize) +{ + SfxViewShellArr_Impl& rViewArr = SfxGetpApp()->GetViewShells_Impl(); + if (rViewArr.size() > nSize) + return false; + + for (std::size_t i = 0; i < rViewArr.size(); ++i) + { + SfxViewShell* pViewShell = rViewArr[i]; + pArray[i] = pViewShell->GetViewShellId(); + } + return true; +} + void SfxLokHelper::notifyOtherView(SfxViewShell* pThisView, SfxViewShell* pOtherView, int nType, const OString& rKey, const OString& rPayload) { boost::property_tree::ptree aTree; |