Kaydet (Commit) 0402f6ea authored tarafından Chris Sherlock's avatar Chris Sherlock Kaydeden (comit) Stephan Bergmann

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: 's avatarStephan Bergmann <sbergman@redhat.com>
üst b0c72cb9
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment