diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-04 11:37:34 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2021-08-04 18:23:34 +0200 |
commit | 5a76932c9f53bd35a83f3f956d4cbd693b88bfee (patch) | |
tree | 02342b6598128ecf340a724a84c495b4af9d4648 /sfx2 | |
parent | 40272c9a9b2c554d34cbb942a6fab2e7977dd549 (diff) |
improve LOK notifyInvalidation
(*) tweak buffer in SfxLokHelper::notifyInvalidation to be a bit larger,
so we avoid the cost of a resize©
(*) use our optimised OString concatentation instead of going via
std::stringstream
(*) pass down a pointer to rectangle, instead of a string. later we will
use this to avoid doing the stringify until later
Change-Id: Ia3e3042bc919d9b9cb80e47a93704eb236438605
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119994
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 04ea9b8a25f5..1641811af86d 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -506,14 +506,16 @@ void SfxLokHelper::notifyWindow(const SfxViewShell* pThisView, pThisView->libreOfficeKitViewCallback(LOK_CALLBACK_WINDOW, s.getStr()); } -void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload) +void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, tools::Rectangle const* pRect) { - OStringBuffer aBuf(32); - if (DisableCallbacks::disabled()) return; - aBuf.append(rPayload); + OStringBuffer aBuf(64); + if (pRect) + aBuf.append(pRect->toString()); + else + aBuf.append("EMPTY"); if (comphelper::LibreOfficeKit::isPartInInvalidation()) { aBuf.append(", "); |