diff options
author | David Ostrovsky <david@ostrovsky.org> | 2014-09-20 16:48:56 +0200 |
---|---|---|
committer | David Ostrovsky <David.Ostrovsky@gmx.de> | 2014-09-23 06:08:18 +0000 |
commit | 0ea9722f72c1bece218013cce4c5d9097994408f (patch) | |
tree | 0f4fa80a35cada41ca0232206595a88216fde934 /oox/source/token | |
parent | b529efc45962cd451198df273f41fc69f16ac1a6 (diff) |
fdo#84090: Remove maUniName from oox::TokenMap
Change-Id: I8165def0b6291bfd7bb109e1cdaeb4198ed696b7
Reviewed-on: https://gerrit.libreoffice.org/11560
Reviewed-by: David Ostrovsky <David.Ostrovsky@gmx.de>
Tested-by: David Ostrovsky <David.Ostrovsky@gmx.de>
Diffstat (limited to 'oox/source/token')
-rw-r--r-- | oox/source/token/tokenmap.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/oox/source/token/tokenmap.cxx b/oox/source/token/tokenmap.cxx index 327dab0c9af6..79969df70636 100644 --- a/oox/source/token/tokenmap.cxx +++ b/oox/source/token/tokenmap.cxx @@ -58,8 +58,7 @@ TokenMap::TokenMap() : for( TokenNameVector::iterator aIt = maTokenNames.begin(), aEnd = maTokenNames.end(); aIt != aEnd; ++aIt, ++ppcTokenName ) { OString aUtf8Token( *ppcTokenName ); - aIt->maUniName = OStringToOUString( aUtf8Token, RTL_TEXTENCODING_UTF8 ); - aIt->maUtf8Name = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aUtf8Token.getStr() ), aUtf8Token.getLength() ); + *aIt = Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aUtf8Token.getStr() ), aUtf8Token.getLength() ); } for (unsigned char c = 'a'; c <= 'z'; c++) @@ -76,9 +75,14 @@ TokenMap::~TokenMap() OUString TokenMap::getUnicodeTokenName( sal_Int32 nToken ) const { - if( (0 <= nToken) && (static_cast< size_t >( nToken ) < maTokenNames.size()) ) - return maTokenNames[ static_cast< size_t >( nToken ) ].maUniName; - return OUString(); + Sequence< sal_Int8 > rUtf8Name = getUtf8TokenName(nToken); + if (rUtf8Name.getLength() == 0) + return OUString(); + + return OUString(reinterpret_cast< const char * >( + rUtf8Name.getConstArray() ), + rUtf8Name.getLength(), + RTL_TEXTENCODING_UTF8); } sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const @@ -91,7 +95,7 @@ sal_Int32 TokenMap::getTokenFromUnicode( const OUString& rUnicodeName ) const Sequence< sal_Int8 > TokenMap::getUtf8TokenName( sal_Int32 nToken ) const { if( (0 <= nToken) && (static_cast< size_t >( nToken ) < maTokenNames.size()) ) - return maTokenNames[ static_cast< size_t >( nToken ) ].maUtf8Name; + return maTokenNames[ static_cast< size_t >( nToken ) ]; return Sequence< sal_Int8 >(); } |