diff options
author | Noel Grandin <noel@peralex.com> | 2013-12-10 08:31:13 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-12-12 13:15:24 +0200 |
commit | fb847101519ad74c02183672c04ebf1d700aae83 (patch) | |
tree | fa391cb75ed11817804bb4b9fbafa7ee265b8dbe /editeng | |
parent | 1957303363ea9bd308b5781da09beaa09df7420c (diff) |
simplify - use OUString::startsWith where possible
Convert code like
if( !aStr.isEmpty() && aStr[0] == 'x' )
to
if( aStr.startsWith("x") )
Change-Id: Iabc3a44ed3be2d29eed876e0eeef212ccd271edf
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/eehtml.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index b945521e8cff..f09f9fde687f 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -190,8 +190,7 @@ void EditHTMLParser::NextToken( int nToken ) StartPara( false ); OUString aText = aToken; - if ( !aText.isEmpty() && ( aText[ 0 ] == ' ' ) - && ThrowAwayBlank() && !IsReadPRE() ) + if ( aText.startsWith(" ") && ThrowAwayBlank() && !IsReadPRE() ) aText = aText.copy( 1 ); if ( pCurAnchor ) @@ -784,7 +783,7 @@ void EditHTMLParser::AnchorStart() if ( !aRef.isEmpty() ) { OUString aURL = aRef; - if ( !aURL.isEmpty() && ( aURL[ 0 ] != '#' ) ) + if ( aURL.startsWith("#") ) { INetURLObject aTargetURL; INetURLObject aRootURL( aBaseURL ); |