svgio/inc/svgcharacternode.hxx              |    3 ++-
 svgio/source/svgreader/svgcharacternode.cxx |    4 ++--
 svgio/source/svguno/xsvgparser.cxx          |   11 +++++------
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit f56ae6badbb1eeb53c443bedbe8e96fd36ed426c
Author:     Noel <noel.gran...@collabora.co.uk>
AuthorDate: Sat Feb 20 12:49:30 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Feb 20 17:48:01 2021 +0100

    loplugin:refcounting in svgio
    
    Change-Id: Id7669026fbe4b6cc92e2b137cba0c6c3c33f7712
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111259
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

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())
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to