diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-20 12:49:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-20 17:48:01 +0100 |
commit | f56ae6badbb1eeb53c443bedbe8e96fd36ed426c (patch) | |
tree | 19dc942bd631bd6b88a1584abe526d33bf7ffa04 /svgio | |
parent | aa644cd9f39670521ba0c93c152fc428e7bf01b4 (diff) |
loplugin:refcounting in svgio
Change-Id: Id7669026fbe4b6cc92e2b137cba0c6c3c33f7712
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111259
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/inc/svgcharacternode.hxx | 3 | ||||
-rw-r--r-- | svgio/source/svgreader/svgcharacternode.cxx | 4 | ||||
-rw-r--r-- | svgio/source/svguno/xsvgparser.cxx | 11 |
3 files changed, 9 insertions, 9 deletions
diff --git a/svgio/inc/svgcharacternode.hxx b/svgio/inc/svgcharacternode.hxx index 46d7ec995b18..2a3331808949 100644 --- a/svgio/inc/svgcharacternode.hxx +++ b/svgio/inc/svgcharacternode.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SVGIO_INC_SVGCHARACTERNODE_HXX #include <sal/config.h> +#include <rtl/ref.hxx> #include <string_view> @@ -133,7 +134,7 @@ namespace svgio::svgreader OUString maText; /// local helpers - drawinglayer::primitive2d::TextSimplePortionPrimitive2D* createSimpleTextPrimitive( + rtl::Reference<drawinglayer::primitive2d::TextSimplePortionPrimitive2D> createSimpleTextPrimitive( SvgTextPosition& rSvgTextPosition, const SvgStyleAttributes& rSvgStyleAttributes) const; void decomposeTextWithStyle( diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx index dc24adc7ffc0..a0ab6d9b08a9 100644 --- a/svgio/source/svgreader/svgcharacternode.cxx +++ b/svgio/source/svgreader/svgcharacternode.cxx @@ -209,12 +209,12 @@ namespace svgio::svgreader } } - drawinglayer::primitive2d::TextSimplePortionPrimitive2D* SvgCharacterNode::createSimpleTextPrimitive( + rtl::Reference<drawinglayer::primitive2d::TextSimplePortionPrimitive2D> SvgCharacterNode::createSimpleTextPrimitive( SvgTextPosition& rSvgTextPosition, const SvgStyleAttributes& rSvgStyleAttributes) const { // prepare retval, index and length - drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pRetval = nullptr; + rtl::Reference<drawinglayer::primitive2d::TextSimplePortionPrimitive2D> pRetval; sal_uInt32 nLength(getText().getLength()); if(nLength) diff --git a/svgio/source/svguno/xsvgparser.cxx b/svgio/source/svguno/xsvgparser.cxx index 511640e6f6d7..ddd9d20cd74c 100644 --- a/svgio/source/svguno/xsvgparser.cxx +++ b/svgio/source/svguno/xsvgparser.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/xml/sax/InputSource.hpp> #include <svgdocumenthandler.hxx> #include <tools/diagnose_ex.h> +#include <rtl/ref.hxx> #include <svgvisitor.hxx> @@ -124,9 +125,8 @@ namespace svgio::svgreader if(xSVGStream.is()) { // local document handler - SvgDocHdl* pSvgDocHdl = new SvgDocHdl(aAbsolutePath); - uno::Reference<xml::sax::XDocumentHandler> xSvgDocHdl(pSvgDocHdl); - parseSvgXML(xSVGStream, xSvgDocHdl); + rtl::Reference<SvgDocHdl> pSvgDocHdl = new SvgDocHdl(aAbsolutePath); + parseSvgXML(xSVGStream, pSvgDocHdl); // decompose to primitives for(std::unique_ptr<SvgNode> const & pCandidate : pSvgDocHdl->getSvgDocument().getSvgNodeVector()) @@ -154,9 +154,8 @@ namespace svgio::svgreader if (!xSvgStream.is()) return aAnyResult; - SvgDocHdl* pSvgDocHdl = new SvgDocHdl(aAbsolutePath); - uno::Reference<xml::sax::XDocumentHandler> xSvgDocHdl(pSvgDocHdl); - parseSvgXML(xSvgStream, xSvgDocHdl); + rtl::Reference<SvgDocHdl> pSvgDocHdl = new SvgDocHdl(aAbsolutePath); + parseSvgXML(xSvgStream, pSvgDocHdl); // decompose to primitives for (std::unique_ptr<SvgNode> const & pCandidate : pSvgDocHdl->getSvgDocument().getSvgNodeVector()) |