Kaydet (Commit) f8b22654 authored tarafından Noel Grandin's avatar Noel Grandin

remove RTL_CONSTASCII_STRINGPARAM in OUString::matchAsciiL calls

Convert code like:
    defaultValue.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "nextval(" ) );
to:
    defaultValue.startsWith( "nextval(" );

Change-Id: I77bdcbf46bec6ded3c16a8248634b1424a1eb4f0
üst 9cb0fc78
...@@ -319,9 +319,9 @@ namespace connectivity ...@@ -319,9 +319,9 @@ namespace connectivity
{ {
Sequence< PropertyValue > info; Sequence< PropertyValue > info;
sal_Bool bOK = url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:odbc:" ) ) sal_Bool bOK = url.startsWith( "sdbc:mysql:odbc:" )
|| url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:jdbc:" ) ) || url.startsWith( "sdbc:mysql:jdbc:" )
|| ( url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:mysqlc:" ) ) || ( url.startsWith( "sdbc:mysql:mysqlc:" )
&& loadDriver( url, info ).is() && loadDriver( url, info ).is()
); );
return bOK; return bOK;
......
...@@ -1235,16 +1235,16 @@ struct SortInternalSchemasLastAndPublicFirst ...@@ -1235,16 +1235,16 @@ struct SortInternalSchemasLastAndPublicFirst
{ {
ret = false; ret = false;
} }
else if( valueA.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "pg_" ) ) && else if( valueA.startsWith( "pg_" ) &&
valueB.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "pg_" ) ) ) valueB.startsWith( "pg_" ) )
{ {
ret = valueA.compareTo( valueB ) < 0; // sorts equal ! ret = valueA.compareTo( valueB ) < 0; // sorts equal !
} }
else if( valueA.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "pg_" ) )) else if( valueA.startsWith( "pg_" ))
{ {
ret = false; // sorts last ! ret = false; // sorts last !
} }
else if( valueB.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "pg_" ) ) ) else if( valueB.startsWith( "pg_" ) )
{ {
ret = true; // sorts first ! ret = true; // sorts first !
} }
......
...@@ -119,7 +119,7 @@ Reference< XConnection > Driver::connect( ...@@ -119,7 +119,7 @@ Reference< XConnection > Driver::connect(
sal_Bool Driver::acceptsURL( const OUString& url ) sal_Bool Driver::acceptsURL( const OUString& url )
throw (SQLException, RuntimeException) throw (SQLException, RuntimeException)
{ {
return url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:postgresql:" ) ); return url.startsWith( "sdbc:postgresql:" );
} }
Sequence< DriverPropertyInfo > Driver::getPropertyInfo( Sequence< DriverPropertyInfo > Driver::getPropertyInfo(
......
...@@ -94,7 +94,7 @@ static Any isCurrency( const OUString & typeName ) ...@@ -94,7 +94,7 @@ static Any isCurrency( const OUString & typeName )
static Any isAutoIncrement( const OUString & defaultValue ) static Any isAutoIncrement( const OUString & defaultValue )
{ {
sal_Bool ret = defaultValue.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "nextval(" ) ); sal_Bool ret = defaultValue.startsWith( "nextval(" );
// printf( "%s %d\n", // printf( "%s %d\n",
// OUStringToOString(defaultValue, RTL_TEXTENCODING_ASCII_US).getStr(), // OUStringToOString(defaultValue, RTL_TEXTENCODING_ASCII_US).getStr(),
// ret ); // ret );
......
...@@ -67,7 +67,7 @@ namespace sd { namespace colortoolpanel ...@@ -67,7 +67,7 @@ namespace sd { namespace colortoolpanel
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
if ( !i_rResourceURL.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "private:resource/toolpanel/org.openoffice.example.colorpanel/" ) ) ) if ( !i_rResourceURL.startsWith( "private:resource/toolpanel/org.openoffice.example.colorpanel/" ) )
throw NoSuchElementException( i_rResourceURL, *this ); throw NoSuchElementException( i_rResourceURL, *this );
const OUString sColor( i_rResourceURL.copy( i_rResourceURL.lastIndexOf( '/' ) + 1 ) ); const OUString sColor( i_rResourceURL.copy( i_rResourceURL.lastIndexOf( '/' ) + 1 ) );
......
...@@ -1850,9 +1850,9 @@ sal_Int32 lclCreateFormat( const Reference< XNumberFormats >& rxNumFmts, ...@@ -1850,9 +1850,9 @@ sal_Int32 lclCreateFormat( const Reference< XNumberFormats >& rxNumFmts,
else else
{ {
// do not assert fractional number formats with fixed denominator // do not assert fractional number formats with fixed denominator
OSL_ENSURE( rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?/" ) ) || OSL_ENSURE( rFmtCode.startsWith( "#\\ ?/" ) ||
rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?\?/" ) ) || rFmtCode.startsWith( "#\\ ?\?/" ) ||
rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?\?\?/" ) ), rFmtCode.startsWith( "#\\ ?\?\?/" ),
OStringBuffer( "lclCreateFormat - cannot create number format '" ). OStringBuffer( "lclCreateFormat - cannot create number format '" ).
append( OUStringToOString( rFmtCode, osl_getThreadTextEncoding() ) ). append( OUStringToOString( rFmtCode, osl_getThreadTextEncoding() ) ).
append( '\'' ).getStr() ); append( '\'' ).getStr() );
......
...@@ -572,7 +572,7 @@ namespace sfx2 ...@@ -572,7 +572,7 @@ namespace sfx2
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------
bool ModuleTaskPane_Impl::impl_isToolPanelResource( const OUString& i_rResourceURL ) bool ModuleTaskPane_Impl::impl_isToolPanelResource( const OUString& i_rResourceURL )
{ {
return i_rResourceURL.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "private:resource/toolpanel/" ) ); return i_rResourceURL.startsWith( "private:resource/toolpanel/" );
} }
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------
......
...@@ -1615,7 +1615,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm ...@@ -1615,7 +1615,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
if ( pAny ) if ( pAny )
*pAny >>= sShpType; *pAny >>= sShpType;
if( sShpType.getLength() > 3 && if( sShpType.getLength() > 3 &&
sShpType.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "mso" ))){ sShpType.startsWith( "mso" )){
bIsMSEllipse = true; bIsMSEllipse = true;
} }
if( (! bIsDefaultPath && ! bIsDefaultViewBox) || (bIsDefaultViewBox && bIsMSEllipse) /*&& (nGeneratorVersion == SfxObjectShell::Sym_L2)*/ ) if( (! bIsDefaultPath && ! bIsDefaultViewBox) || (bIsDefaultViewBox && bIsMSEllipse) /*&& (nGeneratorVersion == SfxObjectShell::Sym_L2)*/ )
......
...@@ -185,7 +185,7 @@ bool DAVProperties::isUCBSpecialProperty(const rtl::OUString& rFullName, rtl::OU ...@@ -185,7 +185,7 @@ bool DAVProperties::isUCBSpecialProperty(const rtl::OUString& rFullName, rtl::OU
{ {
sal_Int32 nLen = rFullName.getLength(); sal_Int32 nLen = rFullName.getLength();
if ( nLen <= 0 || if ( nLen <= 0 ||
!rFullName.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "<prop:" ) ) || !rFullName.startsWith( "<prop:" ) ||
!rFullName.endsWithAsciiL( RTL_CONSTASCII_STRINGPARAM( "\">" ) ) ) !rFullName.endsWithAsciiL( RTL_CONSTASCII_STRINGPARAM( "\">" ) ) )
return false; return false;
...@@ -199,7 +199,7 @@ bool DAVProperties::isUCBSpecialProperty(const rtl::OUString& rFullName, rtl::OU ...@@ -199,7 +199,7 @@ bool DAVProperties::isUCBSpecialProperty(const rtl::OUString& rFullName, rtl::OU
return false; return false;
// TODO skip whitespaces? // TODO skip whitespaces?
if ( !rFullName.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "xmlns:prop=\"" ), ++nEnd ) ) if ( !rFullName.startsWith( RTL_CONSTASCII_STRINGPARAM( "xmlns:prop=\"" ), ++nEnd ) )
return false; return false;
nStart = nEnd + RTL_CONSTASCII_LENGTH( "xmlns:prop=\"" ); nStart = nEnd + RTL_CONSTASCII_LENGTH( "xmlns:prop=\"" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment