summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-10-03 20:45:04 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-10-23 14:30:29 +0200
commit143bbb20a3f4d757e2493fc078deea7dbaa1e14f (patch)
treece78beac6e9d23c8cf2a5602302ceb969e5a9409
parentd958e6d04983eb395b13b0d72aae5af550f9db9f (diff)
inline TokenMap::getUtf8TokenName
Change-Id: Icd9c6ebc9feb3e7aba28b01729b582a8f49c832a
-rw-r--r--include/oox/token/tokenmap.hxx9
-rw-r--r--oox/source/token/tokenmap.cxx7
2 files changed, 8 insertions, 8 deletions
diff --git a/include/oox/token/tokenmap.hxx b/include/oox/token/tokenmap.hxx
index 6298773df921..50984e753527 100644
--- a/include/oox/token/tokenmap.hxx
+++ b/include/oox/token/tokenmap.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_OOX_TOKEN_TOKENMAP_HXX
#include <vector>
+#include <oox/token/tokens.hxx>
#include <rtl/instance.hxx>
#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -40,7 +41,13 @@ public:
/** Returns the UTF8 name of the passed token identifier as byte sequence. */
::com::sun::star::uno::Sequence< sal_Int8 >
- getUtf8TokenName( sal_Int32 nToken ) const;
+ getUtf8TokenName( sal_Int32 nToken ) const
+ {
+ SAL_WARN_IF(nToken < 0 || nToken >= XML_TOKEN_COUNT, "oox", "Wrong nToken parameter");
+ if (0 <= nToken && nToken < XML_TOKEN_COUNT)
+ return maTokenNames[ nToken ];
+ return css::uno::Sequence< sal_Int8 >();
+ }
/** Returns the token identifier for the passed UTF8 token name. */
sal_Int32 getTokenFromUtf8(
diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx
index dcd7284b7516..318aee40538b 100644
--- a/oox/source/token/tokenmap.cxx
+++ b/oox/source/token/tokenmap.cxx
@@ -80,13 +80,6 @@ sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const
return pToken ? pToken->nToken : XML_TOKEN_INVALID;
}
-Sequence< sal_Int8 > TokenMap::getUtf8TokenName( sal_Int32 nToken ) const
-{
- if( (0 <= nToken) && (static_cast< size_t >( nToken ) < XML_TOKEN_COUNT) )
- return maTokenNames[ static_cast< size_t >( nToken ) ];
- return Sequence< sal_Int8 >();
-}
-
sal_Int32 TokenMap::getTokenPerfectHash( const char *pStr, sal_Int32 nLength ) const
{
const struct xmltoken* pToken = Perfect_Hash::in_word_set( pStr, nLength );