diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-06-26 14:05:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-06-26 18:09:07 +0200 |
commit | f7aad844aab5fe424afd71b71133c74d473c5030 (patch) | |
tree | 4baa5194177cfd65a22684cd358a3962bc7e7659 /framework | |
parent | c8a040faa218959c23adaac1e0dbe9d679a0bd9e (diff) |
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@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/xml/xmlnamespaces.hxx | 5 | ||||
-rw-r--r-- | framework/source/fwe/xml/xmlnamespaces.cxx | 20 |
2 files changed, 3 insertions, 22 deletions
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(); |