[Libreoffice-commits] core.git: reportdesign/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 28 08:07:41 UTC 2019


 reportdesign/source/filter/xml/xmlHelper.cxx                |    8 ++++----
 reportdesign/source/filter/xml/xmlHelper.hxx                |    4 ++--
 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx |    2 +-
 reportdesign/source/filter/xml/xmlfilter.cxx                |    4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 03a1ac657a317b2b5b93323eac94da6784aa4504
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Mar 27 11:24:28 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Mar 28 09:07:15 2019 +0100

    return unique_ptr in OXMLHelper
    
    Change-Id: Iad6e51ef1b7b8d4ab1227b89f77a3d72d3424bcd
    Reviewed-on: https://gerrit.libreoffice.org/69857
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx
index aa20dc3b1c23..313ee4dd445e 100644
--- a/reportdesign/source/filter/xml/xmlHelper.cxx
+++ b/reportdesign/source/filter/xml/xmlHelper.cxx
@@ -332,7 +332,7 @@ uno::Reference<beans::XPropertySet> OXMLHelper::createBorderPropertySet()
     return comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(pMap));
 }
 
-SvXMLTokenMap* OXMLHelper::GetReportElemTokenMap()
+std::unique_ptr<SvXMLTokenMap> OXMLHelper::GetReportElemTokenMap()
 {
     static const SvXMLTokenMapEntry aElemTokenMap[]=
     {
@@ -357,10 +357,10 @@ SvXMLTokenMap* OXMLHelper::GetReportElemTokenMap()
         { XML_NAMESPACE_OFFICE, XML_BODY,                       XML_TOK_SUB_BODY },
         XML_TOKEN_MAP_END
     };
-    return new SvXMLTokenMap( aElemTokenMap );
+    return std::make_unique<SvXMLTokenMap>( aElemTokenMap );
 }
 
-SvXMLTokenMap* OXMLHelper::GetSubDocumentElemTokenMap()
+std::unique_ptr<SvXMLTokenMap> OXMLHelper::GetSubDocumentElemTokenMap()
 {
     static const SvXMLTokenMapEntry aElemTokenMap[]=
     {
@@ -369,7 +369,7 @@ SvXMLTokenMap* OXMLHelper::GetSubDocumentElemTokenMap()
         { XML_NAMESPACE_REPORT, XML_DETAIL,                 XML_TOK_SUB_DETAIL},
         XML_TOKEN_MAP_END
     };
-    return new SvXMLTokenMap( aElemTokenMap );
+    return std::make_unique<SvXMLTokenMap>( aElemTokenMap );
 }
 
 const SvXMLEnumMapEntry<sal_Int16>* OXMLHelper::GetImageScaleOptions()
diff --git a/reportdesign/source/filter/xml/xmlHelper.hxx b/reportdesign/source/filter/xml/xmlHelper.hxx
index f784891eff04..b23ebbdd4d65 100644
--- a/reportdesign/source/filter/xml/xmlHelper.hxx
+++ b/reportdesign/source/filter/xml/xmlHelper.hxx
@@ -63,8 +63,8 @@ namespace rptxml
         static void copyStyleElements(const bool _bOld,const OUString& _sStyleName,const SvXMLStylesContext* _pAutoStyles,const css::uno::Reference< css::beans::XPropertySet>& _xProp);
         static css::uno::Reference< css::beans::XPropertySet> createBorderPropertySet();
 
-        static SvXMLTokenMap* GetReportElemTokenMap();
-        static SvXMLTokenMap* GetSubDocumentElemTokenMap();
+        static std::unique_ptr<SvXMLTokenMap> GetReportElemTokenMap();
+        static std::unique_ptr<SvXMLTokenMap> GetSubDocumentElemTokenMap();
 
     };
 
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index 63b8b2f94133..f023f288ca2a 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -372,7 +372,7 @@ void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any >
     // set ourself as delegator
     m_xProxy->setDelegator( *this );
 
-    m_pReportElemTokenMap.reset(OXMLHelper::GetReportElemTokenMap());
+    m_pReportElemTokenMap = OXMLHelper::GetReportElemTokenMap();
 }
 
 uno::Any SAL_CALL ImportDocumentHandler::queryInterface( const uno::Type& _rType )
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
index 1f54bf8f66c8..3240c017d007 100644
--- a/reportdesign/source/filter/xml/xmlfilter.cxx
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -810,14 +810,14 @@ const SvXMLTokenMap& ORptFilter::GetDocContentElemTokenMap() const
 const SvXMLTokenMap& ORptFilter::GetReportElemTokenMap() const
 {
     if (!m_pReportElemTokenMap)
-        m_pReportElemTokenMap.reset(OXMLHelper::GetReportElemTokenMap());
+        m_pReportElemTokenMap = OXMLHelper::GetReportElemTokenMap();
     return *m_pReportElemTokenMap;
 }
 
 const SvXMLTokenMap& ORptFilter::GetSubDocumentElemTokenMap() const
 {
     if (!m_pSubDocumentElemTokenMap)
-        m_pSubDocumentElemTokenMap.reset(OXMLHelper::GetSubDocumentElemTokenMap());
+        m_pSubDocumentElemTokenMap = OXMLHelper::GetSubDocumentElemTokenMap();
     return *m_pSubDocumentElemTokenMap;
 }
 


More information about the Libreoffice-commits mailing list