summaryrefslogtreecommitdiffstats
path: root/svtools/source/svhtml
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/svhtml')
-rw-r--r--svtools/source/svhtml/htmlsupp.cxx6
-rw-r--r--svtools/source/svhtml/parhtml.cxx11
2 files changed, 6 insertions, 11 deletions
diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx
index 829e8f3b2a19..f1de1c0e3313 100644
--- a/svtools/source/svhtml/htmlsupp.cxx
+++ b/svtools/source/svhtml/htmlsupp.cxx
@@ -96,8 +96,7 @@ void HTMLParser::RemoveSGMLComment( OUString &rString, sal_Bool bFull )
// remove SGML comments
- if( rString.getLength() >= 4 &&
- rString.startsWith( "<!--" ) )
+ if( rString.startsWith( "<!--" ) )
{
sal_Int32 nPos = 3;
if( bFull )
@@ -117,8 +116,7 @@ void HTMLParser::RemoveSGMLComment( OUString &rString, sal_Bool bFull )
rString = rString.copy( nPos, rString.getLength() - nPos );
}
- if( rString.getLength() >=3 &&
- rString.endsWith("-->") )
+ if( rString.endsWith("-->") )
{
rString = rString.copy( 0, rString.getLength()-3 );
if( bFull )
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index b7292594c523..dd90ac37d79b 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -907,8 +907,7 @@ int HTMLParser::_GetNextRawToken()
: aTok.compareTo(aEndToken) );
}
}
- if( bReadComment && '>'==nNextCh && aTok.getLength() >= 2 &&
- aTok.endsWith( "--" ) )
+ if( bReadComment && '>'==nNextCh && aTok.endsWith( "--" ) )
{
// End of comment of style <!----->
bReadComment = false;
@@ -1214,8 +1213,7 @@ int HTMLParser::_GetNextToken()
// generate pending HTML_<TOKEN>_OFF for HTML_<TOKEN>_ON
// Do not convert this to a single HTML_<TOKEN>_OFF
// which lead to fdo#56772.
- if ((HTML_TOKEN_ONOFF & nRet) && (aToken.getLength() >= 1) &&
- ('/' == aToken[aToken.getLength()-1]))
+ if ((HTML_TOKEN_ONOFF & nRet) && aToken.endsWith("/"))
{
mnPendingOffToken = nRet + 1; // HTML_<TOKEN>_ON -> HTML_<TOKEN>_OFF
aToken = aToken.replaceAt( aToken.getLength()-1, 1, ""); // remove trailing '/'
@@ -1275,8 +1273,7 @@ int HTMLParser::_GetNextToken()
// Read until closing %>. If not found restart at first >.
while( !bDone && !rInput.IsEof() && IsParserWorking() )
{
- bDone = '>'==nNextCh && aToken.getLength() >= 1 &&
- '%' == aToken[ aToken.getLength()-1 ];
+ bDone = '>'==nNextCh && aToken.endsWith("%");
if( !bDone )
{
aToken += OUString(nNextCh);
@@ -2127,7 +2124,7 @@ bool HTMLParser::ParseMetaOptionsImpl(
if ( bHTTPEquiv && i_pHTTPHeader )
{
// Netscape seems to just ignore a closing ", so we do too
- if ( !aContent.isEmpty() && '"' == aContent[ aContent.getLength()-1 ] )
+ if ( aContent.endsWith("\"") )
{
aContent = aContent.copy( 0, aContent.getLength() - 1 );
}