[Libreoffice-commits] core.git: svgio/inc svgio/source
Noel (via logerrit)
logerrit at kemper.freedesktop.org
Sat Feb 20 16:48:52 UTC 2021
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.grandin at collabora.co.uk>
AuthorDate: Sat Feb 20 12:49:30 2021 +0200
Commit: Noel Grandin <noel.grandin at 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.grandin at 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())
More information about the Libreoffice-commits
mailing list