diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-09-22 13:20:49 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-09-25 12:34:40 +0200 |
commit | e9260633df07b6796b19bc92523671cb345597a1 (patch) | |
tree | 88ec562b1fc57bf49deabed28166079c5880d53a /sc/source/core | |
parent | db0e7e3715bdef7ad6c1f536e9cf1ea84773fbe8 (diff) |
lok: deduplicate code related to notifyDocumentSizeChanged() call
Change-Id: Ia4cef7b23fc682ec32aeb9be4dcdd582464c64e9
co-author: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/79498
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/document.cxx | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 81cdc056daf1..e94d0b4f0db5 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -584,13 +584,8 @@ bool ScDocument::InsertTab( if (comphelper::LibreOfficeKit::isActive() && GetDrawLayer()) { - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while (pViewShell) - { - ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(pViewShell->GetCurrentDocument()); - SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel); - pViewShell = SfxViewShell::GetNext(*pViewShell); - } + ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(this->GetDocumentShell()->GetModel()); + SfxLokHelper::notifyDocumentSizeChangedAllViews(pModel); } } @@ -755,13 +750,8 @@ bool ScDocument::DeleteTab( SCTAB nTab ) if (comphelper::LibreOfficeKit::isActive()) { - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while (pViewShell) - { - ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(pViewShell->GetCurrentDocument()); - SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel); - pViewShell = SfxViewShell::GetNext(*pViewShell); - } + ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(this->GetDocumentShell()->GetModel()); + SfxLokHelper::notifyDocumentSizeChangedAllViews(pModel); } bValid = true; @@ -852,13 +842,8 @@ bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets ) if (comphelper::LibreOfficeKit::isActive()) { - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while (pViewShell) - { - ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(pViewShell->GetCurrentDocument()); - SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel); - pViewShell = SfxViewShell::GetNext(*pViewShell); - } + ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(this->GetDocumentShell()->GetModel()); + SfxLokHelper::notifyDocumentSizeChangedAllViews(pModel); } bValid = true; @@ -904,13 +889,8 @@ bool ScDocument::RenameTab( SCTAB nTab, const OUString& rName, bool bExternalDoc if (comphelper::LibreOfficeKit::isActive() && GetDrawLayer()) { - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while (pViewShell) - { - ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(pViewShell->GetCurrentDocument()); - SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel); - pViewShell = SfxViewShell::GetNext(*pViewShell); - } + ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(this->GetDocumentShell()->GetModel()); + SfxLokHelper::notifyDocumentSizeChangedAllViews(pModel); } } } |