From 3f765e5bb2955683fc2db10f630365a4c35416d3 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Thu, 8 Mar 2012 00:49:32 +0100 Subject: replace usage of OUString::replace*AsciiL() with string literal overloads --- dbaccess/source/core/dataaccess/datasource.cxx | 3 +-- .../source/core/dataaccess/documentcontainer.cxx | 6 ++---- .../source/ext/macromigration/migrationengine.cxx | 21 +++++++-------------- dbaccess/source/ui/app/AppController.cxx | 4 +--- dbaccess/source/ui/uno/copytablewizard.cxx | 3 +-- 5 files changed, 12 insertions(+), 25 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index ae8971729bb2..dc0e767f1896 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -747,8 +747,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const ::rtl::O SQLContext aContext; aContext.Message = DBACORE_RESSTRING(RID_STR_CONNECTION_REQUEST). - replaceFirstAsciiL( - RTL_CONSTASCII_STRINGPARAM("$name$"), m_pImpl->m_sConnectURL); + replaceFirst("$name$", m_pImpl->m_sConnectURL); throwGenericSQLException( sMessage, static_cast< XDataSource* >( this ), makeAny( aContext ) ); } diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index 082a6f315f96..8b2481a2be7b 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -542,8 +542,7 @@ Reference< XComponent > SAL_CALL ODocumentContainer::loadComponentFromURL( const if ( !lcl_queryContent(_sURL,xNameContainer,aContent,sName) ) { ::rtl::OUString sMessage( - DBA_RES(RID_STR_NAME_NOT_FOUND).replaceFirstAsciiL( - RTL_CONSTASCII_STRINGPARAM("$name$"), _sURL)); + DBA_RES(RID_STR_NAME_NOT_FOUND).replaceFirst("$name$", _sURL)); throw IllegalArgumentException( sMessage, *this, 1 ); } @@ -613,8 +612,7 @@ void SAL_CALL ODocumentContainer::insertByHierarchicalName( const ::rtl::OUStrin { sal_Int32 index = sName.getLength(); ::rtl::OUString sMessage( - DBA_RES(RID_STR_NO_SUB_FOLDER).replaceFirstAsciiL( - RTL_CONSTASCII_STRINGPARAM("$folder$"), + DBA_RES(RID_STR_NO_SUB_FOLDER).replaceFirst("$folder$", _sName.getToken(0,'/',index))); throw IllegalArgumentException( sMessage, *this, 1 ); } diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx index 5bdde99a1407..5da4555fd2aa 100644 --- a/dbaccess/source/ext/macromigration/migrationengine.cxx +++ b/dbaccess/source/ext/macromigration/migrationengine.cxx @@ -257,9 +257,7 @@ namespace dbmm ResId::toString( MacroMigrationResId( _rDocument.eType == eForm ? STR_FORM : STR_REPORT)). - replaceFirstAsciiL( - RTL_CONSTASCII_STRINGPARAM("$name$"), - _rDocument.sHierarchicalName)); + replaceFirst("$name$", _rDocument.sHierarchicalName)); return sObjectName; } @@ -1031,9 +1029,7 @@ namespace dbmm sal_Int32 nOverallRange( m_aSubDocs.size() ); rtl::OUString sProgressSkeleton( ResId::toString(MacroMigrationResId( STR_OVERALL_PROGRESS)). - replaceFirstAsciiL( - RTL_CONSTASCII_STRINGPARAM("$overall$"), - rtl::OUString::valueOf(nOverallRange))); + replaceFirst("$overall$", rtl::OUString::valueOf(nOverallRange))); m_rProgress.start( nOverallRange ); @@ -1045,8 +1041,7 @@ namespace dbmm sal_Int32 nOverallProgressValue( doc - m_aSubDocs.begin() + 1 ); // update overall progress text ::rtl::OUString sOverallProgress( - sProgressSkeleton.replaceFirstAsciiL( - RTL_CONSTASCII_STRINGPARAM("$current$"), + sProgressSkeleton.replaceFirst("$current$", ::rtl::OUString::valueOf(nOverallProgressValue))); m_rProgress.setOverallProgressText( sOverallProgress ); @@ -1938,14 +1933,12 @@ namespace dbmm // a human-readable description of the affected library ::rtl::OUString sLibraryDescription( ResId::toString(MacroMigrationResId(STR_LIBRARY_TYPE_AND_NAME)). - replaceFirstAsciiL( - RTL_CONSTASCII_STRINGPARAM("$type$"), + replaceFirst("$type$", getScriptTypeDisplayName(_eScriptType)). - replaceFirstAsciiL( - RTL_CONSTASCII_STRINGPARAM("$library$"), _rLibraryName)); - //TODO: probably broken if first replaceFirstAsciiL can produce + replaceFirst("$library$", _rLibraryName)); + //TODO: probably broken if first replaceFirst can produce // fresh instance of "$library$" in subject string of second - // replaceFirstAsciiL + // replaceFirst InteractionHandler aHandler( m_aContext, m_xDocumentModel ); ::rtl::OUString sPassword; diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 1ee3d1b77dd1..d5f2b6698309 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -2966,9 +2966,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer ::rtl::OUString sMessage( rtl::OUString( String(ModuleRes(RID_STR_UNSUPPORTED_OBJECT_TYPE))). - replaceFirstAsciiL( - RTL_CONSTASCII_STRINGPARAM("$type$"), - ::rtl::OUString::valueOf(sal_Int32(pObject->Type)))); + replaceFirst("$type$", ::rtl::OUString::valueOf(sal_Int32(pObject->Type)))); throw IllegalArgumentException(sMessage, *this, sal_Int16( pObject - aSelectedObjects.getConstArray() )); } } diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index cfcadfcf2e26..5af49b91f0d6 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -763,8 +763,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X { ::rtl::OUString sMessage( rtl::OUString(String(ModuleRes(STR_CTW_ERROR_UNSUPPORTED_SETTING))). - replaceFirstAsciiL( - RTL_CONSTASCII_STRINGPARAM("$name$"), sUnsupportedSetting)); + replaceFirst("$name$", sUnsupportedSetting)); throw IllegalArgumentException( sMessage, *const_cast< CopyTableWizard* >( this ), -- cgit