summaryrefslogtreecommitdiff
path: root/svgio/source/svgreader/svgdocument.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-25 13:23:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-26 08:58:42 +0200
commit6cc5c6dea2b03a14e051728aa513fb206929ea86 (patch)
tree1f7f38dbc0ffdf59addbbac239f16bd125bfad36 /svgio/source/svgreader/svgdocument.cxx
parent0699a18c622149ac6dbc898bf920c47c45ccd5b9 (diff)
loplugin:useuniqueptr in SvgDocument
Change-Id: I299e97c276b60be86491bfeee22d46774739ca44 Reviewed-on: https://gerrit.libreoffice.org/60969 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svgio/source/svgreader/svgdocument.cxx')
-rw-r--r--svgio/source/svgreader/svgdocument.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/svgio/source/svgreader/svgdocument.cxx b/svgio/source/svgreader/svgdocument.cxx
index 44fb0d507eec..716db822a83c 100644
--- a/svgio/source/svgreader/svgdocument.cxx
+++ b/svgio/source/svgreader/svgdocument.cxx
@@ -33,18 +33,12 @@ namespace svgio
SvgDocument::~SvgDocument()
{
- while(!maNodes.empty())
- {
- SvgNode* pCandidate = maNodes[maNodes.size() - 1];
- delete pCandidate;
- maNodes.pop_back();
- }
}
- void SvgDocument::appendNode(SvgNode* pNode)
+ void SvgDocument::appendNode(std::unique_ptr<SvgNode> pNode)
{
- OSL_ENSURE(pNode, "OOps, empty node added (!)");
- maNodes.push_back(pNode);
+ assert(pNode);
+ maNodes.push_back(std::move(pNode));
}
void SvgDocument::addSvgNodeToMapper(const OUString& rStr, const SvgNode& rNode)