summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-16 12:38:31 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-16 14:49:30 +0200
commitc485dfc8c38972e0538ec4dde0a457b7fa050d05 (patch)
tree28797a80ececf0fbc174e317a5bd98bd9eced450 /sfx2
parenta03179ce1b9365eedeb782a4d5766f620ccadd6e (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 (cherry picked from commit dcc92a7cb5aa1faa711c8da7f7d8ecee0a192c25)
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/lokhelper.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index d06f92f9644a..61252b14d083 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -90,6 +90,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;