summaryrefslogtreecommitdiff
path: root/svgio/inc/svgpolynode.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-08-21 19:57:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-22 10:31:24 +0200
commit3a668a2398fdbe7cfe0176900b26ca6145fb0e8c (patch)
tree58c3dd991d7609ace1c0560e39748908c2b5c1ae /svgio/inc/svgpolynode.hxx
parent523bba89cd5ad6372fb0431cecabdca02ea2b9e3 (diff)
no need to use unique_ptr for B2DPolygon
it is already a COW type Change-Id: I86c4be9dd83b98eedf169c3b6668a7994204bca0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120827 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svgio/inc/svgpolynode.hxx')
-rw-r--r--svgio/inc/svgpolynode.hxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/svgio/inc/svgpolynode.hxx b/svgio/inc/svgpolynode.hxx
index abd14271d543..f5974cd28c08 100644
--- a/svgio/inc/svgpolynode.hxx
+++ b/svgio/inc/svgpolynode.hxx
@@ -23,6 +23,7 @@
#include "svgstyleattributes.hxx"
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <optional>
namespace svgio::svgreader
{
@@ -33,7 +34,7 @@ namespace svgio::svgreader
SvgStyleAttributes maSvgStyleAttributes;
/// variable scan values, dependent of given XAttributeList
- std::unique_ptr<basegfx::B2DPolygon> mpPolygon;
+ std::optional<basegfx::B2DPolygon> mpPolygon;
std::unique_ptr<basegfx::B2DHomMatrix> mpaTransform;
bool mbIsPolyline : 1; // true = polyline, false = polygon
@@ -50,7 +51,7 @@ namespace svgio::svgreader
virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override;
/// Polygon content, set if found in current context
- void setPolygon(const basegfx::B2DPolygon* pPolygon) { mpPolygon.reset(); if(pPolygon) mpPolygon.reset(new basegfx::B2DPolygon(*pPolygon)); }
+ void setPolygon(const std::optional<basegfx::B2DPolygon>& pPolygon) { mpPolygon = pPolygon; }
/// transform content, set if found in current context
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform.get(); }