diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-16 14:14:04 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-06 16:24:42 +0200 |
commit | dcdff4c897e9a0f10f2422a907b33bea8f4edf6c (patch) | |
tree | 443bb8f05695bc531b00ecf202a7003463604025 /sfx2 | |
parent | b40bc4e75a7fc3d4dc4eca6c556e4f93f2143249 (diff) |
LOK: make getViews() be a member function of Document
Just to be consistent, as all other view-related member functions are
there, too.
No real impact, as only the unit test uses this so far, and it always
works with a single document.
Change-Id: I46f1ed8265ab95017986ab45c1b510e961192241
(cherry picked from commit a04b31c9facb08a8e38b79480b9a73bd2693cb9e)
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 0beb06ddd956..646715ef226f 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -62,10 +62,19 @@ size_t SfxLokHelper::getView() return 0; } -int SfxLokHelper::getViews() +size_t SfxLokHelper::getViews() { + size_t nRet = 0; + + SfxObjectShell* pObjectShell = SfxViewFrame::Current()->GetObjectShell(); SfxViewShellArr_Impl& rViewArr = SfxGetpApp()->GetViewShells_Impl(); - return rViewArr.size(); + for (size_t i = 0; i < rViewArr.size(); ++i) + { + if (rViewArr[i]->GetObjectShell() == pObjectShell) + ++nRet; + } + + return nRet; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |