diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-16 16:57:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 13:31:57 +0200 |
commit | 60bc26354763fa3461db49a3e827da552484150d (patch) | |
tree | 5c66cee43f76f556f9a086a67fa8a6e88750c5d5 /xmlscript | |
parent | 7867e1f1cdd726cb98a236245e3d08557cc3a313 (diff) |
new loplugin:conststringfield
Look for const string fields which can be static, and
mostly convert them to OUStringLiteral
And add a getLength() method to OUStringLiteral to make
the transition easier.
Remove dead code in XclExpRoot::GenerateDefaultEncryptionData,
default password is never empty.
Change-Id: Iae75514d9dbb87289fd5b016222f640abe755091
Reviewed-on: https://gerrit.libreoffice.org/59204
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlscript')
-rw-r--r-- | xmlscript/source/xml_helper/xml_impctx.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx b/xmlscript/source/xml_helper/xml_impctx.cxx index 47d8a544b4e6..0ad0d17b8467 100644 --- a/xmlscript/source/xml_helper/xml_impctx.cxx +++ b/xmlscript/source/xml_helper/xml_impctx.cxx @@ -105,9 +105,6 @@ class DocumentHandlerImpl : t_OUString2LongMap m_URI2Uid; sal_Int32 m_uid_count; - OUString const m_sXMLNS_PREFIX_UNKNOWN; - OUString const m_sXMLNS; - sal_Int32 m_nLastURI_lookup; OUString m_aLastURI_lookup; @@ -169,13 +166,15 @@ public: virtual OUString SAL_CALL getUriByUid( sal_Int32 Uid ) override; }; +static OUString const g_sXMLNS_PREFIX_UNKNOWN( "<<< unknown prefix >>>" ); +static OUString const g_sXMLNS( "xmlns" ); + + DocumentHandlerImpl::DocumentHandlerImpl( Reference< xml::input::XRoot > const & xRoot, bool bSingleThreadedUse ) : m_xRoot( xRoot ), m_uid_count( 0 ), - m_sXMLNS_PREFIX_UNKNOWN( "<<< unknown prefix >>>" ), - m_sXMLNS( "xmlns" ), m_nLastURI_lookup( UID_UNKNOWN ), m_aLastURI_lookup( "<<< unknown URI >>>" ), m_nLastPrefix_lookup( UID_UNKNOWN ), @@ -240,7 +239,7 @@ inline sal_Int32 DocumentHandlerImpl::getUidByPrefix( else { m_nLastPrefix_lookup = UID_UNKNOWN; - m_aLastPrefix_lookup = m_sXMLNS_PREFIX_UNKNOWN; + m_aLastPrefix_lookup = g_sXMLNS_PREFIX_UNKNOWN; } } return m_nLastPrefix_lookup; @@ -286,7 +285,7 @@ inline void DocumentHandlerImpl::popPrefix( } m_nLastPrefix_lookup = UID_UNKNOWN; - m_aLastPrefix_lookup = m_sXMLNS_PREFIX_UNKNOWN; + m_aLastPrefix_lookup = g_sXMLNS_PREFIX_UNKNOWN; } inline void DocumentHandlerImpl::getElementName( @@ -458,7 +457,7 @@ void DocumentHandlerImpl::startElement( pQNames[ nPos ] = xAttribs->getNameByIndex( nPos ); OUString const & rQAttributeName = pQNames[ nPos ]; - if (rQAttributeName.startsWith( m_sXMLNS )) + if (rQAttributeName.startsWith( g_sXMLNS )) { if (rQAttributeName.getLength() == 5) // set default namespace { @@ -468,7 +467,7 @@ void DocumentHandlerImpl::startElement( xAttribs->getValueByIndex( nPos ) ); elementEntry->m_prefixes.push_back( aDefNamespacePrefix ); pUids[ nPos ] = UID_UNKNOWN; - pPrefixes[ nPos ] = m_sXMLNS; + pPrefixes[ nPos ] = g_sXMLNS; pLocalNames[ nPos ] = aDefNamespacePrefix; } else if (':' == rQAttributeName[ 5 ]) // set prefix @@ -477,7 +476,7 @@ void DocumentHandlerImpl::startElement( pushPrefix( aPrefix, xAttribs->getValueByIndex( nPos ) ); elementEntry->m_prefixes.push_back( aPrefix ); pUids[ nPos ] = UID_UNKNOWN; - pPrefixes[ nPos ] = m_sXMLNS; + pPrefixes[ nPos ] = g_sXMLNS; pLocalNames[ nPos ] = aPrefix; } // else just a name starting with xmlns, but no prefix |