From dbf87d2124a0c01014b9e839804455d3be38831f Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 16 Sep 2016 14:26:50 +0200 Subject: coverity#1372990 xmloff: use unique_ptr for RewindMaps Change-Id: I51e67607d94a465ce39e822f01a0c60efbf1a0f0 --- include/xmloff/xmlictxt.hxx | 6 +++--- include/xmloff/xmlimp.hxx | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx index 6e064e293a68..6d2411219d6b 100644 --- a/include/xmloff/xmlictxt.hxx +++ b/include/xmloff/xmlictxt.hxx @@ -43,10 +43,10 @@ class XMLOFF_DLLPUBLIC SvXMLImportContext : public ::cppu::WeakImplHelper1< ::cs sal_uInt16 mnPrefix; OUString maLocalName; - std::unique_ptr mxRewindMap; + std::unique_ptr m_pRewindMap; - SAL_DLLPRIVATE SvXMLNamespaceMap *TakeRewindMap() { return mxRewindMap.release(); } - SAL_DLLPRIVATE void PutRewindMap( SvXMLNamespaceMap *p ) { mxRewindMap.reset(p); } + SAL_DLLPRIVATE std::unique_ptr TakeRewindMap() { return std::move(m_pRewindMap); } + SAL_DLLPRIVATE void PutRewindMap(std::unique_ptr p) { m_pRewindMap = std::move(p); } protected: diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index cc54fe1b9aeb..87634e742455 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -175,7 +175,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper8< std::unique_ptr mpImpl; // dummy - SvXMLNamespaceMap *mpNamespaceMap; + std::unique_ptr mpNamespaceMap; std::unique_ptr mpUnitConv; SvXMLImportContexts_Impl maContexts; FastSvXMLImportContexts_Impl maFastContexts; @@ -200,7 +200,8 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper8< const OUString getNamespacePrefixFromToken( sal_Int32 nToken ); void registerNamespaces(); void registerNSHelper(sal_Int32 nToken, sal_Int32 nPrefix, sal_Int32 nNamespace ); - SvXMLNamespaceMap* processNSAttributes(const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); + std::unique_ptr processNSAttributes( + const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList); void Characters(const OUString& aChars); protected: -- cgit