From a77b8b75f015fba74e2553c3cff58fcba298b9ed Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 31 May 2022 18:25:35 +0200 Subject: elide temporary vector in TextDecoratedPortionPrimitive2D Change-Id: Ie3945d3a2e133d3ce527844f9c0d61a6541175e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135200 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../source/primitive2d/textdecoratedprimitive2d.cxx | 18 ++---------------- .../primitive2d/textdecoratedprimitive2d.hxx | 2 +- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx index f92529fe50d7..0db26fbeb28d 100644 --- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx @@ -30,7 +30,7 @@ namespace drawinglayer::primitive2d { void TextDecoratedPortionPrimitive2D::impCreateGeometryContent( - std::vector< Primitive2DReference >& rTarget, + Primitive2DContainer& rTarget, basegfx::utils::B2DHomMatrixBufferedOnDemandDecompose const & rDecTrans, const OUString& rText, sal_Int32 nTextPosition, @@ -170,7 +170,6 @@ namespace drawinglayer::primitive2d // decompose local entity } } - std::vector< Primitive2DReference > aNewPrimitives; basegfx::utils::B2DHomMatrixBufferedOnDemandDecompose aDecTrans(getTextTransform()); Primitive2DContainer aRetval; @@ -190,20 +189,7 @@ namespace drawinglayer::primitive2d getFontAttribute().getBiDiStrong()); // handle as one word - impCreateGeometryContent(aNewPrimitives, aDecTrans, getText(), getTextPosition(), getTextLength(), getDXArray(), aNewFontAttribute); - - // convert to Primitive2DSequence - const sal_uInt32 nMemberCount(aNewPrimitives.size()); - - if(nMemberCount) - { - aRetval.resize(nMemberCount); - - for(sal_uInt32 a(0); a < nMemberCount; a++) - { - aRetval[a] = aNewPrimitives[a]; - } - } + impCreateGeometryContent(aRetval, aDecTrans, getText(), getTextPosition(), getTextLength(), getDXArray(), aNewFontAttribute); // Handle Shadow, Outline and TextRelief if(!aRetval.empty()) diff --git a/include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx b/include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx index 8ff500b77efe..1a4d821c7e60 100644 --- a/include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx @@ -57,7 +57,7 @@ namespace drawinglayer::primitive2d /// helper methods void impCreateGeometryContent( - std::vector< Primitive2DReference >& rTarget, + Primitive2DContainer& rTarget, basegfx::utils::B2DHomMatrixBufferedOnDemandDecompose const & rDecTrans, const OUString& rText, sal_Int32 nTextPosition, -- cgit