diff options
-rw-r--r-- | include/xmloff/fasttokenhandler.hxx | 8 | ||||
-rw-r--r-- | xmloff/source/core/fasttokenhandler.cxx | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/xmloff/fasttokenhandler.hxx b/include/xmloff/fasttokenhandler.hxx index 9cda5e3f8b6f..991318eded7a 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 722584cd4a5e..9e2b45fcbe10 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 |