Kaydet (Commit) 8a9f8d35 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SvgPathNode

Change-Id: I8e4485a308edecf05a2bc70d5c067af3b0eef5d1
Reviewed-on: https://gerrit.libreoffice.org/50654Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst b687cebf
...@@ -35,8 +35,8 @@ namespace svgio ...@@ -35,8 +35,8 @@ namespace svgio
SvgStyleAttributes maSvgStyleAttributes; SvgStyleAttributes maSvgStyleAttributes;
/// variable scan values, dependent of given XAttributeList /// variable scan values, dependent of given XAttributeList
basegfx::B2DPolyPolygon* mpPolyPolygon; std::unique_ptr<basegfx::B2DPolyPolygon> mpPolyPolygon;
basegfx::B2DHomMatrix* mpaTransform; std::unique_ptr<basegfx::B2DHomMatrix> mpaTransform;
SvgNumber maPathLength; SvgNumber maPathLength;
basegfx::utils::PointIndexSet maHelpPointIndices; basegfx::utils::PointIndexSet maHelpPointIndices;
...@@ -51,12 +51,12 @@ namespace svgio ...@@ -51,12 +51,12 @@ namespace svgio
virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override;
/// path content, set if found in current context /// path content, set if found in current context
const basegfx::B2DPolyPolygon* getPath() const { return mpPolyPolygon; } const basegfx::B2DPolyPolygon* getPath() const { return mpPolyPolygon.get(); }
void setPath(const basegfx::B2DPolyPolygon* pPath) { if(mpPolyPolygon) delete mpPolyPolygon; mpPolyPolygon = nullptr; if(pPath) mpPolyPolygon = new basegfx::B2DPolyPolygon(*pPath); } void setPath(const basegfx::B2DPolyPolygon* pPath) { mpPolyPolygon.reset(); if(pPath) mpPolyPolygon.reset(new basegfx::B2DPolyPolygon(*pPath)); }
/// transform content, set if found in current context /// transform content, set if found in current context
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform.get(); }
void setTransform(const basegfx::B2DHomMatrix* pMatrix) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } void setTransform(const basegfx::B2DHomMatrix* pMatrix) { mpaTransform.reset(); if(pMatrix) mpaTransform.reset(new basegfx::B2DHomMatrix(*pMatrix)); }
/// PathLength content /// PathLength content
const SvgNumber& getPathLength() const { return maPathLength; } const SvgNumber& getPathLength() const { return maPathLength; }
......
...@@ -37,8 +37,6 @@ namespace svgio ...@@ -37,8 +37,6 @@ namespace svgio
SvgPathNode::~SvgPathNode() SvgPathNode::~SvgPathNode()
{ {
delete mpPolyPolygon;
delete mpaTransform;
} }
const SvgStyleAttributes* SvgPathNode::getSvgStyleAttributes() const const SvgStyleAttributes* SvgPathNode::getSvgStyleAttributes() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment