diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-20 13:46:07 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-20 13:56:09 +0200 |
commit | f8b22654197178a441d383398b515bb2fb6deaf2 (patch) | |
tree | 5bc460ea1a3a2016172cd2db2646937822d8a894 | |
parent | 9cb0fc7801db40ab337c20591ec4674b941ba01a (diff) |
remove RTL_CONSTASCII_STRINGPARAM in OUString::matchAsciiL calls
Convert code like:
defaultValue.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "nextval(" ) );
to:
defaultValue.startsWith( "nextval(" );
Change-Id: I77bdcbf46bec6ded3c16a8248634b1424a1eb4f0
-rw-r--r-- | connectivity/source/drivers/mysql/YDriver.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_databasemetadata.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_driver.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_xcolumns.cxx | 2 | ||||
-rw-r--r-- | odk/examples/cpp/custompanel/ctp_factory.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/numberformatsbuffer.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/taskpane.cxx | 2 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape2d.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/DAVProperties.cxx | 4 |
9 files changed, 17 insertions, 17 deletions
diff --git a/connectivity/source/drivers/mysql/YDriver.cxx b/connectivity/source/drivers/mysql/YDriver.cxx index 50d0e3a21d5b..10af859d0dcd 100644 --- a/connectivity/source/drivers/mysql/YDriver.cxx +++ b/connectivity/source/drivers/mysql/YDriver.cxx @@ -319,9 +319,9 @@ namespace connectivity { Sequence< PropertyValue > info; - sal_Bool bOK = url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:odbc:" ) ) - || url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:jdbc:" ) ) - || ( url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:mysql:mysqlc:" ) ) + sal_Bool bOK = url.startsWith( "sdbc:mysql:odbc:" ) + || url.startsWith( "sdbc:mysql:jdbc:" ) + || ( url.startsWith( "sdbc:mysql:mysqlc:" ) && loadDriver( url, info ).is() ); return bOK; diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index 9a502a07e7e4..11e36b3851c6 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -1235,16 +1235,16 @@ struct SortInternalSchemasLastAndPublicFirst { ret = false; } - else if( valueA.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "pg_" ) ) && - valueB.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "pg_" ) ) ) + else if( valueA.startsWith( "pg_" ) && + valueB.startsWith( "pg_" ) ) { ret = valueA.compareTo( valueB ) < 0; // sorts equal ! } - else if( valueA.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "pg_" ) )) + else if( valueA.startsWith( "pg_" )) { ret = false; // sorts last ! } - else if( valueB.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "pg_" ) ) ) + else if( valueB.startsWith( "pg_" ) ) { ret = true; // sorts first ! } diff --git a/connectivity/source/drivers/postgresql/pq_driver.cxx b/connectivity/source/drivers/postgresql/pq_driver.cxx index 5f1fedb72e36..d2742ec251ab 100644 --- a/connectivity/source/drivers/postgresql/pq_driver.cxx +++ b/connectivity/source/drivers/postgresql/pq_driver.cxx @@ -119,7 +119,7 @@ Reference< XConnection > Driver::connect( sal_Bool Driver::acceptsURL( const OUString& url ) throw (SQLException, RuntimeException) { - return url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:postgresql:" ) ); + return url.startsWith( "sdbc:postgresql:" ); } Sequence< DriverPropertyInfo > Driver::getPropertyInfo( diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx index a3dccb4fc55f..a7ec8884a635 100644 --- a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx @@ -94,7 +94,7 @@ static Any isCurrency( const OUString & typeName ) 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", // OUStringToOString(defaultValue, RTL_TEXTENCODING_ASCII_US).getStr(), // ret ); diff --git a/odk/examples/cpp/custompanel/ctp_factory.cxx b/odk/examples/cpp/custompanel/ctp_factory.cxx index 2915c85737ee..9c8d5c50ddb2 100644 --- a/odk/examples/cpp/custompanel/ctp_factory.cxx +++ b/odk/examples/cpp/custompanel/ctp_factory.cxx @@ -67,7 +67,7 @@ namespace sd { namespace colortoolpanel { ::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 ); const OUString sColor( i_rResourceURL.copy( i_rResourceURL.lastIndexOf( '/' ) + 1 ) ); diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx index 82316404e409..84f44a220d45 100644 --- a/sc/source/filter/oox/numberformatsbuffer.cxx +++ b/sc/source/filter/oox/numberformatsbuffer.cxx @@ -1850,9 +1850,9 @@ sal_Int32 lclCreateFormat( const Reference< XNumberFormats >& rxNumFmts, else { // do not assert fractional number formats with fixed denominator - OSL_ENSURE( rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?/" ) ) || - rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?\?/" ) ) || - rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?\?\?/" ) ), + OSL_ENSURE( rFmtCode.startsWith( "#\\ ?/" ) || + rFmtCode.startsWith( "#\\ ?\?/" ) || + rFmtCode.startsWith( "#\\ ?\?\?/" ), OStringBuffer( "lclCreateFormat - cannot create number format '" ). append( OUStringToOString( rFmtCode, osl_getThreadTextEncoding() ) ). append( '\'' ).getStr() ); diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index 12a7b1dcfd77..9ac3dbf9709e 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -572,7 +572,7 @@ namespace sfx2 //------------------------------------------------------------------------------------------------------------------ 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/" ); } //------------------------------------------------------------------------------------------------------------------ diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 5665cc93e1df..b3a780b14109 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -1615,7 +1615,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm if ( pAny ) *pAny >>= sShpType; if( sShpType.getLength() > 3 && - sShpType.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "mso" ))){ + sShpType.startsWith( "mso" )){ bIsMSEllipse = true; } if( (! bIsDefaultPath && ! bIsDefaultViewBox) || (bIsDefaultViewBox && bIsMSEllipse) /*&& (nGeneratorVersion == SfxObjectShell::Sym_L2)*/ ) diff --git a/ucb/source/ucp/webdav/DAVProperties.cxx b/ucb/source/ucp/webdav/DAVProperties.cxx index 264e2a3c2371..33b10a0af9f8 100644 --- a/ucb/source/ucp/webdav/DAVProperties.cxx +++ b/ucb/source/ucp/webdav/DAVProperties.cxx @@ -185,7 +185,7 @@ bool DAVProperties::isUCBSpecialProperty(const rtl::OUString& rFullName, rtl::OU { sal_Int32 nLen = rFullName.getLength(); if ( nLen <= 0 || - !rFullName.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "<prop:" ) ) || + !rFullName.startsWith( "<prop:" ) || !rFullName.endsWithAsciiL( RTL_CONSTASCII_STRINGPARAM( "\">" ) ) ) return false; @@ -199,7 +199,7 @@ bool DAVProperties::isUCBSpecialProperty(const rtl::OUString& rFullName, rtl::OU return false; // TODO skip whitespaces? - if ( !rFullName.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "xmlns:prop=\"" ), ++nEnd ) ) + if ( !rFullName.startsWith( RTL_CONSTASCII_STRINGPARAM( "xmlns:prop=\"" ), ++nEnd ) ) return false; nStart = nEnd + RTL_CONSTASCII_LENGTH( "xmlns:prop=\"" ); |