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 /sd | |
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 'sd')
-rw-r--r-- | sd/source/core/drawdoc2.cxx | 18 | ||||
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 7 |
2 files changed, 7 insertions, 18 deletions
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 8bde30f2380e..5fdde48063c3 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -398,13 +398,8 @@ void SdDrawDocument::InsertPage(SdrPage* pPage, sal_uInt16 nPos) if (comphelper::LibreOfficeKit::isActive() && static_cast<SdPage*>(pPage)->GetPageKind() == PageKind::Standard) { - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while (pViewShell) - { - SdXImpressDocument* pModel = comphelper::getUnoTunnelImplementation<SdXImpressDocument>(this->getUnoModel()); - SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel); - pViewShell = SfxViewShell::GetNext(*pViewShell); - } + SdXImpressDocument* pDoc = comphelper::getUnoTunnelImplementation<SdXImpressDocument>(this->getUnoModel()); + SfxLokHelper::notifyDocumentSizeChangedAllViews(pDoc); } } @@ -432,13 +427,8 @@ SdrPage* SdDrawDocument::RemovePage(sal_uInt16 nPgNum) if (comphelper::LibreOfficeKit::isActive() && static_cast<SdPage*>(pPage)->GetPageKind() == PageKind::Standard) { - SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while (pViewShell) - { - SdXImpressDocument* pModel = comphelper::getUnoTunnelImplementation<SdXImpressDocument>(this->getUnoModel()); - SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel); - pViewShell = SfxViewShell::GetNext(*pViewShell); - } + SdXImpressDocument* pDoc = comphelper::getUnoTunnelImplementation<SdXImpressDocument>(this->getUnoModel()); + SfxLokHelper::notifyDocumentSizeChangedAllViews(pDoc); } return pPage; diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 493c1984ed25..550fc741bf3c 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -1009,11 +1009,10 @@ IMPL_LINK_NOARG(SlideBackground, PaperSizeModifyHdl, ListBox&, void) if (comphelper::LibreOfficeKit::isActive()) { SfxViewShell* pViewShell = SfxViewShell::GetFirst(); - while (pViewShell) + if (pViewShell) { - SdXImpressDocument* pModel = comphelper::getUnoTunnelImplementation<SdXImpressDocument>(pViewShell->GetCurrentDocument()); - SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel); - pViewShell = SfxViewShell::GetNext(*pViewShell); + SdXImpressDocument* pDoc = comphelper::getUnoTunnelImplementation<SdXImpressDocument>(pViewShell->GetCurrentDocument()); + SfxLokHelper::notifyDocumentSizeChangedAllViews(pDoc); } } } |