summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-02-07 09:16:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-02-07 11:27:10 +0100
commitf9772bee2bc95a5b1880286dfb255e026cbd8a1e (patch)
treeed26a0b10d67e1bf24640d5664cdb8dc4bfad2dd /drawinglayer
parent10cc0f3d2ddaa5d7f6ee18042dacfc67c1be96af (diff)
simplify some Primitive2DContainer construction
Change-Id: Iced31da6891a5d218d63e9b59d48fb2645f39203 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163071 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx20
-rw-r--r--drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx4
2 files changed, 10 insertions, 14 deletions
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index cdda7d660e7e..4fcf7357882e 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -522,10 +522,9 @@ namespace drawinglayer::primitive2d
if(rGraphic.IsAnimated())
{
// prepare specialized AnimatedGraphicPrimitive2D
- aRetval.resize(1);
- aRetval[0] = new AnimatedGraphicPrimitive2D(
+ aRetval = Primitive2DContainer { new AnimatedGraphicPrimitive2D(
rGraphic,
- rTransform);
+ rTransform) };
}
else if(rGraphic.getVectorGraphicData())
{
@@ -548,18 +547,16 @@ namespace drawinglayer::primitive2d
aEmbedVectorGraphic = rTransform * aEmbedVectorGraphic;
// add Vector Graphic Data primitives embedded
- aRetval.resize(1);
- aRetval[0] = new TransformPrimitive2D(
+ aRetval = Primitive2DContainer { new TransformPrimitive2D(
aEmbedVectorGraphic,
- Primitive2DContainer(rGraphic.getVectorGraphicData()->getPrimitive2DSequence()));
+ Primitive2DContainer(rGraphic.getVectorGraphicData()->getPrimitive2DSequence()))};
}
}
else
{
- aRetval.resize(1);
- aRetval[0] = new BitmapPrimitive2D(
+ aRetval = Primitive2DContainer { new BitmapPrimitive2D(
rGraphic.GetBitmapEx(),
- rTransform);
+ rTransform) };
}
break;
@@ -570,10 +567,9 @@ namespace drawinglayer::primitive2d
// create MetafilePrimitive2D
const GDIMetaFile& rMetafile = rGraphic.GetGDIMetaFile();
- aRetval.resize(1);
- aRetval[0] = new MetafilePrimitive2D(
+ aRetval = Primitive2DContainer { new MetafilePrimitive2D(
rTransform,
- rMetafile);
+ rMetafile) };
// #i100357# find out if clipping is needed for this primitive. Unfortunately,
// there exist Metafiles who's content is bigger than the proposed PrefSize set
diff --git a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
index 269be2d01817..7300bc2a70eb 100644
--- a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
@@ -191,8 +191,8 @@ namespace drawinglayer::primitive2d
// add primitive
const attribute::LineAttribute aLineAttribute(getFontColor(), fStrikeoutHeight, basegfx::B2DLineJoin::NONE);
- Primitive2DContainer xRetval(1);
- xRetval[0] = new PolygonStrokePrimitive2D(std::move(aStrikeoutLine), aLineAttribute);
+ Primitive2DContainer xRetval {
+ new PolygonStrokePrimitive2D(std::move(aStrikeoutLine), aLineAttribute) };
if(bDoubleLine)
{