[Libreoffice-commits] .: comphelper/inc connectivity/source dbaccess/source forms/source framework/source lingucomponent/source oox/source scaddins/source sdext/source svtools/source vcl/generic xmloff/source

August Sodora augsod at kemper.freedesktop.org
Fri Nov 25 21:49:33 PST 2011


 comphelper/inc/comphelper/string.hxx                               |    2 -
 connectivity/source/commontools/TIndexes.cxx                       |    2 -
 connectivity/source/commontools/dbtools2.cxx                       |    4 +--
 connectivity/source/drivers/calc/CTable.cxx                        |    4 +--
 dbaccess/source/core/api/CacheSet.cxx                              |    6 ++---
 dbaccess/source/core/api/KeySet.cxx                                |    4 +--
 dbaccess/source/ext/macromigration/migrationengine.cxx             |    2 -
 forms/source/xforms/convert.cxx                                    |    2 -
 framework/source/fwe/helper/configimporter.cxx                     |    2 -
 lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx |   12 +++++-----
 lingucomponent/source/spellcheck/spell/sspellimp.cxx               |   12 +++++-----
 oox/source/ole/olehelper.cxx                                       |    2 -
 scaddins/source/datefunc/datefunc.cxx                              |    2 -
 sdext/source/minimizer/optimizerdialogcontrols.cxx                 |    2 -
 svtools/source/graphic/grfcache.cxx                                |    8 +++---
 vcl/generic/fontmanager/fontmanager.cxx                            |    2 -
 xmloff/source/text/txtimp.cxx                                      |    4 +--
 17 files changed, 36 insertions(+), 36 deletions(-)

New commits:
commit 93253ee6ab355a0590e9632e2ce2f024af15c535
Author: August Sodora <augsod at gmail.com>
Date:   Sat Nov 26 00:48:17 2011 -0500

    Remove some uses of OUString::setCharAt

diff --git a/comphelper/inc/comphelper/string.hxx b/comphelper/inc/comphelper/string.hxx
index 878b557..037c947 100644
--- a/comphelper/inc/comphelper/string.hxx
+++ b/comphelper/inc/comphelper/string.hxx
@@ -426,7 +426,7 @@ namespace detail
         {
             rBuffer.setLength(nLen);
             for (sal_Int32 i = nOrigLen; i < nLen; ++i)
-                rBuffer.setCharAt(i, cFill);
+                rBuffer[i] = cFill;
         }
         return rBuffer;
     }
diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx
index 5132a9f..f319d45 100644
--- a/connectivity/source/commontools/TIndexes.cxx
+++ b/connectivity/source/commontools/TIndexes.cxx
@@ -190,7 +190,7 @@ sdbcx::ObjectType OIndexesHelper::appendObject( const ::rtl::OUString& _rForName
                 }
                 aSql.appendAscii(",");
             }
-            aSql.setCharAt(aSql.getLength()-1,')');
+            aSql[aSql.getLength() - 1] = ')';
         }
         else
         {
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index d955ef2..2ae5c91 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -355,8 +355,8 @@ namespace
 
     if ( aSql.getLength() )
     {
-        if ( aSql.charAt(aSql.getLength()-1) == ',' )
-            aSql.setCharAt(aSql.getLength()-1,')');
+        if ( aSql[aSql.getLength() - 1] == ',' )
+            aSql[aSql.getLength() - 1] = ')';
         else
             aSql.appendAscii(")");
     }
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index cbfb9f9..ca33fa0 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -452,8 +452,8 @@ void lcl_SetValue( ORowSetValue& rValue, const Reference<XSpreadsheet>& xSheet,
     {
         ::rtl::OUStringBuffer aBuffer(2);
         aBuffer.setLength( 2 );
-        aBuffer.setCharAt( 0, (sal_Unicode) ( 'A' + ( nColumn / 26 ) - 1 ) );
-        aBuffer.setCharAt( 1, (sal_Unicode) ( 'A' + ( nColumn % 26 ) ) );
+        aBuffer[0] = (sal_Unicode) ( 'A' + ( nColumn / 26 ) - 1 );
+        aBuffer[1] = (sal_Unicode) ( 'A' + ( nColumn % 26 ) );
         return aBuffer.makeStringAndClear();
     }
 }
diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx
index f1e5f3e..bd31914 100644
--- a/dbaccess/source/core/api/CacheSet.cxx
+++ b/dbaccess/source/core/api/CacheSet.cxx
@@ -188,8 +188,8 @@ void SAL_CALL OCacheSet::insertRow( const ORowSetRow& _rInsertRow,const connecti
         aValues.append(aPara);
     }
 
-    aSql.setCharAt(aSql.getLength()-1,')');
-    aValues.setCharAt(aValues.getLength()-1,')');
+    aSql[aSql.getLength() - 1] = ')';
+    aValues[aValues.getLength() - 1] = ')';
 
     aSql.append(aValues.makeStringAndClear());
     // now create end execute the prepared statement
@@ -311,7 +311,7 @@ void SAL_CALL OCacheSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetR
     ::rtl::OUStringBuffer aCondition;
     ::std::list< sal_Int32> aOrgValues;
     fillParameters(_rInsertRow,_xTable,aCondition,aSql,aOrgValues);
-    aSql.setCharAt(aSql.getLength()-1,' ');
+    aSql[aSql.getLength() - 1] = ' ';
     if ( aCondition.getLength() )
     {
         aCondition.setLength(aCondition.getLength()-5);
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 28c6828..d399375 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -697,8 +697,8 @@ void SAL_CALL OKeySet::insertRow( const ORowSetRow& _rInsertRow,const connectivi
     if ( !bModified )
         ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_VALUE_CHANGED ), SQL_GENERAL_ERROR, m_xConnection );
 
-    aSql.setCharAt(aSql.getLength()-1,')');
-    aValues.setCharAt(aValues.getLength()-1,')');
+    aSql[aSql.getLength() - 1] = ')';
+    aValues[aValues.getLength() - 1] = ')';
     aSql.append(aValues.makeStringAndClear());
     // now create,fill and execute the prepared statement
     ::rtl::OUString sEmpty;
diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx
index ef319d6..8369f3e 100644
--- a/dbaccess/source/ext/macromigration/migrationengine.cxx
+++ b/dbaccess/source/ext/macromigration/migrationengine.cxx
@@ -1259,7 +1259,7 @@ namespace dbmm
                 for ( sal_Int32 i=0; i<nBaseNameLen; ++i )
                 {
                     if ( !::comphelper::OStorageHelper::IsValidZipEntryFileName( pReplacement + i, 1, sal_False ) )
-                        aReplacement.setCharAt( i, '_' );
+                        aReplacement[i] = '_';
                 }
                 sBaseName = aReplacement.makeStringAndClear();
 
diff --git a/forms/source/xforms/convert.cxx b/forms/source/xforms/convert.cxx
index 4fa4250..327025b 100644
--- a/forms/source/xforms/convert.cxx
+++ b/forms/source/xforms/convert.cxx
@@ -592,7 +592,7 @@ Convert::Any_t Convert::toAny( const rtl::OUString& rValue,
         if( c == sal_Unicode(0x08) ||
             c == sal_Unicode(0x0A) ||
             c == sal_Unicode(0x0D) )
-            aBuffer.setCharAt( i, sal_Unicode(0x20) );
+            aBuffer[i] = sal_Unicode(0x20);
     }
     return aBuffer.makeStringAndClear();
 }
diff --git a/framework/source/fwe/helper/configimporter.cxx b/framework/source/fwe/helper/configimporter.cxx
index 53752ba..7586f9a 100644
--- a/framework/source/fwe/helper/configimporter.cxx
+++ b/framework/source/fwe/helper/configimporter.cxx
@@ -58,7 +58,7 @@ sal_Bool UIConfigurationImporterOOo1x::ImportCustomToolbars(
             {
                 rtl::OUStringBuffer aCustomTbxName( 20 );
                 aCustomTbxName.appendAscii( USERDEFTOOLBOX );
-                aCustomTbxName.setCharAt( 14, aCustomTbxName.charAt( 14 ) + i );
+                aCustomTbxName[14] = aCustomTbxName[14] + i;
 
                 rtl::OUString aTbxStreamName( aCustomTbxName.makeStringAndClear() );
                 uno::Reference< io::XStream > xStream = rToolbarStorage->openStreamElement( aTbxStreamName, embed::ElementModes::READ );
diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
index 62b192f..65bb5da 100644
--- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx
@@ -358,11 +358,11 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const ::rtl::OUStri
         sal_Unicode ch;
         for (sal_Int32 ix=0; ix < nc; ix++)
         {
-            ch = rBuf.charAt(ix);
+            ch = rBuf[ix];
             if ((ch == 0x201C) || (ch == 0x201D))
-                rBuf.setCharAt(ix,(sal_Unicode)0x0022);
+                rBuf[ix] = (sal_Unicode)0x0022;
             if ((ch == 0x2018) || (ch == 0x2019))
-                rBuf.setCharAt(ix,(sal_Unicode)0x0027);
+                rBuf[ix] = (sal_Unicode)0x0027;
         }
         OUString nWord(rBuf.makeStringAndClear());
 
@@ -617,11 +617,11 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const
         sal_Unicode ch;
         for (sal_Int32 ix=0; ix < nc; ix++)
         {
-            ch = rBuf.charAt(ix);
+            ch = rBuf[ix];
             if ((ch == 0x201C) || (ch == 0x201D))
-                rBuf.setCharAt(ix,(sal_Unicode)0x0022);
+                rBuf[ix] = (sal_Unicode)0x0022;
             if ((ch == 0x2018) || (ch == 0x2019))
-                rBuf.setCharAt(ix,(sal_Unicode)0x0027);
+                rBuf[ix] = (sal_Unicode)0x0027;
         }
         OUString nWord(rBuf.makeStringAndClear());
 
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 4426a88..3fd8308 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -292,11 +292,11 @@ sal_Int16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rL
     sal_Unicode c;
     for (sal_Int32 ix=0; ix < n; ix++)
     {
-        c = rBuf.charAt(ix);
+        c = rBuf[ix];
         if ((c == 0x201C) || (c == 0x201D))
-            rBuf.setCharAt(ix,(sal_Unicode)0x0022);
+            rBuf[ix] = (sal_Unicode)0x0022;
         if ((c == 0x2018) || (c == 0x2019))
-            rBuf.setCharAt(ix,(sal_Unicode)0x0027);
+            rBuf[ix] = (sal_Unicode)0x0027;
     }
     OUString nWord(rBuf.makeStringAndClear());
 
@@ -428,11 +428,11 @@ Reference< XSpellAlternatives >
     sal_Unicode c;
     for (sal_Int32 ix=0; ix < n; ix++)
     {
-        c = rBuf.charAt(ix);
+        c = rBuf[ix];
         if ((c == 0x201C) || (c == 0x201D))
-            rBuf.setCharAt(ix,(sal_Unicode)0x0022);
+            rBuf[ix] = (sal_Unicode)0x0022;
         if ((c == 0x2018) || (c == 0x2019))
-            rBuf.setCharAt(ix,(sal_Unicode)0x0027);
+            rBuf[ix] = (sal_Unicode)0x0027;
     }
     OUString nWord(rBuf.makeStringAndClear());
 
diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx
index 34b17bd..a04a2c6 100644
--- a/oox/source/ole/olehelper.cxx
+++ b/oox/source/ole/olehelper.cxx
@@ -233,7 +233,7 @@ void lclAppendHex( OUStringBuffer& orBuffer, Type nValue )
     static const sal_Unicode spcHexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
     orBuffer.setLength( orBuffer.getLength() + nWidth );
     for( sal_Int32 nCharIdx = orBuffer.getLength() - 1, nCharEnd = nCharIdx - nWidth; nCharIdx > nCharEnd; --nCharIdx, nValue >>= 4 )
-        orBuffer.setCharAt( nCharIdx, spcHexChars[ nValue & 0xF ] );
+        orBuffer[nCharIdx] = spcHexChars[ nValue & 0xF ];
 }
 
 OUString lclReadStdHlinkString( BinaryInputStream& rInStrm, bool bUnicode )
diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx
index 75a538b..6c5d0fa 100644
--- a/scaddins/source/datefunc/datefunc.cxx
+++ b/scaddins/source/datefunc/datefunc.cxx
@@ -952,7 +952,7 @@ OUString SAL_CALL ScaDateAddIn::getRot13( const OUString& aSrcString ) throw( un
         if( ((cChar >= 'a') && (cChar <= 'z') && ((cChar += 13) > 'z')) ||
             ((cChar >= 'A') && (cChar <= 'Z') && ((cChar += 13) > 'Z')) )
             cChar -= 26;
-        aBuffer.setCharAt( nIndex, cChar );
+        aBuffer[nIndex] = cChar;
     }
     return aBuffer.makeStringAndClear();
 }
diff --git a/sdext/source/minimizer/optimizerdialogcontrols.cxx b/sdext/source/minimizer/optimizerdialogcontrols.cxx
index 1061f32..ffa18dc 100644
--- a/sdext/source/minimizer/optimizerdialogcontrols.cxx
+++ b/sdext/source/minimizer/optimizerdialogcontrols.cxx
@@ -606,7 +606,7 @@ static OUString ImpValueOfInMB( const sal_Int64& rVal, sal_Unicode nSeparator =
     if ( nX >= 0 )
     {
         aVal.setLength( nX + 2 );
-        aVal.setCharAt( nX, nSeparator );
+        aVal[nX] = nSeparator;
     }
     aVal.append( OUString(RTL_CONSTASCII_USTRINGPARAM(" MB")) );
     return aVal.makeStringAndClear();
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index 3299deb..e01f9d9 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -141,16 +141,16 @@ rtl::OString GraphicID::GetIDString() const
     aHexStr.setLength(32);
 
     for( nShift = 28; nShift >= 0; nShift -= 4 )
-        aHexStr.setCharAt(nIndex++, aHexData[ ( mnID1 >> (sal_uInt32) nShift ) & 0xf ]);
+        aHexStr[nIndex++] = aHexData[ ( mnID1 >> (sal_uInt32) nShift ) & 0xf ];
 
     for( nShift = 28; nShift >= 0; nShift -= 4 )
-        aHexStr.setCharAt(nIndex++, aHexData[ ( mnID2 >> (sal_uInt32) nShift ) & 0xf ]);
+        aHexStr[nIndex++] = aHexData[ ( mnID2 >> (sal_uInt32) nShift ) & 0xf ];
 
     for( nShift = 28; nShift >= 0; nShift -= 4 )
-        aHexStr.setCharAt(nIndex++, aHexData[ ( mnID3 >> (sal_uInt32) nShift ) & 0xf ]);
+        aHexStr[nIndex++] = aHexData[ ( mnID3 >> (sal_uInt32) nShift ) & 0xf ];
 
     for( nShift = 28; nShift >= 0; nShift -= 4 )
-        aHexStr.setCharAt(nIndex++, aHexData[ ( mnID4 >> (sal_uInt32) nShift ) & 0xf ]);
+        aHexStr[nIndex++] = aHexData[ ( mnID4 >> (sal_uInt32) nShift ) & 0xf ];
 
     return aHexStr.makeStringAndClear();
 }
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 24b2006..d62b9d7 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -1535,7 +1535,7 @@ bool PrintFontManager::parseXLFD( const OString& rXLFD, XLFDEntry& rEntry )
             aFirst = aFirst - 'a' + 'A';
         OStringBuffer aNewToken( aToken.getLength() );
         aNewToken.append( aToken );
-        aNewToken.setCharAt( 0, aFirst );
+        aNewToken[0] = aFirst;
         if( aFamilyName.getLength() > 0 )
             aFamilyName.append( ' ' );
         aFamilyName.append( aNewToken.makeStringAndClear() );
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 9a12573..7d0a481 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1316,12 +1316,12 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars,
             }
             if( (rFlags & CONV_FROM_STAR_BATS ) != 0 )
             {
-                sChars.setCharAt( j, rImport.ConvStarBatsCharToStarSymbol( c ) );
+                sChars[j] = rImport.ConvStarBatsCharToStarSymbol( c );
                 bConverted = sal_True;
             }
             else if( (rFlags & CONV_FROM_STAR_MATH ) != 0 )
             {
-                sChars.setCharAt( j, rImport.ConvStarMathCharToStarSymbol( c ) );
+                sChars[j] = rImport.ConvStarMathCharToStarSymbol( c );
                 bConverted = sal_True;
             }
         }


More information about the Libreoffice-commits mailing list