[Libreoffice-commits] core.git: connectivity/source dbaccess/source

Thomas Arnhold thomas at arnhold.org
Thu Sep 5 09:49:54 PDT 2013


 connectivity/source/parse/sqliterator.cxx  |    4 ++--
 dbaccess/source/ui/uno/copytablewizard.cxx |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit fa1b2554d57ea72e4ff45d0d7377aa3671fb2c30
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Thu Sep 5 18:47:32 2013 +0200

    use replaceFirst
    
    Change-Id: Ia20eec6e868579ed31e478514b7f2722a0972094
    Reviewed-on: https://gerrit.libreoffice.org/5828
    Reviewed-by: Thomas Arnhold <thomas at arnhold.org>
    Tested-by: Thomas Arnhold <thomas at arnhold.org>

diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
index 1237120..a19f593 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -2129,9 +2129,9 @@ void OSQLParseTreeIterator::impl_appendError( IParseContext::ErrorCode _eError,
         const sal_Char* pPlaceHolder1 = bTwoTokens ? "#1" : "#";
         const OUString sPlaceHolder1 = OUString::createFromAscii( pPlaceHolder1 );
 
-        sErrorMessage = sErrorMessage.replaceAt( sErrorMessage.indexOf( sPlaceHolder1 ), sPlaceHolder1.getLength(), *_pReplaceToken1 );
+        sErrorMessage = sErrorMessage.replaceFirst( sPlaceHolder1, *_pReplaceToken1 );
         if ( _pReplaceToken2 )
-            sErrorMessage = sErrorMessage.replaceAt( sErrorMessage.indexOf( "#2" ), 2, *_pReplaceToken2 );
+            sErrorMessage = sErrorMessage.replaceFirst( "#2" , *_pReplaceToken2 );
     }
 
     impl_appendError( SQLException(
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index 954c601..1388934 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1302,8 +1302,8 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
                     {
                         OUString aMessage( String( ModuleRes( STR_CTW_UNSUPPORTED_COLUMN_TYPE ) ) );
 
-                        aMessage = aMessage.replaceAt( aMessage.indexOfAsciiL( "$type$", 6 ), 6, OUString::number( aSourceColTypes[ nSourceColumn ] ) );
-                        aMessage = aMessage.replaceAt( aMessage.indexOfAsciiL( "$pos$", 5 ), 5, OUString::number( nSourceColumn ) );
+                        aMessage = aMessage.replaceFirst( "$type$", OUString::number( aSourceColTypes[ nSourceColumn ] ) );
+                        aMessage = aMessage.replaceFirst( "$pos$", OUString::number( nSourceColumn ) );
 
                         ::dbtools::throwSQLException(
                             aMessage,


More information about the Libreoffice-commits mailing list