summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-05-31 18:25:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-31 21:18:18 +0200
commita77b8b75f015fba74e2553c3cff58fcba298b9ed (patch)
tree1b10fd8b4f3c437450bf31ddd448d48f03a1b16d
parente1bac51546138aa5b138f73fd61430cb8582b9c6 (diff)
elide temporary vector in TextDecoratedPortionPrimitive2D
Change-Id: Ie3945d3a2e133d3ce527844f9c0d61a6541175e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135200 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx18
-rw-r--r--include/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx2
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,