summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-05 14:39:55 +0200
committerNoel Grandin <noel@peralex.com>2013-11-11 12:58:13 +0200
commitfcd1637d5101b9142e6808edfb77b01122857901 (patch)
tree5fd09f97de80cf2a9481bd55a798015db35f1d0c /vcl
parentconvert OUString !compareToAscii to equalsAscii (diff)
downloadcore-fcd1637d5101b9142e6808edfb77b01122857901.tar.gz
core-fcd1637d5101b9142e6808edfb77b01122857901.zip
convert OUString compareToAscii == 0 to equalsAscii
Convert code like aStr.compareToAscii("XXX") == 0 to aStr.equalsAscii("XXX") which is both easier to read and faster. Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/generic/dtrans/X11_selection.cxx10
-rw-r--r--vcl/unx/generic/printer/printerinfomanager.cxx2
2 files changed, 6 insertions, 6 deletions
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index 9b9ac19cda6c..bd88a6fbf4b6 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -627,9 +627,9 @@ bool SelectionManager::convertData(
aFlavor.MimeType = convertTypeFromNative( nType, nSelection, rFormat );
sal_Int32 nIndex = 0;
- if( aFlavor.MimeType.getToken( 0, ';', nIndex ).compareToAscii( "text/plain" ) == 0 )
+ if( aFlavor.MimeType.getToken( 0, ';', nIndex ).equalsAscii( "text/plain" ) )
{
- if( aFlavor.MimeType.getToken( 0, ';', nIndex ).compareToAscii( "charset=utf-16" ) == 0 )
+ if( aFlavor.MimeType.getToken( 0, ';', nIndex ).equalsAscii( "charset=utf-16" ) )
aFlavor.DataType = getCppuType( (OUString *) 0 );
else
aFlavor.DataType = getCppuType( (Sequence< sal_Int8 >*)0 );
@@ -1354,18 +1354,18 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor >
{
OUString aToken(pFlavors->MimeType.getToken( 0, ';', nIndex ));
// omit text/plain;charset=unicode since it is not well defined
- if( aToken.compareToAscii( "charset=unicode" ) == 0 )
+ if( aToken.equalsAscii( "charset=unicode" ) )
{
pAtoms++;
continue;
}
bHaveText = true;
- if( aToken.compareToAscii( "charset=utf-16" ) == 0 )
+ if( aToken.equalsAscii( "charset=utf-16" ) )
{
bHaveUTF16 = true;
pFlavors->DataType = getCppuType( (OUString*)0 );
}
- else if( aToken.compareToAscii( "charset=utf-8" ) == 0 )
+ else if( aToken.equalsAscii( "charset=utf-8" ) )
{
aUTF8Type = *pAtoms;
}
diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx
index 539f64f1de04..be3359836b3c 100644
--- a/vcl/unx/generic/printer/printerinfomanager.cxx
+++ b/vcl/unx/generic/printer/printerinfomanager.cxx
@@ -714,7 +714,7 @@ bool PrinterInfoManager::writePrinterConfig()
while( nIndex != -1 && ! bAutoQueue )
{
OUString aToken( it->second.m_aInfo.m_aFeatures.getToken( 0, ',', nIndex ) );
- if( !aToken.isEmpty() && aToken.compareToAscii( "autoqueue" ) == 0 )
+ if( aToken.equalsAscii( "autoqueue" ) )
bAutoQueue = true;
}
if( bAutoQueue )