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 /oox | |
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 'oox')
-rw-r--r-- | oox/source/core/filterbase.cxx | 2 | ||||
-rw-r--r-- | oox/source/dump/dumperbase.cxx | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index 30a54d85eb0e..ce6d3fd14168 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -314,7 +314,7 @@ OUString FilterBase::getAbsoluteUrl( const OUString& rUrl ) const /* (5) handle URLs relative to current drive, e.g. the URL '/path1/file1' relative to the base URL 'file:///C:/path2/file2' does not result in the expected 'file:///C:/path1/file1', but in 'file:///path1/file1'. */ - if( !aUrl.isEmpty() && (aUrl[ 0 ] == '/') && + if( aUrl.startsWith("/") && mxImpl->maFileUrl.match( aFilePrefix ) && lclIsDosDrive( mxImpl->maFileUrl, nFilePrefixLen ) ) { diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index d0dd3495140f..fc46d830d688 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -1085,7 +1085,7 @@ OUString FlagsList::implGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const if( !getFlag( mnIgnore, nMask ) ) { const OUString& rFlagName = aIt->second; - bool bOnOff = !rFlagName.isEmpty() && rFlagName[ 0 ] == ':'; + bool bOnOff = rFlagName.startsWith(":"); bool bFlag = getFlag( nKey, nMask ); if( bOnOff ) { @@ -1094,7 +1094,7 @@ OUString FlagsList::implGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const } else { - bool bNegated = !rFlagName.isEmpty() && rFlagName[ 0 ] == '!'; + bool bNegated = rFlagName.startsWith("!"); sal_Int32 nBothSep = bNegated ? rFlagName.indexOf( '!', 1 ) : -1; if( bFlag ) { @@ -1412,7 +1412,7 @@ void SharedConfigData::createUnitConverter( const OUString& rData ) if( aDataVec.size() >= 2 ) { OUString aFactor = aDataVec[ 1 ]; - bool bRecip = !aFactor.isEmpty() && aFactor[ 0 ] == '/'; + bool bRecip = aFactor.startsWith("/"); if( bRecip ) aFactor = aFactor.copy( 1 ); double fFactor; |