include/sfx2/lokhelper.hxx | 3 +++ sfx2/source/view/lokhelper.cxx | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-)
New commits: commit 560b5112f6738f02a12adec7d5be04e2411c93b9 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Aug 17 20:22:02 2023 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Fri Aug 18 18:32:18 2023 +0200 add a SfxLokHelper::notifyInvalidation which can take a 'part' no change in behaviour intended Change-Id: I6040eafb03bcf39724761d7708540e9b25edd8f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155813 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index b46097938695..26b222bc8aa9 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -138,6 +138,9 @@ public: /// Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED for all views of the same document with the same part static void notifyPartSizeChangedAllViews(vcl::ITiledRenderable* pDoc, int nPart); /// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed. + static void notifyInvalidation(SfxViewShell const* pThisView, int nPart, tools::Rectangle const *); + /// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed + /// uses the Part reported by pThisView static void notifyInvalidation(SfxViewShell const* pThisView, tools::Rectangle const *); /// Notifies all views with the given type and payload. static void notifyAllViews(int nType, const OString& rPayload); diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 5bf6e8a1a2c4..cc3920fd0f35 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -610,12 +610,19 @@ void SfxLokHelper::notifyWindow(const SfxViewShell* pThisView, } void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, tools::Rectangle const* pRect) +{ + // -1 means all parts + const int nPart = comphelper::LibreOfficeKit::isPartInInvalidation() ? pThisView->getPart() : INT_MIN; + SfxLokHelper::notifyInvalidation(pThisView, nPart, pRect); +} + +void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const int nInPart, tools::Rectangle const* pRect) { if (DisableCallbacks::disabled()) return; // -1 means all parts - const int nPart = comphelper::LibreOfficeKit::isPartInInvalidation() ? pThisView->getPart() : INT_MIN; + const int nPart = comphelper::LibreOfficeKit::isPartInInvalidation() ? nInPart : INT_MIN; const int nMode = pThisView->getEditMode(); pThisView->libreOfficeKitViewInvalidateTilesCallback(pRect, nPart, nMode); }