From 3a668a2398fdbe7cfe0176900b26ca6145fb0e8c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 21 Aug 2021 19:57:35 +0200 Subject: 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 --- svgio/inc/svgpolynode.hxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'svgio/inc') 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 #include +#include namespace svgio::svgreader { @@ -33,7 +34,7 @@ namespace svgio::svgreader SvgStyleAttributes maSvgStyleAttributes; /// variable scan values, dependent of given XAttributeList - std::unique_ptr mpPolygon; + std::optional mpPolygon; std::unique_ptr 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& pPolygon) { mpPolygon = pPolygon; } /// transform content, set if found in current context const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform.get(); } -- cgit