writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx | 36 +++----------------- 1 file changed, 6 insertions(+), 30 deletions(-)
New commits: commit 0402f6eaa146589951cd4ad30b6d38938fc04dfe Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Mon Jan 13 22:42:13 2014 +1100 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 <sberg...@redhat.com> diff --git a/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx b/writerfilter/source/ooxml/OOXMLFastTokenHandler.cxx index 9b82049..96adfde 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits