Bug 36390 <title /> breaks html filter fixed

This commit is contained in:
Christina Rossmanith 2011-04-23 22:25:26 +02:00
parent 1f967b487f
commit 11cbcb8b08

View file

@ -372,7 +372,7 @@ int HTMLParser::FilterToken( int nToken )
{ {
case sal_Unicode(EOF): case sal_Unicode(EOF):
nToken = 0; nToken = 0;
break; // nicht verschicken break; // don't pass
case HTML_HEAD_OFF: case HTML_HEAD_OFF:
bIsInBody = sal_True; bIsInBody = sal_True;
@ -393,7 +393,7 @@ int HTMLParser::FilterToken( int nToken )
case HTML_HTML_OFF: case HTML_HTML_OFF:
nToken = 0; nToken = 0;
bReadPRE = bReadListing = bReadXMP = sal_False; bReadPRE = bReadListing = bReadXMP = sal_False;
break; // HTML_ON wurde auch nicht verschickt ! break; // HTML_ON hasn't been passed either !
case HTML_PREFORMTXT_ON: case HTML_PREFORMTXT_ON:
StartPRE(); StartPRE();
@ -1223,12 +1223,10 @@ int HTMLParser::_GetNextToken()
{ {
ScanText( '>' ); ScanText( '>' );
// fdo#34666: closing "/>"?: // fdo#34666 fdo#36080 fdo#36390: closing "/>"?:
// return HTML_UNKNOWNCONTROL_OFF instead of // return HTML_<TOKEN>_OFF instead of HTML_<TOKEN>_ON
// HTML_UNKNOWNCONTROL_ON
if (aToken.Len() >= 1 && '/' == aToken.GetChar(aToken.Len()-1)) { if (aToken.Len() >= 1 && '/' == aToken.GetChar(aToken.Len()-1)) {
if (HTML_UNKNOWNCONTROL_ON == nRet) nRet += 1; // HTML_<TOKEN>_ON -> HTML_<TOKEN>_OFF;
nRet = HTML_UNKNOWNCONTROL_OFF;
} }
if( sal_Unicode(EOF) == nNextCh && rInput.IsEof() ) if( sal_Unicode(EOF) == nNextCh && rInput.IsEof() )
{ {
@ -1351,7 +1349,6 @@ int HTMLParser::_GetNextToken()
bReadStyle = sal_False; bReadStyle = sal_False;
break; break;
} }
} }
} }
break; break;
@ -1648,7 +1645,7 @@ int HTMLParser::FilterPRE( int nToken )
{ {
xub_StrLen nSpaces = sal::static_int_cast< xub_StrLen >( xub_StrLen nSpaces = sal::static_int_cast< xub_StrLen >(
8 - (nPre_LinePos % 8)); 8 - (nPre_LinePos % 8));
DBG_ASSERT( !aToken.Len(), "Wieso ist das Token nicht leer?" ); DBG_ASSERT( !aToken.Len(), "Why is the token not empty?" );
aToken.Expand( nSpaces, ' ' ); aToken.Expand( nSpaces, ' ' );
nPre_LinePos += nSpaces; nPre_LinePos += nSpaces;
nToken = HTML_TEXTTOKEN; nToken = HTML_TEXTTOKEN;