[Libreoffice-commits] core.git: framework/inc framework/source

Stephan Bergmann sbergman at redhat.com
Tue Jun 26 16:09:30 UTC 2018


 framework/inc/xml/xmlnamespaces.hxx        |    5 -----
 framework/source/fwe/xml/xmlnamespaces.cxx |   20 +++-----------------
 2 files changed, 3 insertions(+), 22 deletions(-)

New commits:
commit f7aad844aab5fe424afd71b71133c74d473c5030
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 26 14:05:24 2018 +0200

    Clean up XMLNamespaces
    
    ...so that it no longer has a m_aXMLAttributeNamespace member that the user-
    provided copy ctor did not copy.  (Which was presumably by accident, but appears
    to not have had bad consequences due to how XMLNamespaces::adNamespace is only
    called before the copy ctor is called in SaxNamespaceFilter::startElement,
    framework/source/fwe/xml/saxnamespacefilter.cxx).
    
    Found by new -Wdeprecated-copy of GCC trunk towards GCC 9.
    
    Change-Id: I0701ecdfbef9c078a09ed411f4d9ccd166271aae
    Reviewed-on: https://gerrit.libreoffice.org/56469
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/framework/inc/xml/xmlnamespaces.hxx b/framework/inc/xml/xmlnamespaces.hxx
index f8e1369bad8a..0343f42ce6c4 100644
--- a/framework/inc/xml/xmlnamespaces.hxx
+++ b/framework/inc/xml/xmlnamespaces.hxx
@@ -31,10 +31,6 @@ namespace framework
 class FWE_DLLPUBLIC XMLNamespaces final
 {
     public:
-        XMLNamespaces();
-        XMLNamespaces( const XMLNamespaces& );
-        ~XMLNamespaces();
-
         /// @throws css::xml::sax::SAXException
         void addNamespace( const OUString& aName, const OUString& aValue );
 
@@ -50,7 +46,6 @@ class FWE_DLLPUBLIC XMLNamespaces final
         OUString const & getNamespaceValue( const OUString& aNamespace ) const;
 
         OUString        m_aDefaultNamespace;
-        OUString        m_aXMLAttributeNamespace;
         NamespaceMap    m_aNamespaceMap;
 };
 
diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx b/framework/source/fwe/xml/xmlnamespaces.cxx
index 94a97eaa1f03..d56f92d4ca6a 100644
--- a/framework/source/fwe/xml/xmlnamespaces.cxx
+++ b/framework/source/fwe/xml/xmlnamespaces.cxx
@@ -25,30 +25,16 @@ using namespace ::com::sun::star::uno;
 namespace framework
 {
 
-XMLNamespaces::XMLNamespaces()
-    : m_aXMLAttributeNamespace( "xmlns" )
-{
-}
-
-XMLNamespaces::XMLNamespaces( const XMLNamespaces& aXMLNamespaces )
-{
-    m_aDefaultNamespace = aXMLNamespaces.m_aDefaultNamespace;
-    m_aNamespaceMap = aXMLNamespaces.m_aNamespaceMap;
-}
-
-XMLNamespaces::~XMLNamespaces()
-{
-}
-
 void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue )
 {
     NamespaceMap::iterator p;
     OUString aNamespaceName( aName );
-    sal_Int32 nXMLNamespaceLength = m_aXMLAttributeNamespace.getLength();
 
     // delete preceding "xmlns"
-    if ( aNamespaceName.startsWith( m_aXMLAttributeNamespace ) )
+    constexpr char aXMLAttributeNamespace[] = "xmlns";
+    if ( aNamespaceName.startsWith( aXMLAttributeNamespace ) )
     {
+        constexpr sal_Int32 nXMLNamespaceLength = RTL_CONSTASCII_LENGTH(aXMLAttributeNamespace);
         if ( aNamespaceName.getLength() == nXMLNamespaceLength )
         {
             aNamespaceName.clear();


More information about the Libreoffice-commits mailing list