diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-01-13 22:42:13 +1100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-01-15 14:30:57 +0100 |
commit | 0402f6eaa146589951cd4ad30b6d38938fc04dfe (patch) | |
tree | 83f5edb2d218a61207fa0cc76211efbd1f028883 | |
parent | b0c72cb92cab00f9e030b4d5c29e5376dcf457ac (diff) |
fdo#73536 getIdentifier cannot be used
OOXMLFastTokenHandler uses a Boost tokenmap, but tokenmaps cannot be
indexed by an integer. I've removed the #if 0 code and generate a
RuntimeException as nobody should use the functions getIdentier or
getUTF8Identifier!
Change-Id: Ia4c3589d289eac3022f0ee6aeef8662286d64f36
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx b/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx index 9b82049e04da..96adfde7d025 100644 --- a/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx @@ -70,42 +70,18 @@ OOXMLFastTokenHandler::OOXMLFastTokenHandler return nResult; } -OUString SAL_CALL OOXMLFastTokenHandler::getIdentifier(::sal_Int32 Token) +OUString SAL_CALL OOXMLFastTokenHandler::getIdentifier(::sal_Int32) throw (css::uno::RuntimeException) { - OUString sResult; - -#if 0 - //FIXME this is broken: tokenmap::wordlist is not indexed by Token! - if ( Token >= 0 || Token < OOXML_FAST_TOKENS_END ) - { - static OUString aTokens[OOXML_FAST_TOKENS_END]; - - if (aTokens[Token].getLength() == 0) - aTokens[Token] = OUString::createFromAscii - (tokenmap::wordlist[Token].name); - } -#else - (void) Token; -#endif - - return sResult; + // we use a Boost tokenmap, but tokenmaps cannot be indexed by an integer + for (;;) { std::abort(); } // avoid "must return a value" warnings } -css::uno::Sequence< ::sal_Int8 > SAL_CALL OOXMLFastTokenHandler::getUTF8Identifier(::sal_Int32 Token) +css::uno::Sequence< ::sal_Int8 > SAL_CALL OOXMLFastTokenHandler::getUTF8Identifier(::sal_Int32) throw (css::uno::RuntimeException) { -#if 0 - if ( Token < 0 || Token >= OOXML_FAST_TOKENS_END ) -#endif - return css::uno::Sequence< ::sal_Int8 >(); - -#if 0 - //FIXME this is broken: tokenmap::wordlist is not indexed by Token! - return css::uno::Sequence< ::sal_Int8 >(reinterpret_cast< const sal_Int8 *>(tokenmap::wordlist[Token].name), strlen(tokenmap::wordlist[Token].name)); -#else - (void) Token; -#endif + // we use a Boost tokenmap, but tokenmaps cannot be indexed by an integer + for (;;) { std::abort(); } // avoid "must return a value" warnings } sal_Int32 OOXMLFastTokenHandler::getTokenDirect( const char *pStr, sal_Int32 nLength ) const |