summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-19 12:47:37 +0200
committerNoel Grandin <noel@peralex.com>2013-11-19 12:49:29 +0200
commit363cc397172f2b0a94d9c4dc44fc8d95072795a3 (patch)
tree16a23a796e2db536d7af3f0144bce8fd01570e26 /vcl
parent02a2203580226766c4b3b8778430774ff76f90e9 (diff)
convert equalsAsciiL calls to startWith calls where possible
Simplify code like: aStr.equalsAsciiL( "%", 1 ) to aStr.startsWith( "%" ) Change-Id: Iee0e4e60b0ae6d567fa8f72db5d616fffbec3c00
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/generic/dtrans/X11_selection.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index bd88a6fbf4b6..fcd5e25e5985 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -167,7 +167,7 @@ rtl_TextEncoding x11::getTextPlainEncoding( const OUString& rMimeType )
rtl_TextEncoding aEncoding = RTL_TEXTENCODING_DONTKNOW;
OUString aMimeType( rMimeType.toAsciiLowerCase() );
sal_Int32 nIndex = 0;
- if( aMimeType.getToken( 0, ';', nIndex ).equalsAsciiL( "text/plain" , 10 ) )
+ if( aMimeType.getToken( 0, ';', nIndex ).startsWith( "text/plain" ) )
{
if( aMimeType.getLength() == 10 ) // only "text/plain"
aEncoding = RTL_TEXTENCODING_ISO_8859_1;
@@ -177,7 +177,7 @@ rtl_TextEncoding x11::getTextPlainEncoding( const OUString& rMimeType )
{
OUString aToken = aMimeType.getToken( 0, ';', nIndex );
sal_Int32 nPos = 0;
- if( aToken.getToken( 0, '=', nPos ).equalsAsciiL( "charset", 7 ) )
+ if( aToken.getToken( 0, '=', nPos ).startsWith( "charset" ) )
{
OString aEncToken = OUStringToOString( aToken.getToken( 0, '=', nPos ), RTL_TEXTENCODING_ISO_8859_1 );
aEncoding = rtl_getTextEncodingFromUnixCharset( aEncToken.getStr() );
@@ -1051,7 +1051,7 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ
OUStringToOString( rType, RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
#endif
- if( rType.equalsAsciiL( "text/plain;charset=utf-16", 25 ) )
+ if( rType.startsWith( "text/plain;charset=utf-16" ) )
{
// lets see if we have UTF16 else try to find something convertible
if( it->second->m_aTypes.getLength() && ! it->second->m_bHaveUTF16 )
@@ -1105,7 +1105,7 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ
}
}
}
- else if( rType.equalsAsciiL( "image/bmp", 9 ) )
+ else if( rType.startsWith( "image/bmp" ) )
{
// #i83376# try if someone has the data in image/bmp already before
// doing the PIXMAP stuff (e.g. the gimp has this)
@@ -1350,7 +1350,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor >
pFlavors->MimeType = convertTypeFromNative( *pAtoms, selection, nFormat );
pFlavors->DataType = getCppuType( (Sequence< sal_Int8 >*)0 );
sal_Int32 nIndex = 0;
- if( pFlavors->MimeType.getToken( 0, ';', nIndex ).equalsAsciiL( "text/plain", 10 ) )
+ if( pFlavors->MimeType.getToken( 0, ';', nIndex ).startsWith( "text/plain" ) )
{
OUString aToken(pFlavors->MimeType.getToken( 0, ';', nIndex ));
// omit text/plain;charset=unicode since it is not well defined