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-09-16 19:01:07 +0200 |
commit | 712c5d7090abea828aff57f199879a7897211680 (patch) | |
tree | d2e24d74769c1fbc8cd448bbcb4a15169cc44519 /sc/source | |
parent | d65e177242f2e7359e17161af5f5092daacc34eb (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>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120072
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 417f881d20cafe88a02b64894ba4483875fb9460)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122123
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 4 |
3 files changed, 9 insertions, 8 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index ce6c70b44c01..926e2407a0db 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1503,12 +1503,13 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, void ScGridWindow::LogicInvalidate(const tools::Rectangle* pRectangle) { - OString sRectangle; + tools::Rectangle aRectangle; + tools::Rectangle* pResultRectangle; if (!pRectangle) - sRectangle = "EMPTY"; + pResultRectangle = nullptr; else { - tools::Rectangle aRectangle(*pRectangle); + aRectangle = *pRectangle; // When dragging shapes the map mode is disabled. if (IsMapModeEnabled()) { @@ -1517,11 +1518,11 @@ void ScGridWindow::LogicInvalidate(const tools::Rectangle* pRectangle) } else aRectangle = PixelToLogic(aRectangle, MapMode(MapUnit::MapTwip)); - sRectangle = aRectangle.toString(); + pResultRectangle = &aRectangle; } ScTabViewShell* pViewShell = mrViewData.GetViewShell(); - SfxLokHelper::notifyInvalidation(pViewShell, sRectangle); + SfxLokHelper::notifyInvalidation(pViewShell, pResultRectangle); } void ScGridWindow::SetCellSelectionPixel(int nType, int nPixelX, int nPixelY) diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 70e781d5e30c..f1aa58eabaf3 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2586,7 +2586,7 @@ void lcl_ExtendTiledDimension(bool bColumn, const SCCOLROW nEnd, const SCCOLROW if ((bColumn && aNewArea.getWidth()) || (!bColumn && aNewArea.getHeight())) { rTabView.UpdateSelectionOverlay(); - SfxLokHelper::notifyInvalidation(rViewData.GetViewShell(), aNewArea.toString()); + SfxLokHelper::notifyInvalidation(rViewData.GetViewShell(), &aNewArea); } // Provide size in the payload, so clients don't have to query for that. diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index ec257e9d8b5f..bd34fd5d7520 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -429,13 +429,13 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew ) // Only invalidate if spreadsheet extended to the right if (aNewColArea.getWidth()) { - SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), aNewColArea.toString()); + SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), &aNewColArea); } // Only invalidate if spreadsheet extended to the bottom if (aNewRowArea.getHeight()) { - SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), aNewRowArea.toString()); + SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), &aNewRowArea); } // Provide size in the payload, so clients don't have to |