[Libreoffice-commits] core.git: include/xmloff xmloff/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 10 07:16:58 UTC 2021


 include/xmloff/xmlimp.hxx     |    2 +-
 xmloff/source/core/xmlimp.cxx |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 0ae13b5df161ec7e12477d5818c70909575c0aa7
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Mon Aug 9 18:19:17 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Aug 10 09:16:22 2021 +0200

    no need to use unique_ptr for NamespaceDefine here
    
    Change-Id: I61ac177fab102c83d72337f608dc5ca8238e7819
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120215
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index 12020802c329..f8387cc8f81c 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -136,7 +136,7 @@ private:
 
         NamespaceDefine( const OUString& rPrefix, const OUString& rNamespaceURI ) : m_aPrefix( rPrefix ), m_aNamespaceURI( rNamespaceURI ) {}
     };
-    std::vector< std::unique_ptr< NamespaceDefine > > m_aNamespaceDefines;
+    std::vector< NamespaceDefine > m_aNamespaceDefines;
 
 public:
     SvXMLImportFastNamespaceHandler();
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 48a83f7d1b9f..23e7807c7157 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -2102,8 +2102,8 @@ void SvXMLImportFastNamespaceHandler::addNSDeclAttributes( rtl::Reference < comp
 {
     for(const auto& aNamespaceDefine : m_aNamespaceDefines)
     {
-        OUString& rPrefix = aNamespaceDefine->m_aPrefix;
-        OUString& rNamespaceURI = aNamespaceDefine->m_aNamespaceURI;
+        const OUString& rPrefix = aNamespaceDefine.m_aPrefix;
+        const OUString& rNamespaceURI = aNamespaceDefine.m_aNamespaceURI;
         OUString sDecl;
         if ( rPrefix.isEmpty() )
             sDecl = "xmlns";
@@ -2119,10 +2119,10 @@ void SvXMLImportFastNamespaceHandler::registerNamespace( const OUString& rNamesp
     // Elements with default namespace parsed by FastParser have namespace prefix.
     // A default namespace needs to be registered with the prefix, to maintain the compatibility.
     if ( rNamespacePrefix.isEmpty() )
-        m_aNamespaceDefines.push_back( std::make_unique<NamespaceDefine>(
+        m_aNamespaceDefines.push_back( NamespaceDefine(
                                     SvXMLImport::getNamespacePrefixFromURI( rNamespaceURI ), rNamespaceURI) );
 
-    m_aNamespaceDefines.push_back( std::make_unique<NamespaceDefine>(
+    m_aNamespaceDefines.push_back( NamespaceDefine(
                                     rNamespacePrefix, rNamespaceURI) );
 }
 


More information about the Libreoffice-commits mailing list