include/xmloff/fasttokenhandler.hxx | 8 ++++---- xmloff/source/core/fasttokenhandler.cxx | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
New commits: commit d5ffeddff2a241c2cbbf1e3a03e41aee47307f87 Author: Tor Lillqvist <t...@collabora.com> Date: Wed Aug 17 09:56:52 2016 +0300 loplugin:staticmethods Change-Id: I84fe6603010defcfae32250c86e75cf2237f64a1 diff --git a/include/xmloff/fasttokenhandler.hxx b/include/xmloff/fasttokenhandler.hxx index 9cda5e3..991318e 100644 --- a/include/xmloff/fasttokenhandler.hxx +++ b/include/xmloff/fasttokenhandler.hxx @@ -27,7 +27,7 @@ public: ~TokenMap(); /** Returns the token identifier for the passed Unicode token name. */ - sal_Int32 getTokenFromUnicode( const OUString& rUnicodeName ) const; + static sal_Int32 getTokenFromUnicode( const OUString& rUnicodeName ); /** Returns the UTF8 name of the passed token identifier as byte sequence. */ css::uno::Sequence< sal_Int8 > getUtf8TokenName( sal_Int32 nToken ) const @@ -39,20 +39,20 @@ public: } /** Returns the token identifier for the passed UTF8 token name. */ - sal_Int32 getTokenFromUtf8( const css::uno::Sequence< sal_Int8 >& rUtf8Name ) const + static sal_Int32 getTokenFromUtf8( const css::uno::Sequence< sal_Int8 >& rUtf8Name ) { return getTokenFromUTF8( reinterpret_cast< const char* >( rUtf8Name.getConstArray() ), rUtf8Name.getLength() ); } /** Returns the token identifier for a UTF8 string passed in pToken */ - sal_Int32 getTokenFromUTF8( const char *pToken, sal_Int32 nLength ) const + static sal_Int32 getTokenFromUTF8( const char *pToken, sal_Int32 nLength ) { return getTokenPerfectHash( pToken, nLength ); } private: - sal_Int32 getTokenPerfectHash( const char *pToken, sal_Int32 nLength ) const; + static sal_Int32 getTokenPerfectHash( const char *pToken, sal_Int32 nLength ); std::vector< css::uno::Sequence< sal_Int8 > > maTokenNames; }; diff --git a/xmloff/source/core/fasttokenhandler.cxx b/xmloff/source/core/fasttokenhandler.cxx index 722584c..9e2b45f 100644 --- a/xmloff/source/core/fasttokenhandler.cxx +++ b/xmloff/source/core/fasttokenhandler.cxx @@ -55,14 +55,14 @@ TokenMap::~TokenMap() { } -sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const +sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) { OString aUtf8Name = OUStringToOString( rUnicodeName, RTL_TEXTENCODING_UTF8 ); const struct xmltoken* pToken = Perfect_Hash::in_word_set( aUtf8Name.getStr(), aUtf8Name.getLength() ); return pToken ? pToken->nToken : XML_TOKEN_INVALID; } -sal_Int32 TokenMap::getTokenPerfectHash( const char *pStr, sal_Int32 nLength ) const +sal_Int32 TokenMap::getTokenPerfectHash( const char *pStr, sal_Int32 nLength ) { const struct xmltoken *pToken = Perfect_Hash::in_word_set( pStr, nLength ); return pToken ? pToken->nToken : XML_TOKEN_INVALID; @@ -87,13 +87,13 @@ uno::Sequence< sal_Int8 > FastTokenHandler::getUTF8Identifier( sal_Int32 nToken sal_Int32 FastTokenHandler::getTokenFromUTF8( const uno::Sequence< sal_Int8 >& rIdentifier ) throw (uno::RuntimeException, std::exception) { - return mrTokenMap.getTokenFromUtf8( rIdentifier ); + return TokenMap::getTokenFromUtf8( rIdentifier ); } // Much faster direct C++ shortcut sal_Int32 FastTokenHandler::getTokenDirect( const char* pToken, sal_Int32 nLength ) const { - return mrTokenMap.getTokenFromUTF8( pToken, nLength ); + return TokenMap::getTokenFromUTF8( pToken, nLength ); } } // namespace token _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits