diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-09-27 12:51:42 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-09-27 12:51:42 +0200 |
commit | 308a1f75c2cbb85c463bb8d2d3bf2747f99f5231 (patch) | |
tree | 31aa01e9e4f055efb94945b955b8b9440c6ffb09 /sfx2 | |
parent | dde083386429aaf13d72870fc543d28d9b3a5ddb (diff) |
lok: send an invalidation by document size change
It was sent by the kit code earlier. Now we move it
to the LO core code, so we can optimize it later.
co-author: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/79491
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit cd7ff1797d754018db1d47888781c9d7ecb24dcf)
Change-Id: Id0a8991016dbe8d13891071e2d5b4c9250720da9
Reviewed-on: https://gerrit.libreoffice.org/79617
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 85834534316c..4343c2633da8 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -201,6 +201,26 @@ void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const OStri pThisView->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, aBuf.makeStringAndClear().getStr()); } +void SfxLokHelper::notifyDocumentSizeChanged(SfxViewShell const* pThisView, const OString& rPayload, vcl::ITiledRenderable* pDoc, bool bInvalidateAll) +{ + if (!comphelper::LibreOfficeKit::isActive()) + return; + + if (!pDoc) + return; + + if (bInvalidateAll) + { + for (int i = 0; i < pDoc->getParts(); ++i) + { + tools::Rectangle aRectangle(0, 0, 1000000000, 1000000000); + OString sPayload = aRectangle.toString() + OString(", ") + OString::number(i); + pThisView->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sPayload.getStr()); + } + } + pThisView->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, rPayload.getStr()); +} + void SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* pThisView, const OString& rRectangle) { OString sPayload; |