From 417f881d20cafe88a02b64894ba4483875fb9460 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 4 Aug 2021 11:37:34 +0200 Subject: 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 Reviewed-by: Michael Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120072 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/ui/view/sdwindow.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 8c0d58f50cec..bb29151b4b1e 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -1028,18 +1028,19 @@ void Window::LogicInvalidate(const ::tools::Rectangle* pRectangle) if (!comphelper::LibreOfficeKit::isActive()) return; - OString sRectangle; + ::tools::Rectangle aRectangle; + ::tools::Rectangle* pResultRectangle; if (!pRectangle) - sRectangle = "EMPTY"; + pResultRectangle = nullptr; else { - ::tools::Rectangle aRectangle(*pRectangle); + aRectangle = *pRectangle; if (GetMapMode().GetMapUnit() == MapUnit::Map100thMM) aRectangle = OutputDevice::LogicToLogic(aRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); - sRectangle = aRectangle.toString(); + pResultRectangle = &aRectangle; } SfxViewShell& rSfxViewShell = pDrawViewShell->GetViewShellBase(); - SfxLokHelper::notifyInvalidation(&rSfxViewShell, sRectangle); + SfxLokHelper::notifyInvalidation(&rSfxViewShell, pResultRectangle); } void Window::LogicMouseButtonDown(const MouseEvent& rMouseEvent) -- cgit