[Libreoffice-commits] .: 14 commits - basic/source chart2/source desktop/source drawinglayer/source framework/source idl/inc idl/source l10ntools/source linguistic/source oox/source rsc/source sd/source shell/source sot/inc sot/source starmath/qa svl/source svtools/bmpmaker svtools/source svx/source tools/source unotools/source vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Mon Jan 23 03:37:41 PST 2012


 basic/source/runtime/iosys.cxx                                       |    4 
 chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx |    2 
 desktop/source/app/sofficemain.cxx                                   |    2 
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx           |   22 -
 framework/source/services/autorecovery.cxx                           |    7 
 idl/inc/object.hxx                                                   |    2 
 idl/source/cmptools/lex.cxx                                          |    6 
 idl/source/objects/object.cxx                                        |   14 -
 l10ntools/source/gsicheck.cxx                                        |    4 
 l10ntools/source/localize.cxx                                        |    8 
 l10ntools/source/merge.cxx                                           |   20 -
 linguistic/source/dicimp.cxx                                         |   37 +-
 oox/source/export/drawingml.cxx                                      |   14 -
 rsc/source/rsc/rsc.cxx                                               |   43 +--
 sd/source/filter/eppt/pptexsoundcollection.cxx                       |   56 ++--
 sd/source/filter/eppt/pptexsoundcollection.hxx                       |   14 -
 shell/source/tools/lngconvex/lngconvex.cxx                           |   12 
 sot/inc/sot/stg.hxx                                                  |    8 
 sot/inc/sot/storage.hxx                                              |    6 
 sot/source/base/formats.cxx                                          |    4 
 sot/source/sdstor/stg.cxx                                            |    2 
 sot/source/sdstor/storage.cxx                                        |    4 
 sot/source/sdstor/ucbstorage.cxx                                     |  127 ++++------
 starmath/qa/cppunit/test_nodetotextvisitors.cxx                      |    3 
 svl/source/numbers/zformat.cxx                                       |   10 
 svtools/bmpmaker/bmpcore.cxx                                         |   28 +-
 svtools/bmpmaker/bmpsum.cxx                                          |    8 
 svtools/source/filter/ixbm/xbmread.cxx                               |   24 -
 svtools/source/inc/xbmread.hxx                                       |    2 
 svx/source/gallery2/gallery1.cxx                                     |   43 ++-
 svx/source/inc/trace.hxx                                             |    2 
 tools/source/stream/stream.cxx                                       |    6 
 unotools/source/misc/componentresmodule.cxx                          |    4 
 vcl/unx/generic/printer/ppdparser.cxx                                |   19 -
 34 files changed, 288 insertions(+), 279 deletions(-)

New commits:
commit 67073c6bc870aceede4652fffd0571da584a4679
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 23 08:55:18 2012 +0000

    use safer rethrow syntax

diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index 835c358..5ec3dd4 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -75,7 +75,7 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
     } catch (const ::com::sun::star::uno::Exception &e) {
         fprintf (stderr, "Not handled UNO exception at main: '%s'\n",
                  rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
-        throw e; // to get exception type printed
+        throw; // to get exception type printed
     }
 #endif
 }
commit 2563c8dd790f26909f9f15fd29b900ebfbc7e467
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 22:59:09 2012 +0000

    can't see the point of calling String::Erase before delete String

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 06c70b8..d2c3e90 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -137,7 +137,7 @@ const sal_uInt16 nNewStandardFlagVersionId = 0x4653;    // "SF"
 
 void ImpSvNumberformatInfo::Copy( const ImpSvNumberformatInfo& rNumFor, sal_uInt16 nAnz )
 {
-    for (sal_uInt16 i = 0; i < nAnz; i++)
+    for (sal_uInt16 i = 0; i < nAnz; ++i)
     {
         sStrArray[i]  = rNumFor.sStrArray[i];
         nTypeArray[i] = rNumFor.nTypeArray[i];
@@ -348,8 +348,6 @@ ImpSvNumFor::ImpSvNumFor()
 
 ImpSvNumFor::~ImpSvNumFor()
 {
-    for (sal_uInt16 i = 0; i < nAnzStrings; i++)
-        aI.sStrArray[i].Erase();
     delete [] aI.sStrArray;
     delete [] aI.nTypeArray;
 }
@@ -358,10 +356,8 @@ void ImpSvNumFor::Enlarge(sal_uInt16 nAnz)
 {
     if ( nAnzStrings != nAnz )
     {
-        if ( aI.nTypeArray )
-            delete [] aI.nTypeArray;
-        if ( aI.sStrArray )
-            delete [] aI.sStrArray;
+        delete [] aI.nTypeArray;
+        delete [] aI.sStrArray;
         nAnzStrings = nAnz;
         if ( nAnz )
         {
commit b1f74de0311af25596e861c24be8b829f4b27cb4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 14:34:51 2012 +0000

    ByteString->rtl::OString

diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index b29e203..64ab1d9 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -647,7 +647,9 @@ SbError SbiStream::Read( ByteString& rBuf, sal_uInt16 n, bool bForceReadingPerBy
     nExpandOnWriteTo = 0;
     if( !bForceReadingPerByte && IsText() )
     {
-        pStrm->ReadLine( rBuf );
+        rtl::OString aBuffer;
+        pStrm->ReadLine(aBuffer);
+        rBuf = aBuffer;
         nLine++;
     }
     else
diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx
index 354bb8d..e915a4a 100644
--- a/l10ntools/source/gsicheck.cxx
+++ b/l10ntools/source/gsicheck.cxx
@@ -1046,12 +1046,12 @@ int _cdecl main( int argc, char *argv[] )
     }
 
 
-    ByteString sReferenceLine;
+    rtl::OString sReferenceLine;
     GSILine* pReferenceLine = NULL;
     ByteString aOldReferenceId("No Valid ID");   // just set to something which can never be an ID
     sal_uLong nReferenceLine = 0;
 
-    ByteString sGSILine;
+    rtl::OString sGSILine;
     GSILine* pGSILine = NULL;
     ByteString aOldId("No Valid ID");   // just set to something which can never be an ID
     GSIBlock *pBlock = NULL;
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index b29d08e..c00beee 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -371,12 +371,12 @@ void SourceTreeLocalizer::WorkOnFile(
             nFileCnt++;
 
             SvFileStream aSDFIn( aTemp.GetFull(), STREAM_READ );
-            ByteString sLine;
-            while ( aSDFIn.IsOpen() && !aSDFIn.IsEof()) {
+            rtl::OString sLine;
+            while ( aSDFIn.IsOpen() && !aSDFIn.IsEof())
+            {
                 aSDFIn.ReadLine( sLine );
-                if ( sLine.Len()) {
+                if (!sLine.isEmpty())
                     aSDF.WriteLine( sLine );
-                }
             }
             aSDFIn.Close();
 
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index a2c7f8e..f219315 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -187,7 +187,7 @@ MergeDataFile::MergeDataFile(
 {
     SvFileStream aInputStream( String( rFileName, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ );
     aInputStream.SetStreamCharSet( RTL_TEXTENCODING_MS_1252 );
-    ByteString sLine;
+    rtl::OString sLine;
     const ByteString sHACK("HACK");
     const ::rtl::OString sFileNormalized(lcl_NormalizeFilename(sFile));
     const bool isFileEmpty = !sFileNormalized.isEmpty();
@@ -208,17 +208,17 @@ MergeDataFile::MergeDataFile(
             const ::rtl::OString filename = lcl_NormalizeFilename(getToken(sLine, 1 , '\t'));
             if(isFileEmpty || sFileNormalized.equals("") || (!isFileEmpty && filename.equals(sFileNormalized)) )
             {
-                xub_StrLen rIdx = 0;
-                const ByteString sTYP = sLine.GetToken( 3, '\t', rIdx );
-                const ByteString sGID = sLine.GetToken( 0, '\t', rIdx ); // 4
-                const ByteString sLID = sLine.GetToken( 0, '\t', rIdx ); // 5
-                ByteString sPFO = sLine.GetToken( 1, '\t', rIdx ); // 7
+                sal_Int32 rIdx = 0;
+                const ByteString sTYP = sLine.getToken( 3, '\t', rIdx );
+                const ByteString sGID = sLine.getToken( 0, '\t', rIdx ); // 4
+                const ByteString sLID = sLine.getToken( 0, '\t', rIdx ); // 5
+                ByteString sPFO = sLine.getToken( 1, '\t', rIdx ); // 7
                 sPFO = sHACK;
-                ByteString nLANG = sLine.GetToken( 1, '\t', rIdx ); // 9
+                ByteString nLANG = sLine.getToken( 1, '\t', rIdx ); // 9
                 nLANG = comphelper::string::strip(nLANG, ' ');
-                const ByteString sTEXT = sLine.GetToken( 0, '\t', rIdx ); // 10
-                const ByteString sQHTEXT = sLine.GetToken( 1, '\t', rIdx ); // 12
-                const ByteString sTITLE = sLine.GetToken( 0, '\t', rIdx );  // 13
+                const ByteString sTEXT = sLine.getToken( 0, '\t', rIdx ); // 10
+                const ByteString sQHTEXT = sLine.getToken( 1, '\t', rIdx ); // 12
+                const ByteString sTITLE = sLine.getToken( 0, '\t', rIdx );  // 13
 
 
                 if( !nLANG.EqualsIgnoreCaseAscii("en-US") )
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 0a09ad5..0e721ac 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -80,15 +80,16 @@ static const sal_Int16 DIC_VERSION_5 = 5;
 static const sal_Int16 DIC_VERSION_6 = 6;
 static const sal_Int16 DIC_VERSION_7 = 7;
 
-static sal_Bool getTag(const ByteString &rLine,
-        const sal_Char *pTagName, ByteString &rTagValue)
+static bool getTag(const rtl::OString &rLine, const sal_Char *pTagName,
+    rtl::OString &rTagValue)
 {
-    xub_StrLen nPos = rLine.Search( pTagName );
-    if (nPos == STRING_NOTFOUND)
-        return sal_False;
+    sal_Int32 nPos = rLine.indexOf(pTagName);
+    if (nPos == -1)
+        return false;
 
-    rTagValue = comphelper::string::strip(rLine.Copy(nPos + sal::static_int_cast< xub_StrLen >(strlen( pTagName ))), ' ');
-    return sal_True;
+    rTagValue = comphelper::string::strip(rLine.copy(nPos + rtl_str_getLength(pTagName)),
+        ' ');
+    return true;
 }
 
 
@@ -111,7 +112,7 @@ sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNe
         !strcmp(pMagicHeader, pVerOOo7))
     {
         sal_Bool bSuccess;
-        ByteString aLine;
+        rtl::OString aLine;
 
         nDicVersion = DIC_VERSION_7;
 
@@ -121,31 +122,31 @@ sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNe
         // 2nd line: language all | en-US | pt-BR ...
         while (sal_True == (bSuccess = rpStream->ReadLine(aLine)))
         {
-            ByteString aTagValue;
+            rtl::OString aTagValue;
 
-            if (aLine.GetChar(0) == '#') // skip comments
+            if (aLine[0] == '#') // skip comments
                 continue;
 
             // lang: field
             if (getTag(aLine, "lang: ", aTagValue))
             {
-                if (aTagValue == "<none>")
+                if (aTagValue.equalsL(RTL_CONSTASCII_STRINGPARAM("<none>")))
                     nLng = LANGUAGE_NONE;
                 else
-                    nLng = MsLangId::convertIsoStringToLanguage(OUString(aTagValue.GetBuffer(),
-                                aTagValue.Len(), RTL_TEXTENCODING_ASCII_US));
+                    nLng = MsLangId::convertIsoStringToLanguage(rtl::OStringToOUString(
+                        aTagValue, RTL_TEXTENCODING_ASCII_US));
             }
 
             // type: negative / positive
             if (getTag(aLine, "type: ", aTagValue))
             {
-                if (aTagValue == "negative")
+                if (aTagValue.equalsL(RTL_CONSTASCII_STRINGPARAM("negative")))
                     bNeg = sal_True;
                 else
                     bNeg = sal_False;
             }
 
-            if (aLine.Search ("---") != STRING_NOTFOUND) // end of header
+            if (comphelper::string::indexOfL(aLine, RTL_CONSTASCII_STRINGPARAM("---")) != -1) // end of header
                 break;
         }
         if (!bSuccess)
@@ -369,14 +370,14 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL)
     else if (DIC_VERSION_7 == nDicVersion)
     {
         sal_Bool bSuccess;
-        ByteString aLine;
+        rtl::OString aLine;
 
         // remaining lines - stock strings (a [==] b)
         while (sal_True == (bSuccess = pStream->ReadLine(aLine)))
         {
-            if (aLine.GetChar(0) == '#') // skip comments
+            if (aLine[0] == '#') // skip comments
                 continue;
-            rtl::OUString aText = rtl::OStringToOUString (aLine, RTL_TEXTENCODING_UTF8);
+            rtl::OUString aText = rtl::OStringToOUString(aLine, RTL_TEXTENCODING_UTF8);
             uno::Reference< XDictionaryEntry > xEntry =
                     new DicEntry( aText, eDicType == DictionaryType_NEGATIVE );
             addEntry_Impl( xEntry , sal_True ); //! don't launch events here
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 969af58..229b5ce 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -75,6 +75,7 @@ using ::rtl::OStringBuffer;
 using ::rtl::OStringToOUString;
 using comphelper::string::getToken;
 using comphelper::string::getTokenCount;
+using comphelper::string::indexOfL;
 
 /*************** F o r w a r d s *****************************************/
 /*************** G l o b a l e   V a r i a b l e n **********************/
@@ -1149,7 +1150,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
 
     if( !aIStm.GetError() && !aOStm.GetError() )
     {
-        ByteString aLine;
+        rtl::OString aLine;
         rtl::OString aFilePath;
 
         while( aIStm.ReadLine( aLine ) )
@@ -1160,43 +1161,47 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
                 rtl::OString aBaseFileName( getToken(getToken(aLine, 1, '"'), 0, '.') );
 
                 if( GetImageFilePath( rOutputFile, rContext, aBaseFileName, aFilePath, pSysListFile ) )
-                    ( ( aLine = "File = \"" ) += aFilePath ) += "\";";
+                {
+                    aLine = rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM("File = \"")).
+                        append(aFilePath).append(RTL_CONSTASCII_STRINGPARAM("\";")).
+                        makeStringAndClear();
+                }
                 else
                     aMissingImages.push_back( aBaseFileName );
 
-                aOStm.WriteLine( aLine );
+                aOStm.WriteLine(aLine);
             }
-            else if( aLine.Search( "ImageList" ) != STRING_NOTFOUND )
+            else if (indexOfL(aLine, RTL_CONSTASCII_STRINGPARAM("ImageList")) != -1)
             {
                 ::std::vector< ::std::pair< rtl::OString, sal_Int32 > > aEntryVector;
 
-                aOStm.WriteLine( aLine );
+                aOStm.WriteLine(aLine);
 
-                if( aLine.Search( ';' ) == STRING_NOTFOUND )
+                if (aLine.indexOf(';') == -1)
                 {
                     const sal_uInt32 nImgListStartPos = aIStm.Tell();
 
                     do
                     {
-                        if( !aIStm.ReadLine( aLine ) )
+                        if( !aIStm.ReadLine(aLine) )
                             break;
                     }
-                    while( aLine.Search( "Prefix" ) == STRING_NOTFOUND );
+                    while (indexOfL(aLine, RTL_CONSTASCII_STRINGPARAM("Prefix")) == -1);
 
                     const rtl::OString aPrefix( getToken(aLine, 1, '"') );
                     aIStm.Seek( nImgListStartPos );
 
                     do
                     {
-                        if (!aIStm.ReadLine( aLine ) )
+                        if (!aIStm.ReadLine(aLine) )
                             break;
                     }
-                    while( aLine.Search( "IdList" ) == STRING_NOTFOUND );
+                    while (indexOfL(aLine, RTL_CONSTASCII_STRINGPARAM("IdList")) == -1);
 
                     // scan all ids and collect images
-                    while( aLine.Search( '}' ) == STRING_NOTFOUND )
+                    while (aLine.indexOf('}') == -1)
                     {
-                        if( !aIStm.ReadLine( aLine ) )
+                        if( !aIStm.ReadLine(aLine) )
                             break;
 
                         aLine = comphelper::string::stripStart(aLine, ' ');
@@ -1205,7 +1210,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
 
                         if (comphelper::string::isdigitAsciiString(aLine))
                         {
-                            sal_Int32 nNumber = atoi( aLine.GetBuffer() );
+                            sal_Int32 nNumber = atoi(aLine.getStr());
 
                             rtl::OStringBuffer aBuf(aPrefix);
                             if( nNumber < 10000 )
@@ -1226,13 +1231,13 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
                     {
                         aIStm.ReadLine( aLine );
 
-                        if( aLine.Search( "IdList" ) != STRING_NOTFOUND )
+                        if (indexOfL(aLine, RTL_CONSTASCII_STRINGPARAM("IdList")) != -1)
                         {
-                            while( aLine.Search( '}' ) == STRING_NOTFOUND )
-                                aIStm.ReadLine( aLine );
+                            while (aLine.indexOf('}') == -1)
+                                aIStm.ReadLine(aLine);
                         }
                         else
-                            aOStm.WriteLine( aLine );
+                            aOStm.WriteLine(aLine);
                     }
 
                     aOStm.WriteLine(rtl::OString(RTL_CONSTASCII_STRINGPARAM("FileList = {")));
@@ -1253,10 +1258,10 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
                     aOStm.WriteLine(rtl::OString(RTL_CONSTASCII_STRINGPARAM("};")));
                 }
                 else
-                    aOStm.WriteLine( aLine );
+                    aOStm.WriteLine(aLine);
             }
             else
-                aOStm.WriteLine( aLine );
+                aOStm.WriteLine(aLine);
         }
     }
 
diff --git a/svtools/bmpmaker/bmpcore.cxx b/svtools/bmpmaker/bmpcore.cxx
index 5209a92..2a7c709 100644
--- a/svtools/bmpmaker/bmpcore.cxx
+++ b/svtools/bmpmaker/bmpcore.cxx
@@ -93,7 +93,7 @@ void BmpCreator::ImplCreate( const ::std::vector< DirEntry >& rInDirs,
 
     if( !rInDirs.empty() )
     {
-        ByteString                  aLine;
+        rtl::OString                aLine;
         String                      aInfo, aPrefix, aName( rName ), aString;
         SvFileStream                aOutStream;
         BitmapEx                    aTotalBmpEx;
@@ -123,7 +123,7 @@ void BmpCreator::ImplCreate( const ::std::vector< DirEntry >& rInDirs,
         aOutFile += DirEntry( aName );
 
         // get number of bitmaps
-        while( aLine.Search( '}' ) == STRING_NOTFOUND )
+        while( aLine.indexOf('}') == -1 )
         {
             if( !pSRS->ReadLine( aLine ) )
                 break;
@@ -136,11 +136,11 @@ void BmpCreator::ImplCreate( const ::std::vector< DirEntry >& rInDirs,
             {
                 aString = aPrefix;
 
-                if( atoi( aLine.GetBuffer() ) < 10000 )
+                if( atoi( aLine.getStr() ) < 10000 )
                     aString += String::CreateFromInt32( 0 );
 
                 // search for pngs by default
-                String aPngString( aString += String( aLine.GetBuffer(), RTL_TEXTENCODING_UTF8 ) );
+                String aPngString( aString += rtl::OStringToOUString(aLine, RTL_TEXTENCODING_UTF8) );
                 aNameVector.push_back( aPngString += String( RTL_CONSTASCII_USTRINGPARAM( ".png" ) ) );
            }
         }
@@ -361,9 +361,11 @@ void BmpCreator::Create( const String& rSRSName,
     else
     {
         String      aText;
-        ByteString  aByteText;
+        rtl::OString aByteText;
         sal_Bool        bLangDep = sal_False;
 
+        using comphelper::string::indexOfL;
+
         do
         {
             do
@@ -371,24 +373,24 @@ void BmpCreator::Create( const String& rSRSName,
                 if (!pSRS->ReadLine(aByteText))
                     break;
             }
-            while ( aByteText.Search( "ImageList" ) == STRING_NOTFOUND );
+            while ( indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("ImageList")) == -1 );
 
             do
             {
                 if (!pSRS->ReadLine( aByteText ) )
                     break;
             }
-            while ( aByteText.Search( "File" ) == STRING_NOTFOUND );
-            aText = String::CreateFromAscii( aByteText.GetBuffer() );
+            while ( indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("File")) == -1 );
+            aText = rtl::OStringToOUString(aByteText, RTL_TEXTENCODING_ASCII_US);
 
             const String aName( aText.GetToken( 1, '"' ) );
 
             do
             {
                 if( !bLangDep &&
-                    aByteText.Search( "File" ) != STRING_NOTFOUND &&
-                    aByteText.Search( '[' ) != STRING_NOTFOUND &&
-                    aByteText.Search( ']' ) != STRING_NOTFOUND )
+                    indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("File")) != -1 &&
+                    aByteText.indexOf('[') != -1 &&
+                    aByteText.indexOf(']') != -1 )
                 {
                     bLangDep = sal_True;
                 }
@@ -396,8 +398,8 @@ void BmpCreator::Create( const String& rSRSName,
                 if (!pSRS->ReadLine(aByteText))
                     break;
             }
-            while (aByteText.Search( "IdList" ) == STRING_NOTFOUND );
-            aText = String::CreateFromAscii( aByteText.GetBuffer() );
+            while (indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("IdList")) == -1);
+            aText = rtl::OStringToOUString(aByteText, RTL_TEXTENCODING_ASCII_US);
 
             // if image list is not language dependent, don't do anything for languages except german
             if( aText.Len() )
diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx
index ead4930..223f76d 100644
--- a/svtools/bmpmaker/bmpsum.cxx
+++ b/svtools/bmpmaker/bmpsum.cxx
@@ -297,15 +297,15 @@ void BmpSum::ProcessFileList( const String& rInFileList,
 
     if( aIStm.IsOpen() && aOStm.IsOpen() )
     {
-        ByteString                  aReadLine;
+        rtl::OString aReadLine;
         ::std::set< ByteString >    aFileNameSet;
 
         while( aIStm.ReadLine( aReadLine ) )
         {
-            if( aReadLine.Len() )
+            if( !aReadLine.isEmpty() )
                 aFileNameSet.insert( aReadLine );
 
-            if( aReadLine.Search( "enus" ) != STRING_NOTFOUND )
+            if( comphelper::string::indexOfL(aReadLine, RTL_CONSTASCII_STRINGPARAM("enus") ) != -1 )
             {
                 static const char* aLanguages[] =
                 {
@@ -340,7 +340,7 @@ void BmpSum::ProcessFileList( const String& rInFileList,
                 }
             }
 
-            aReadLine.Erase();
+            aReadLine = rtl::OString();
         }
 
         aIStm.Close();
diff --git a/svtools/source/filter/ixbm/xbmread.cxx b/svtools/source/filter/ixbm/xbmread.cxx
index 559f121..3e8bec3 100644
--- a/svtools/source/filter/ixbm/xbmread.cxx
+++ b/svtools/source/filter/ixbm/xbmread.cxx
@@ -101,13 +101,11 @@ void XBMReader::InitTable()
 
 // ------------------------------------------------------------------------
 
-ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
+rtl::OString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
                                  const char* pTok2, const char* pTok3 )
 {
-    ByteString  aRet;
-    long        nPos1;
-    long        nPos2;
-    long        nPos3;
+    rtl::OString aRet;
+    sal_Int32 nPos1, nPos2, nPos3;
 
     bStatus = sal_False;
 
@@ -118,7 +116,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
 
         if( pTok1 )
         {
-            if( ( nPos1 = aRet.Search( pTok1 ) ) != STRING_NOTFOUND )
+            if( ( nPos1 = aRet.indexOf( pTok1 ) ) != -1 )
             {
                 bStatus = sal_True;
 
@@ -126,7 +124,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
                 {
                     bStatus = sal_False;
 
-                    if( ( ( nPos2 = aRet.Search( pTok2 ) ) != STRING_NOTFOUND ) &&
+                    if( ( ( nPos2 = aRet.indexOf( pTok2 ) ) != -1 ) &&
                          ( nPos2 > nPos1 ) )
                     {
                         bStatus = sal_True;
@@ -135,7 +133,7 @@ ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
                         {
                             bStatus = sal_False;
 
-                            if( ( ( nPos3 = aRet.Search( pTok3 ) ) != STRING_NOTFOUND ) && ( nPos3 > nPos2 ) )
+                            if( ( ( nPos3 = aRet.indexOf( pTok3 ) ) != -1 ) && ( nPos3 > nPos2 ) )
                                 bStatus = sal_True;
                         }
                     }
@@ -201,7 +199,7 @@ long XBMReader::ParseDefine( const sal_Char* pDefine )
 
 sal_Bool XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat )
 {
-    ByteString      aLine;
+    rtl::OString    aLine;
     long            nRow = 0;
     long            nCol = 0;
     long            nBits = ( eFormat == XBM10 ) ? 16 : 8;
@@ -214,18 +212,18 @@ sal_Bool XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XB
     {
         if( bFirstLine )
         {
-            xub_StrLen nPos;
+            sal_Int32 nPos;
 
             // einfuehrende geschweifte Klammer loeschen
-            if( (nPos = ( aLine = aLastLine ).Search( '{' ) ) != STRING_NOTFOUND )
-                aLine.Erase( 0, nPos + 1 );
+            if( (nPos = ( aLine = aLastLine ).indexOf('{') ) != -1 )
+                aLine = aLine.copy(nPos + 1);
 
             bFirstLine = sal_False;
         }
         else if( !pInStm->ReadLine( aLine ) )
             break;
 
-        if( aLine.Len() )
+        if (!aLine.isEmpty())
         {
             const sal_Int32 nCount = comphelper::string::getTokenCount(aLine, ',');
 
diff --git a/svtools/source/inc/xbmread.hxx b/svtools/source/inc/xbmread.hxx
index 0e9b178..0bf5136 100644
--- a/svtools/source/inc/xbmread.hxx
+++ b/svtools/source/inc/xbmread.hxx
@@ -69,7 +69,7 @@ class XBMReader : public GraphicReader
     sal_Bool                bStatus;
 
     void                InitTable();
-    ByteString          FindTokenLine( SvStream* pInStm, const char* pTok1,
+    rtl::OString        FindTokenLine( SvStream* pInStm, const char* pTok1,
                                        const char* pTok2 = NULL, const char* pTok3 = NULL );
     long                ParseDefine( const sal_Char* pDefine );
     sal_Bool                ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat );
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 1ebbcb3..5e48f42 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -654,7 +654,7 @@ sal_Bool SvStream::ReadByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSe
     return bRet;
 }
 
-sal_Bool SvStream::ReadLine( ByteString& rStr )
+sal_Bool SvStream::ReadLine(rtl::OString& rStr)
 {
     sal_Char    buf[256+1];
     sal_Bool        bEnd        = sal_False;
@@ -722,9 +722,9 @@ sal_Bool SvStream::ReadLine( ByteString& rStr )
     return bEnd;
 }
 
-sal_Bool SvStream::ReadLine( rtl::OString& rStr )
+sal_Bool SvStream::ReadLine( ByteString& rStr )
 {
-    ByteString aFoo;
+    rtl::OString aFoo;
     sal_Bool ret = ReadLine(aFoo);
     rStr = aFoo;
     return ret;
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 3083803..98bf630 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -296,7 +296,7 @@ class PPDDecompressStream
 
     bool IsOpen() const;
     bool IsEof() const;
-    void ReadLine( ByteString& o_rLine);
+    rtl::OString ReadLine();
     void Open( const rtl::OUString& i_rFile );
     void Close();
     const rtl::OUString& GetFileName() const { return maFileName; }
@@ -378,12 +378,14 @@ bool PPDDecompressStream::IsEof() const
     return ( mpMemStream ? mpMemStream->IsEof() : ( mpFileStream ? mpFileStream->IsEof() : true ) );
 }
 
-void PPDDecompressStream::ReadLine( ByteString& o_rLine )
+rtl::OString PPDDecompressStream::ReadLine()
 {
+    rtl::OString o_rLine;
     if( mpMemStream )
         mpMemStream->ReadLine( o_rLine );
     else if( mpFileStream )
         mpFileStream->ReadLine( o_rLine );
+    return o_rLine;
 }
 
 static osl::FileBase::RC resolveLink( const rtl::OUString& i_rURL, rtl::OUString& o_rResolvedURL, rtl::OUString& o_rBaseName, osl::FileStatus::Type& o_rType, int nLinkLevel = 10 )
@@ -565,8 +567,7 @@ String PPDParser::getPPDFile( const String& rFile )
     String aRet;
     if( aStream.IsOpen() )
     {
-        ByteString aLine;
-        aStream.ReadLine( aLine );
+        ByteString aLine = aStream.ReadLine();
         if( aLine.Search( "*PPD-Adobe" ) == 0 )
             aRet = aStream.GetFileName();
         else
@@ -575,7 +576,7 @@ String PPDParser::getPPDFile( const String& rFile )
             // with *PPD-Adobe, so try some lines for *Include
             int nLines = 10;
             while( aLine.Search( "*Include" ) != 0 && --nLines )
-                aStream.ReadLine( aLine );
+                aLine = aStream.ReadLine();
             if( nLines )
                 aRet = aStream.GetFileName();
         }
@@ -596,9 +597,8 @@ String PPDParser::getPPDPrinterName( const String& rFile )
         String aCurLine;
         while( ! aStream.IsEof() && aStream.IsOpen() )
         {
-            ByteString aByteLine;
-            aStream.ReadLine( aByteLine );
-            aCurLine = String( aByteLine, RTL_TEXTENCODING_MS_1252 );
+            rtl::OString aByteLine = aStream.ReadLine();
+            aCurLine = rtl::OStringToOUString(aByteLine, RTL_TEXTENCODING_MS_1252);
             if( aCurLine.CompareIgnoreCaseToAscii( "*include:", 9 ) == COMPARE_EQUAL )
             {
                 aCurLine.Erase( 0, 9 );
@@ -694,10 +694,9 @@ PPDParser::PPDParser( const String& rFile ) :
     bool bLanguageEncoding = false;
     if( aStream.IsOpen() )
     {
-        ByteString aCurLine;
         while( ! aStream.IsEof() )
         {
-            aStream.ReadLine( aCurLine );
+            ByteString aCurLine = aStream.ReadLine();
             if( aCurLine.GetChar( 0 ) == '*' )
             {
                 if( aCurLine.CompareIgnoreCaseToAscii( "*include:", 9 ) == COMPARE_EQUAL )
commit d3c0bf6c8087c4573b181fc5d01a70cffc17c78f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 14:33:29 2012 +0000

    drop tools/string.hxx include

diff --git a/sd/source/filter/eppt/pptexsoundcollection.cxx b/sd/source/filter/eppt/pptexsoundcollection.cxx
index 00d2047..5b277c3 100644
--- a/sd/source/filter/eppt/pptexsoundcollection.cxx
+++ b/sd/source/filter/eppt/pptexsoundcollection.cxx
@@ -37,9 +37,9 @@
 namespace ppt
 {
 
-ExSoundEntry::ExSoundEntry( const String& rString )
-:   nFileSize( 0 )
-,   aSoundURL( rString )
+ExSoundEntry::ExSoundEntry(const rtl::OUString& rString)
+    : nFileSize(0)
+    , aSoundURL(rString)
 {
     try
     {
@@ -55,13 +55,13 @@ ExSoundEntry::ExSoundEntry( const String& rString )
     }
 };
 
-String ExSoundEntry::ImplGetName() const
+rtl::OUString ExSoundEntry::ImplGetName() const
 {
     INetURLObject aTmp( aSoundURL );
     return aTmp.GetName();
 }
 
-String ExSoundEntry::ImplGetExtension() const
+rtl::OUString ExSoundEntry::ImplGetExtension() const
 {
     INetURLObject aTmp( aSoundURL );
     String aExtension( aTmp.GetExtension() );
@@ -70,24 +70,24 @@ String ExSoundEntry::ImplGetExtension() const
     return aExtension;
 }
 
-sal_Bool ExSoundEntry::IsSameURL( const String& rURL ) const
+sal_Bool ExSoundEntry::IsSameURL(const rtl::OUString& rURL) const
 {
     return ( rURL == aSoundURL );
 }
 
 sal_uInt32 ExSoundEntry::GetSize( sal_uInt32 nId ) const
 {
-    String aName( ImplGetName() );
-    String aExtension( ImplGetExtension() );
+    rtl::OUString aName( ImplGetName() );
+    rtl::OUString aExtension( ImplGetExtension() );
 
     sal_uInt32 nSize = 8;                           // SoundContainer Header
-    if ( aName.Len() )                              // String Atom          ( instance 0 - name of sound )
-        nSize += aName.Len() * 2 + 8;
-    if ( aExtension.Len() )                         // String Atom          ( instance 1 - extension of sound )
-        nSize += aExtension.Len() * 2 + 8;
+    if ( !aName.isEmpty() )                         // String Atom          ( instance 0 - name of sound )
+        nSize += aName.getLength() * 2 + 8;
+    if ( !aExtension.isEmpty() )                    // String Atom          ( instance 1 - extension of sound )
+        nSize += aExtension.getLength() * 2 + 8;
 
-    String aId( String::CreateFromInt32( nId ) );   // String Atom          ( instance 2 - reference id )
-    nSize += 2 * aId.Len() + 8;
+    rtl::OUString aId( rtl::OUString::valueOf(static_cast<sal_Int32>(nId)) );   // String Atom          ( instance 2 - reference id )
+    nSize += 2 * aId.getLength() + 8;
 
     nSize += nFileSize + 8;                         // SoundData Atom
 
@@ -104,30 +104,30 @@ void ExSoundEntry::Write( SvStream& rSt, sal_uInt32 nId ) const
         // create SoundContainer
         rSt << (sal_uInt32)( ( EPP_Sound << 16 ) | 0xf ) << (sal_uInt32)( GetSize( nId ) - 8 );
 
-        String aSoundName( ImplGetName() );
-        sal_uInt16 i, nSoundNameLen = aSoundName.Len();
+        rtl::OUString aSoundName( ImplGetName() );
+        sal_Int32 i, nSoundNameLen = aSoundName.getLength();
         if ( nSoundNameLen )
         {
             // name of sound ( instance 0 )
             rSt << (sal_uInt32)( EPP_CString << 16 ) << (sal_uInt32)( nSoundNameLen * 2 );
-            for ( i = 0; i < nSoundNameLen; i++ )
-                rSt << aSoundName.GetChar( i );
+            for ( i = 0; i < nSoundNameLen; ++i )
+                rSt << aSoundName[i];
         }
-        String aExtension( ImplGetExtension() );
-        sal_uInt32 nExtensionLen = aExtension.Len();
+        rtl::OUString aExtension( ImplGetExtension() );
+        sal_Int32 nExtensionLen = aExtension.getLength();
         if ( nExtensionLen )
         {
             // extension of sound ( instance 1 )
             rSt << (sal_uInt32)( ( EPP_CString << 16 ) | 16 ) << (sal_uInt32)( nExtensionLen * 2 );
-            for ( i = 0; i < nExtensionLen; i++ )
-                rSt << aExtension.GetChar( i );
+            for ( i = 0; i < nExtensionLen; ++i )
+                rSt << aExtension[i];
         }
         // id of sound ( instance 2 )
-        String aId( String::CreateFromInt32( nId ) );
-        sal_uInt32 nIdLen = aId.Len();
+        rtl::OUString aId( rtl::OUString::valueOf(static_cast<sal_Int32>(nId) ) );
+        sal_Int32 nIdLen = aId.getLength();
         rSt << (sal_uInt32)( ( EPP_CString << 16 ) | 32 ) << (sal_uInt32)( nIdLen * 2 );
-        for ( i = 0; i < nIdLen; i++ )
-            rSt << aId.GetChar( i );
+        for ( i = 0; i < nIdLen; ++i )
+            rSt << aId[i];
 
         rSt << (sal_uInt32)( EPP_SoundData << 16 ) << (sal_uInt32)( nFileSize );
         sal_uInt32 nBytesLeft = nFileSize;
@@ -152,10 +152,10 @@ void ExSoundEntry::Write( SvStream& rSt, sal_uInt32 nId ) const
     }
 }
 
-sal_uInt32 ExSoundCollection::GetId( const String& rString )
+sal_uInt32 ExSoundCollection::GetId(const rtl::OUString& rString)
 {
     sal_uInt32 nSoundId = 0;
-    if( rString.Len() )
+    if (!rString.isEmpty())
     {
         const sal_uInt32 nSoundCount = maEntries.size();
         boost::ptr_vector<ExSoundEntry>::const_iterator iter;
diff --git a/sd/source/filter/eppt/pptexsoundcollection.hxx b/sd/source/filter/eppt/pptexsoundcollection.hxx
index cc7eaa8..f9f1c58 100644
--- a/sd/source/filter/eppt/pptexsoundcollection.hxx
+++ b/sd/source/filter/eppt/pptexsoundcollection.hxx
@@ -34,7 +34,7 @@
 #ifdef DBG_ANIM_LOG
 #include <stdio.h>
 #endif
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
 #include <tools/stream.hxx>
 
 namespace ppt
@@ -43,17 +43,17 @@ namespace ppt
 class ExSoundEntry
 {
         sal_uInt32              nFileSize;
-        String                  aSoundURL;
+        rtl::OUString           aSoundURL;
 
-        String                  ImplGetName() const;
-        String                  ImplGetExtension() const;
+        rtl::OUString           ImplGetName() const;
+        rtl::OUString           ImplGetExtension() const;
 
     public :
 
-        sal_Bool                IsSameURL( const String& rURL ) const;
+        sal_Bool                IsSameURL(const rtl::OUString& rURL) const;
         sal_uInt32              GetFileSize( ) const { return nFileSize; };
 
-                                ExSoundEntry( const String& rSoundURL );
+                                ExSoundEntry(const rtl::OUString& rSoundURL);
 
         // returns the size of a complete SoundContainer
         sal_uInt32              GetSize( sal_uInt32 nId ) const;
@@ -64,7 +64,7 @@ class ExSoundCollection
 {
     public:
 
-        sal_uInt32              GetId( const String& );
+        sal_uInt32              GetId(const rtl::OUString&);
 
         // returns the size of a complete SoundCollectionContainer
         sal_uInt32              GetSize() const;
commit 3e41fd078144094913ed62ae7fce5b91c820f98f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 13:13:30 2012 +0000

    can replace all PLACEHOLDER_PATH tokens

diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index b464c1c..6d2b6b6 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -81,9 +81,9 @@
 #include <comphelper/configurationhelper.hxx>
 #include <comphelper/mediadescriptor.hxx>
 #include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/string.hxx>
 #include <vcl/svapp.hxx>
 #include <unotools/pathoptions.hxx>
-#include <tools/string.hxx>
 #include <tools/diagnose_ex.h>
 #include <unotools/tempfile.hxx>
 #include <ucbhelper/content.hxx>
@@ -3486,7 +3486,7 @@ void AutoRecovery::impl_showFullDiscError()
     rtl::OUString PLACEHOLDER_PATH(RTL_CONSTASCII_USTRINGPARAM("%PATH"));
 
     rtl::OUString sBtn(ResId::toString(FwkResId(STR_FULL_DISC_RETRY_BUTTON)));
-    String sMsg(ResId::toString(FwkResId(STR_FULL_DISC_MSG)));
+    rtl::OUString sMsg(ResId::toString(FwkResId(STR_FULL_DISC_MSG)));
 
     rtl::OUString sBackupURL(SvtPathOptions().GetBackupPath());
     INetURLObject aConverter(sBackupURL);
@@ -3494,9 +3494,8 @@ void AutoRecovery::impl_showFullDiscError()
     rtl::OUString sBackupPath = aConverter.getFSysPath(INetURLObject::FSYS_DETECT, &aDelimiter);
     if (sBackupPath.getLength() < 1)
         sBackupPath = sBackupURL;
-    sMsg.SearchAndReplace(PLACEHOLDER_PATH, sBackupPath);
 
-    ErrorBox dlgError(0, WB_OK, sMsg);
+    ErrorBox dlgError(0, WB_OK, comphelper::string::replace(sMsg, PLACEHOLDER_PATH, sBackupPath));
     dlgError.SetButtonText(dlgError.GetButtonId(0), sBtn);
     dlgError.Execute();
 }
commit eb8e39f2a4cd21033d020a9e9919e1cb29d182c7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 11:07:04 2012 +0000

    make svx ByteString free

diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 0ac9fab..4bfacb4 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -573,25 +573,42 @@ rtl::OUString Gallery::GetThemeName( sal_uIntPtr nThemeId ) const
     // try fallback, if no entry was found
     if( !pFound )
     {
-        ByteString      aFallback;
+        rtl::OString aFallback;
 
         switch( nThemeId )
         {
-            case( GALLERY_THEME_3D ): aFallback = "3D"; break;
-            case( GALLERY_THEME_BULLETS ): aFallback = "Bullets"; break;
-            case( GALLERY_THEME_HOMEPAGE ): aFallback = "Homepage"; break;
-            case( GALLERY_THEME_HTMLBUTTONS ): aFallback = "private://gallery/hidden/HtmlExportButtons"; break;
-            case( GALLERY_THEME_POWERPOINT ): aFallback = "private://gallery/hidden/imgppt"; break;
-            case( GALLERY_THEME_FONTWORK ): aFallback = "private://gallery/hidden/fontwork"; break;
-            case( GALLERY_THEME_FONTWORK_VERTICAL ): aFallback = "private://gallery/hidden/fontworkvertical"; break;
-            case( GALLERY_THEME_RULERS ): aFallback = "Rulers"; break;
-            case( GALLERY_THEME_SOUNDS ): aFallback = "Sounds"; break;
-
+            case( GALLERY_THEME_3D ):
+                aFallback = rtl::OString(RTL_CONSTASCII_STRINGPARAM("3D"));
+                break;
+            case( GALLERY_THEME_BULLETS ):
+                aFallback = rtl::OString(RTL_CONSTASCII_STRINGPARAM("Bullets"));
+                break;
+            case( GALLERY_THEME_HOMEPAGE ):
+                aFallback = rtl::OString(RTL_CONSTASCII_STRINGPARAM("Homepage"));
+                break;
+            case( GALLERY_THEME_HTMLBUTTONS ):
+                aFallback = rtl::OString(RTL_CONSTASCII_STRINGPARAM("private://gallery/hidden/HtmlExportButtons"));
+                break;
+            case( GALLERY_THEME_POWERPOINT ):
+                aFallback = rtl::OString(RTL_CONSTASCII_STRINGPARAM("private://gallery/hidden/imgppt"));
+                break;
+            case( GALLERY_THEME_FONTWORK ):
+                aFallback = rtl::OString(RTL_CONSTASCII_STRINGPARAM("private://gallery/hidden/fontwork"));
+                break;
+            case( GALLERY_THEME_FONTWORK_VERTICAL ):
+                aFallback = rtl::OString(RTL_CONSTASCII_STRINGPARAM("private://gallery/hidden/fontworkvertical"));
+                break;
+            case( GALLERY_THEME_RULERS ):
+                aFallback = rtl::OString(RTL_CONSTASCII_STRINGPARAM("Rulers"));
+                break;
+            case( GALLERY_THEME_SOUNDS ):
+                aFallback = rtl::OString(RTL_CONSTASCII_STRINGPARAM("Sounds"));
+                break;
             default:
-            break;
+                break;
         }
 
-        pFound = ( (Gallery*) this )->ImplGetThemeEntry( String::CreateFromAscii( aFallback.GetBuffer() ) );
+        pFound = const_cast<Gallery*>(this)->ImplGetThemeEntry(rtl::OStringToOUString(aFallback, RTL_TEXTENCODING_ASCII_US));
     }
 
     return( pFound ? pFound->GetThemeName() : rtl::OUString() );
diff --git a/svx/source/inc/trace.hxx b/svx/source/inc/trace.hxx
index aecfab7..1164294 100644
--- a/svx/source/inc/trace.hxx
+++ b/svx/source/inc/trace.hxx
@@ -38,7 +38,7 @@
 
 class Tracer
 {
-    ByteString m_sBlockDescription;
+    rtl::OString m_sBlockDescription;
 
     DECLARE_STL_STDKEY_MAP( ::oslThreadIdentifier, sal_Int32, MapThreadId2Int );
     static MapThreadId2Int s_aThreadIndents;
commit 210d239b87326a942dd73f507e642f0dde3da16b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 08:04:44 2012 +0000

    make drawinglayer ByteString free

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 9942574..9fc679e 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -967,9 +967,9 @@ namespace drawinglayer
                     // support for FIELD_SEQ_BEGIN, FIELD_SEQ_END and URL. It wraps text primitives (but is not limited to)
                     // thus do the MetafileAction embedding stuff but just handle recursively.
                     const primitive2d::TextHierarchyFieldPrimitive2D& rFieldPrimitive = static_cast< const primitive2d::TextHierarchyFieldPrimitive2D& >(rCandidate);
-                    static const ByteString aCommentStringCommon("FIELD_SEQ_BEGIN");
-                    static const ByteString aCommentStringPage("FIELD_SEQ_BEGIN;PageField");
-                    static const ByteString aCommentStringEnd("FIELD_SEQ_END");
+                    const rtl::OString aCommentStringCommon(RTL_CONSTASCII_STRINGPARAM("FIELD_SEQ_BEGIN"));
+                    const rtl::OString aCommentStringPage(RTL_CONSTASCII_STRINGPARAM("FIELD_SEQ_BEGIN;PageField"));
+                    const rtl::OString aCommentStringEnd(RTL_CONSTASCII_STRINGPARAM("FIELD_SEQ_END"));
 
                     switch(rFieldPrimitive.getType())
                     {
@@ -1018,7 +1018,7 @@ namespace drawinglayer
                 case PRIMITIVE2D_ID_TEXTHIERARCHYLINEPRIMITIVE2D :
                 {
                     const primitive2d::TextHierarchyLinePrimitive2D& rLinePrimitive = static_cast< const primitive2d::TextHierarchyLinePrimitive2D& >(rCandidate);
-                    static const ByteString aCommentString("XTEXT_EOL");
+                    const rtl::OString aCommentString(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOL"));
 
                     // process recursively and add MetaFile comment
                     process(rLinePrimitive.get2DDecomposition(getViewInformation2D()));
@@ -1031,7 +1031,7 @@ namespace drawinglayer
                     // in Outliner::PaintBullet(), a MetafileComment for bullets is added, too. The
                     // "XTEXT_EOC" is used, use here, too.
                     const primitive2d::TextHierarchyBulletPrimitive2D& rBulletPrimitive = static_cast< const primitive2d::TextHierarchyBulletPrimitive2D& >(rCandidate);
-                    static const ByteString aCommentString("XTEXT_EOC");
+                    const rtl::OString aCommentString(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOC"));
 
                     // process recursively and add MetaFile comment
                     process(rBulletPrimitive.get2DDecomposition(getViewInformation2D()));
@@ -1042,7 +1042,7 @@ namespace drawinglayer
                 case PRIMITIVE2D_ID_TEXTHIERARCHYPARAGRAPHPRIMITIVE2D :
                 {
                     const primitive2d::TextHierarchyParagraphPrimitive2D& rParagraphPrimitive = static_cast< const primitive2d::TextHierarchyParagraphPrimitive2D& >(rCandidate);
-                    static const ByteString aCommentString("XTEXT_EOP");
+                    const rtl::OString aCommentString(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOP"));
 
                     if(mpPDFExtOutDevData)
                     {
@@ -1065,8 +1065,8 @@ namespace drawinglayer
                 case PRIMITIVE2D_ID_TEXTHIERARCHYBLOCKPRIMITIVE2D :
                 {
                     const primitive2d::TextHierarchyBlockPrimitive2D& rBlockPrimitive = static_cast< const primitive2d::TextHierarchyBlockPrimitive2D& >(rCandidate);
-                    static const ByteString aCommentStringA("XTEXT_PAINTSHAPE_BEGIN");
-                    static const ByteString aCommentStringB("XTEXT_PAINTSHAPE_END");
+                    const rtl::OString aCommentStringA(RTL_CONSTASCII_STRINGPARAM("XTEXT_PAINTSHAPE_BEGIN"));
+                    const rtl::OString aCommentStringB(RTL_CONSTASCII_STRINGPARAM("XTEXT_PAINTSHAPE_END"));
 
                     // add MetaFile comment, process recursively and add MetaFile comment
                     mpMetaFile->AddAction(new MetaCommentAction(aCommentStringA));
@@ -1115,9 +1115,9 @@ namespace drawinglayer
                                 sal_Int32 nNextCellBreak(mxBreakIterator->nextCharacters(rTxt, nTextPosition, rLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, 0, nDone));
                                 ::com::sun::star::i18n::Boundary nNextWordBoundary(mxBreakIterator->getWordBoundary(rTxt, nTextPosition, rLocale, ::com::sun::star::i18n::WordType::ANY_WORD, sal_True));
                                 sal_Int32 nNextSentenceBreak(mxBreakIterator->endOfSentence(rTxt, nTextPosition, rLocale));
-                                static const ByteString aCommentStringA("XTEXT_EOC");
-                                static const ByteString aCommentStringB("XTEXT_EOW");
-                                static const ByteString aCommentStringC("XTEXT_EOS");
+                                const rtl::OString aCommentStringA(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOC"));
+                                const rtl::OString aCommentStringB(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOW"));
+                                const rtl::OString aCommentStringC(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOS"));
 
                                 for(sal_Int32 i(nTextPosition); i < nTextPosition + nTextLength; i++)
                                 {
commit 8ab3795596da25fbb18de8cfb8632d4956a256ec
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 07:58:45 2012 +0000

    make shell ByteString free

diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx
index 91f270e..5b2ecb2 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -327,7 +327,7 @@ typedef std::map< unsigned short , std::string , std::less< unsigned short > > s
 
 void add_group_entries(
     Config& aConfig,
-    const ByteString& GroupName,
+    const rtl::OString& GroupName,
     Substitutor& Substitutor)
 {
     OSL_ASSERT(aConfig.HasGroup(GroupName));
@@ -338,8 +338,8 @@ void add_group_entries(
 
     for (size_t i = 0; i < key_count; i++)
     {
-        ByteString iso_lang = aConfig.GetKeyName(sal::static_int_cast<sal_uInt16>(i));
-        ByteString key_value_utf8 = aConfig.ReadKey(sal::static_int_cast<sal_uInt16>(i));
+        rtl::OString iso_lang = aConfig.GetKeyName(sal::static_int_cast<sal_uInt16>(i));
+        rtl::OString key_value_utf8 = aConfig.ReadKey(sal::static_int_cast<sal_uInt16>(i));
         iso_lang_identifier myiso_lang( iso_lang );
         LanguageType ltype = MsLangId::convertIsoNamesToLanguage(myiso_lang.language(), myiso_lang.country());
         if(  ( ltype & 0x0200 ) == 0 && map[ ltype ].empty()  )
@@ -352,14 +352,14 @@ void add_group_entries(
                 rtl::OStringToOUString(key_value_utf8, RTL_TEXTENCODING_UTF8);
 
             Substitutor.add_substitution(
-                GroupName.GetBuffer(), make_winrc_unicode_string(key_value_utf16));
-            map[ static_cast<unsigned short>(ltype) ] = std::string( iso_lang.GetBuffer() );
+                GroupName.getStr(), make_winrc_unicode_string(key_value_utf16));
+            map[ static_cast<unsigned short>(ltype) ] = std::string( iso_lang.getStr() );
         }
         else
         {
             if( !map[ ltype ].empty() )
             {
-                printf("ERROR: Duplicated ms id %d found for the languages %s and %s !!!! This does not work in microsoft resources\nPlease remove one!\n", ltype , map[ ltype ].c_str() , iso_lang.GetBuffer());
+                printf("ERROR: Duplicated ms id %d found for the languages %s and %s !!!! This does not work in microsoft resources\nPlease remove one!\n", ltype , map[ ltype ].c_str() , iso_lang.getStr());
                 exit( -1 );
             }
         }
commit 61eb66bd2d03b45a6ed45c0acf2e202643d62559
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 07:46:10 2012 +0000

    make starmath ByteString free

diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index 49002fb..4423133 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -60,9 +60,8 @@ struct assertion_traits<String>
 
     static std::string toString(const String& x)
     {
-        std::string text = ByteString(x, RTL_TEXTENCODING_UTF8).GetBuffer();
         OStringStream ost;
-        ost << text;
+        ost << rtl::OUStringToOString(x, RTL_TEXTENCODING_UTF8).getStr();
         return ost.str();
     }
 };
commit e07f5b0fb48b6a719258dfe69419330ca2a5dfec
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 07:39:18 2012 +0000

    make oox ByteString free

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index cfe4bf0..0d4c3fa 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -64,6 +64,7 @@
 #include <com/sun/star/text/XTextContent.hpp>
 #include <com/sun/star/text/XTextField.hpp>
 #include <com/sun/star/text/XTextRange.hpp>
+#include <comphelper/string.hxx>
 #include <tools/stream.hxx>
 #include <tools/string.hxx>
 #include <vcl/cvtgrf.hxx>
@@ -447,15 +448,16 @@ void DrawingML::WriteOutline( Reference< XPropertySet > rXPropSet )
 
 OUString DrawingML::WriteImage( const OUString& rURL )
 {
-    ByteString aURLBS(rtl::OUStringToOString(rURL, RTL_TEXTENCODING_UTF8));
+    rtl::OString aURLBS(rtl::OUStringToOString(rURL, RTL_TEXTENCODING_UTF8));
 
     const char aURLBegin[] = "vnd.sun.star.GraphicObject:";
-    int index = aURLBS.Search( aURLBegin );
+    using comphelper::string::indexOfL;
+    sal_Int32 index = indexOfL(aURLBS, RTL_CONSTASCII_STRINGPARAM(aURLBegin));
 
-    if ( index != STRING_NOTFOUND ) {
-        DBG(printf ("begin: %ld %s\n", long( sizeof( aURLBegin ) ), USS( rURL ) + sizeof( aURLBegin ) - 1 ));
-        aURLBS.Erase( 0, sizeof( aURLBegin ) - 1 );
-        Graphic aGraphic = GraphicObject( aURLBS ).GetTransformedGraphic ();
+    if ( index != -1 )
+    {
+        DBG(printf ("begin: %ld %s\n", long( sizeof( aURLBegin ) ), USS( rURL ) + RTL_CONSTASCII_LENGTH( aURLBegin ) ));
+        Graphic aGraphic = GraphicObject( aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin)) ).GetTransformedGraphic ();
 
         return WriteImage( aGraphic );
     } else {
commit fba010a77757d0724a0da4a902e78f17cdf15b65
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 07:29:33 2012 +0000

    make sot ByteString free

diff --git a/idl/inc/object.hxx b/idl/inc/object.hxx
index 6690f82..5319f41 100644
--- a/idl/inc/object.hxx
+++ b/idl/inc/object.hxx
@@ -102,7 +102,7 @@ class SvMetaClass : public SvMetaType
 
     void                InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>& rSuperList,
                                     SvMetaClassList & rClassList,
-                                    const ByteString & rPrefix, SvIdlDataBase& rBase );
+                                    const rtl::OString& rPrefix, SvIdlDataBase& rBase );
 
 protected:
     virtual void    ReadAttributesSvIdl( SvIdlDataBase & rBase,
diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx
index 6d5f398..a1f0ed2 100644
--- a/idl/source/cmptools/lex.cxx
+++ b/idl/source/cmptools/lex.cxx
@@ -339,13 +339,13 @@ sal_Bool SvTokenStream::MakeToken( SvToken & rToken )
             aBuf.append(static_cast<char>(c));
             c = GetFastNextChar();
         }
-        ByteString aStr = aBuf.makeStringAndClear();
-        if( aStr.EqualsIgnoreCaseAscii( aStrTrue ) )
+        rtl::OString aStr = aBuf.makeStringAndClear();
+        if( aStr.equalsIgnoreAsciiCase( aStrTrue ) )
         {
             rToken.nType = SVTOKEN_BOOL;
             rToken.bBool = sal_True;
         }
-        else if( aStr.EqualsIgnoreCaseAscii( aStrFalse ) )
+        else if( aStr.equalsIgnoreAsciiCase( aStrFalse ) )
         {
             rToken.nType = SVTOKEN_BOOL;
             rToken.bBool = sal_False;
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index 30d9360..8313db1 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -471,7 +471,7 @@ sal_uInt16 SvMetaClass::WriteSlots( const ByteString & rShellName,
 
 void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>& rSuperList,
                             SvMetaClassList &rClassList,
-                            const ByteString & rPrefix, SvIdlDataBase& rBase)
+                            const rtl::OString& rPrefix, SvIdlDataBase& rBase)
 {
     // was this class already written?
     for ( size_t i = 0, n = rClassList.size(); i < n ; ++i )
@@ -589,7 +589,7 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
     std::vector<sal_uLong> aSuperList;
     SvMetaClassList classList;
     SvSlotElementList aSlotList;
-    InsertSlots(aSlotList, aSuperList, classList, ByteString(), rBase);
+    InsertSlots(aSlotList, aSuperList, classList, rtl::OString(), rBase);
     for ( size_t i = 0, n = aSlotList.size(); i < n; ++i )
     {
         SvSlotElement *pEle = aSlotList[ i ];
@@ -703,16 +703,16 @@ void SvMetaClass::WriteCxx( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 )
         aSuperName = GetSuperClass()->GetName().getString();
     const char * pSup = aSuperName.getStr();
 
-    ByteString name = GetSvName();
+    rtl::OString name = GetSvName();
     // GetTypeName
-    rOutStm << "SvGlobalName " << name.GetBuffer() << "::GetTypeName() const" << endl
+    rOutStm << "SvGlobalName " << name.getStr() << "::GetTypeName() const" << endl
     << '{' << endl
     << "\treturn ClassName();" << endl
     << '}' << endl;
 
     SvMetaModule * pMod = GetModule();
     // FillTypeLibInfo
-    rOutStm << "sal_Bool " << name.GetBuffer() << "::FillTypeLibInfo( SvGlobalName * pGN," << endl
+    rOutStm << "sal_Bool " << name.getStr() << "::FillTypeLibInfo( SvGlobalName * pGN," << endl
     << "\t                               sal_uInt16 * pMajor," << endl
     << "\t                               sal_uInt16 * pMinor ) const" << endl
     << '{' << endl
@@ -728,7 +728,7 @@ void SvMetaClass::WriteCxx( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 )
     << '}' << endl;
 
     // FillTypeLibInfo
-    rOutStm << "sal_Bool " << name.GetBuffer() << "::FillTypeLibInfo( ByteString * pName,"
+    rOutStm << "sal_Bool " << name.getStr() << "::FillTypeLibInfo( ByteString * pName,"
     << "\t                               sal_uInt16 * pMajor," << endl
     << "\t                               sal_uInt16 * pMinor ) const" << endl;
     rOutStm << '{' << endl
@@ -742,7 +742,7 @@ void SvMetaClass::WriteCxx( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 )
     << "\treturn sal_True;" << endl
     << '}' << endl;
 
-    rOutStm << "void " << name.GetBuffer() << "::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )" << endl
+    rOutStm << "void " << name.getStr() << "::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )" << endl
     << '{' << endl
     << "\t" << pSup << "::Notify( rBC, rHint );" << endl
     << '}' << endl;
diff --git a/sot/inc/sot/stg.hxx b/sot/inc/sot/stg.hxx
index c8d18da..cb447e3 100644
--- a/sot/inc/sot/stg.hxx
+++ b/sot/inc/sot/stg.hxx
@@ -121,7 +121,7 @@ public:
     virtual sal_Bool                Revert() = 0;
     virtual BaseStorageStream*  OpenStream( const String & rEleName,
                                   StreamMode = STREAM_STD_READWRITE,
-                                  sal_Bool bDirect = sal_True, const ByteString* pKey=0 ) = 0;
+                                  sal_Bool bDirect = sal_True, const rtl::OString* pKey=0 ) = 0;
     virtual BaseStorage*        OpenStorage( const String & rEleName,
                                    StreamMode = STREAM_STD_READWRITE,
                                    sal_Bool bDirect = sal_False ) = 0;
@@ -221,7 +221,7 @@ public:
     virtual sal_Bool                Revert();
     virtual BaseStorageStream*  OpenStream( const String & rEleName,
                                   StreamMode = STREAM_STD_READWRITE,
-                                  sal_Bool bDirect = sal_True, const ByteString* pKey=0 );
+                                  sal_Bool bDirect = sal_True, const rtl::OString* pKey=0 );
     virtual BaseStorage*        OpenStorage( const String & rEleName,
                                        StreamMode = STREAM_STD_READWRITE,
                                        sal_Bool bDirect = sal_False );
@@ -257,7 +257,7 @@ protected:
                                 ~UCBStorageStream();
 public:
                                 TYPEINFO();
-                                UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress );
+                                UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const rtl::OString* pKey, sal_Bool bRepair, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler > xProgress );
                                 UCBStorageStream( UCBStorageStream_Impl* );
 
     virtual sal_uLong               Read( void * pData, sal_uLong nSize );
@@ -340,7 +340,7 @@ public:
     virtual sal_Bool                Revert();
     virtual BaseStorageStream*  OpenStream( const String & rEleName,
                                   StreamMode = STREAM_STD_READWRITE,
-                                  sal_Bool bDirect = sal_True, const ByteString* pKey=0 );
+                                  sal_Bool bDirect = sal_True, const rtl::OString* pKey=0 );
     virtual BaseStorage*        OpenStorage( const String & rEleName,
                                        StreamMode = STREAM_STD_READWRITE,
                                        sal_Bool bDirect = sal_False );
diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx
index 26258bc..2057bac 100644
--- a/sot/inc/sot/storage.hxx
+++ b/sot/inc/sot/storage.hxx
@@ -124,7 +124,7 @@ friend class ::binfilter::SvStorage;
     String      m_aName;      // Name des Storage
     sal_Bool        m_bIsRoot:1,  // z.B.: File-Storage
                 m_bDelStm:1;
-    ByteString  m_aKey;           // aKey.Len != 0  -> Verschluesselung
+    rtl::OString m_aKey;           // aKey.Len != 0  -> Verschluesselung
     long        m_nVersion;
 
 protected:
@@ -155,8 +155,8 @@ public:
 
     virtual sal_Bool        Validate();
 
-    void                SetKey( const ByteString& rKey );
-    const ByteString &  GetKey() const { return m_aKey; }
+    void                SetKey( const rtl::OString& rKey );
+    const rtl::OString& GetKey() const { return m_aKey; }
 
     void                SetVersion( long nVers )
                         {
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx
index 4c4be65..944b8c9 100644
--- a/sot/source/sdstor/stg.cxx
+++ b/sot/source/sdstor/stg.cxx
@@ -626,7 +626,7 @@ BaseStorage* Storage::OpenStorage( const String& rName, StreamMode m, sal_Bool b
 // Open a stream
 
 BaseStorageStream* Storage::OpenStream( const String& rName, StreamMode m, sal_Bool,
-const ByteString*
+const rtl::OString*
 #ifdef DBG_UTIL
 pB
 #endif
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index 478f649..8b7cb30 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -1219,13 +1219,13 @@ sal_Bool SotStorage::IsOLEStorage( SvStream* pStream )
     return Storage::IsStorageFile( pStream );
 }
 
-void SotStorage::SetKey( const ByteString& rKey )
+void SotStorage::SetKey( const rtl::OString& rKey )
 {
     m_aKey = rKey;
     if ( !IsOLEStorage() )
     {
         sal_uInt8 aBuffer[RTL_DIGEST_LENGTH_SHA1];
-        rtlDigestError nError = rtl_digest_SHA1( m_aKey.GetBuffer(), m_aKey.Len(), aBuffer, RTL_DIGEST_LENGTH_SHA1 );
+        rtlDigestError nError = rtl_digest_SHA1( m_aKey.getStr(), m_aKey.getLength(), aBuffer, RTL_DIGEST_LENGTH_SHA1 );
         if ( nError == rtl_Digest_E_None )
         {
             sal_uInt8* pBuffer = aBuffer;
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index dc21316..215c42b 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -52,6 +52,8 @@
 #include <com/sun/star/packages/manifest/XManifestReader.hpp>
 #include <com/sun/star/ucb/InteractiveIOException.hpp>
 
+#include <comphelper/string.hxx>
+
 #include <rtl/digest.h>
 #include <tools/ref.hxx>
 #include <tools/debug.hxx>
@@ -429,7 +431,7 @@ public:
     String                      m_aURL;         // the full path name to create the content
     String                      m_aContentType;
     String                      m_aOriginalContentType;
-    ByteString                  m_aKey;
+    rtl::OString                m_aKey;
     ::ucbhelper::Content*       m_pContent;     // the content that provides the data
     Reference<XInputStream>     m_rSource;      // the stream covering the original data of the content
     SvStream*                   m_pStream;      // the stream worked on; for readonly streams it is the original stream of the content
@@ -446,7 +448,7 @@ public:
                                                 // reference is destroyed
     sal_Bool                        m_bIsOLEStorage;// an OLEStorage on a UCBStorageStream makes this an Autocommit-stream
 
-                                UCBStorageStream_Impl( const String&, StreamMode, UCBStorageStream*, sal_Bool, const ByteString* pKey=0, sal_Bool bRepair = sal_False, Reference< XProgressHandler > xProgress = Reference< XProgressHandler >() );
+                                UCBStorageStream_Impl( const String&, StreamMode, UCBStorageStream*, sal_Bool, const rtl::OString* pKey=0, sal_Bool bRepair = sal_False, Reference< XProgressHandler > xProgress = Reference< XProgressHandler >() );
 
     void                        Free();
     sal_Bool                        Init();
@@ -518,7 +520,7 @@ public:
     sal_Bool                        Revert();
     sal_Bool                        Insert( ::ucbhelper::Content *pContent );
     UCBStorage_Impl*            OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect );
-    UCBStorageStream_Impl*      OpenStream( UCBStorageElement_Impl*, StreamMode, sal_Bool, const ByteString* pKey=0 );
+    UCBStorageStream_Impl*      OpenStream( UCBStorageElement_Impl*, StreamMode, sal_Bool, const rtl::OString* pKey=0 );
     void                        SetProps( const Sequence < Sequence < PropertyValue > >& rSequence, const String& );
     void                        GetProps( sal_Int32&, Sequence < Sequence < PropertyValue > >& rSequence, const String& );
     sal_Int32                   GetObjectCount();
@@ -642,7 +644,7 @@ sal_Bool UCBStorageElement_Impl::IsModified()
     return bModified;
 }
 
-UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nMode, UCBStorageStream* pStream, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress  )
+UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nMode, UCBStorageStream* pStream, sal_Bool bDirect, const rtl::OString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress  )
     : m_pAntiImpl( pStream )
     , m_aURL( rName )
     , m_pContent( NULL )
@@ -681,7 +683,7 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nM
 
             // stream is encrypted and should be decrypted (without setting the key we'll get the raw data)
             sal_uInt8 aBuffer[RTL_DIGEST_LENGTH_SHA1];
-            rtlDigestError nErr = rtl_digest_SHA1( pKey->GetBuffer(), pKey->Len(), aBuffer, RTL_DIGEST_LENGTH_SHA1 );
+            rtlDigestError nErr = rtl_digest_SHA1( pKey->getStr(), pKey->getLength(), aBuffer, RTL_DIGEST_LENGTH_SHA1 );
             if ( nErr == rtl_Digest_E_None )
             {
                 sal_uInt8* pBuffer = aBuffer;
@@ -692,12 +694,12 @@ UCBStorageStream_Impl::UCBStorageStream_Impl( const String& rName, StreamMode nM
             }
         }
     }
-    catch ( ContentCreationException& )
+    catch (const ContentCreationException&)
     {
         // content could not be created
         SetError( SVSTREAM_CANNOT_MAKE );
     }
-    catch ( RuntimeException& )
+    catch (const RuntimeException&)
     {
         // any other error - not specified
         SetError( ERRCODE_IO_GENERAL );
@@ -761,7 +763,7 @@ Reference<XInputStream> UCBStorageStream_Impl::GetXInputStream()
             {
                 aResult = m_pContent->openStream();
             }
-            catch ( Exception& )
+            catch (const Exception&)
             {
                 // usually means that stream could not be opened
             }
@@ -819,12 +821,12 @@ sal_Bool UCBStorageStream_Impl::Init()
         {
             m_rSource = m_pContent->openStream();
         }
-        catch ( Exception& )
+        catch (const Exception&)
         {
             // usually means that stream could not be opened
         }
 
-            if( m_rSource.is() )
+        if( m_rSource.is() )
         {
             m_pStream->Seek( STREAM_SEEK_TO_END );
 
@@ -832,12 +834,12 @@ sal_Bool UCBStorageStream_Impl::Init()
             {
                 m_rSource->skipBytes( m_pStream->Tell() );
             }
-            catch( BufferSizeExceededException& )
+            catch (const BufferSizeExceededException&)
             {
                 // the temporary stream already contain all the data
                 m_bSourceRead = sal_False;
             }
-            catch( Exception& )
+            catch (const Exception&)
             {
                 // something is really wrong
                 m_bSourceRead = sal_False;
@@ -880,14 +882,10 @@ sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary()
                 aResult += m_pStream->Write( aData.getArray(), aReaded );
             } while( aReaded == 32000 );
         }
-#if OSL_DEBUG_LEVEL > 1
-        catch( const Exception & e )
+        catch (const Exception &e)
         {
             OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
-#else
-        catch( Exception & )
-        {
-#endif
+            (void)e;
         }
     }
 
@@ -923,14 +921,10 @@ sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uLong aLength )
             if( aResult < aLength )
                 m_bSourceRead = sal_False;
         }
-#if OSL_DEBUG_LEVEL > 1
         catch( const Exception & e )
         {
             OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
-#else
-        catch( Exception & )
-        {
-#endif
+            (void)e;
         }
     }
 
@@ -981,14 +975,10 @@ sal_uLong UCBStorageStream_Impl::GetData( void* pData, sal_uLong nSize )
             aResult += m_pStream->Write( (void*)aData.getArray(), aReaded );
             memcpy( pData, aData.getArray(), aReaded );
         }
-#if OSL_DEBUG_LEVEL > 1
-        catch( const Exception & e )
+        catch (const Exception &e)
         {
             OSL_FAIL( ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
-#else
-        catch( Exception & )
-        {
-#endif
+            (void)e;
         }
 
         if( aResult < nSize )
@@ -1200,19 +1190,19 @@ sal_Int16 UCBStorageStream_Impl::Commit()
                 m_bModified = sal_False;
                 m_bSourceRead = sal_True;
             }
-            catch ( CommandAbortedException& )
+            catch (const CommandAbortedException&)
             {
                 // any command wasn't executed successfully - not specified
                 SetError( ERRCODE_IO_GENERAL );
                 return COMMIT_RESULT_FAILURE;
             }
-            catch ( RuntimeException& )
+            catch (const RuntimeException&)
             {
                 // any other error - not specified
                 SetError( ERRCODE_IO_GENERAL );
                 return COMMIT_RESULT_FAILURE;
             }
-            catch ( Exception& )
+            catch (const Exception&)
             {
                 // any other error - not specified
                 SetError( ERRCODE_IO_GENERAL );
@@ -1261,15 +1251,15 @@ sal_Bool UCBStorageStream_Impl::Revert()
         else
             SetError( SVSTREAM_CANNOT_MAKE );
     }
-    catch ( ContentCreationException& )
+    catch (const ContentCreationException&)
     {
         SetError( ERRCODE_IO_GENERAL );
     }
-    catch ( RuntimeException& )
+    catch (const RuntimeException&)
     {
         SetError( ERRCODE_IO_GENERAL );
     }
-    catch ( Exception& )
+    catch (const Exception&)
     {
     }
 
@@ -1332,7 +1322,7 @@ void UCBStorageStream_Impl::PrepareCachedForReopen( StreamMode nMode )
     }
 }
 
-UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress )
+UCBStorageStream::UCBStorageStream( const String& rName, StreamMode nMode, sal_Bool bDirect, const rtl::OString* pKey, sal_Bool bRepair, Reference< XProgressHandler > xProgress )
 {
     // pImp must be initialized in the body, because otherwise the vtable of the stream is not initialized
     // to class UCBStorageStream !
@@ -1542,7 +1532,7 @@ sal_Bool UCBStorageStream::SetProperty( const String& rName, const ::com::sun::s
             return sal_True;
         }
     }
-    catch ( Exception& )
+    catch (const Exception&)
     {
     }
 
@@ -1559,7 +1549,7 @@ sal_Bool UCBStorageStream::GetProperty( const String& rName, ::com::sun::star::u
             return sal_True;
         }
     }
-    catch ( Exception& )
+    catch (const Exception&)
     {
     }
 
@@ -1843,7 +1833,7 @@ void UCBStorage_Impl::Init()
                 if ( ( aAny >>= aTmp ) && !aTmp.isEmpty() )
                     m_aContentType = m_aOriginalContentType = aTmp;
             }
-            catch( Exception& )
+            catch (const Exception&)
             {
                 DBG_ASSERT( sal_False,
                             "getPropertyValue has thrown an exception! Please let developers know the scenario!" );
@@ -1888,12 +1878,12 @@ void UCBStorage_Impl::CreateContent()
 
         m_pContent = new ::ucbhelper::Content( aTemp, xComEnv );
     }
-    catch ( ContentCreationException& )
+    catch (const ContentCreationException&)
     {
         // content could not be created
         SetError( SVSTREAM_CANNOT_MAKE );
     }
-    catch ( RuntimeException& )
+    catch (const RuntimeException&)
     {
         // any other error - not specified
         SetError( SVSTREAM_CANNOT_MAKE );
@@ -1990,34 +1980,34 @@ void UCBStorage_Impl::ReadContent()
             }
         }
     }
-    catch ( const InteractiveIOException& r )
+    catch (const InteractiveIOException& r)
     {
         if ( r.Code != IOErrorCode_NOT_EXISTING )
             SetError( ERRCODE_IO_GENERAL );
     }
-    catch ( CommandAbortedException& )
+    catch (const CommandAbortedException&)
     {
         // any command wasn't executed successfully - not specified
         if ( !( m_nMode & STREAM_WRITE ) )
             // if the folder was just inserted and not already commited, this is not an error!
             SetError( ERRCODE_IO_GENERAL );
     }
-    catch ( RuntimeException& )
+    catch (const RuntimeException&)
     {
         // any other error - not specified
         SetError( ERRCODE_IO_GENERAL );
     }
-    catch ( ResultSetException& )
+    catch (const ResultSetException&)
     {
         // means that the package file is broken
         SetError( ERRCODE_IO_BROKENPACKAGE );
     }
-    catch ( SQLException& )
+    catch (const SQLException&)
     {
         // means that the file can be broken
         SetError( ERRCODE_IO_WRONGFORMAT );
     }
-    catch ( Exception& )
+    catch (const Exception&)
     {
         // any other error - not specified
         SetError( ERRCODE_IO_GENERAL );
@@ -2222,17 +2212,17 @@ sal_Bool UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent )
             }
         }
     }
-    catch ( CommandAbortedException& )
+    catch (const CommandAbortedException&)
     {
         // any command wasn't executed successfully - not specified
         SetError( ERRCODE_IO_GENERAL );
     }
-    catch ( RuntimeException& )
+    catch (const RuntimeException&)
     {
         // any other error - not specified
         SetError( ERRCODE_IO_GENERAL );
     }
-    catch ( Exception& )
+    catch (const Exception&)
     {
         // any other error - not specified
         SetError( ERRCODE_IO_GENERAL );
@@ -2346,25 +2336,25 @@ sal_Int16 UCBStorage_Impl::Commit()
                     break;
             }
         }
-        catch ( ContentCreationException& )
+        catch (const ContentCreationException&)
         {
             // content could not be created
             SetError( ERRCODE_IO_NOTEXISTS );
             return COMMIT_RESULT_FAILURE;
         }
-        catch ( CommandAbortedException& )
+        catch (const CommandAbortedException&)
         {
             // any command wasn't executed successfully - not specified
             SetError( ERRCODE_IO_GENERAL );
             return COMMIT_RESULT_FAILURE;
         }
-        catch ( RuntimeException& )
+        catch (const RuntimeException&)
         {
             // any other error - not specified
             SetError( ERRCODE_IO_GENERAL );
             return COMMIT_RESULT_FAILURE;
         }
-        catch ( Exception& )
+        catch (const Exception&)
         {
             // any other error - not specified
             SetError( ERRCODE_IO_GENERAL );
@@ -2440,7 +2430,7 @@ sal_Int16 UCBStorage_Impl::Commit()
                         }
                     }
                 }
-                catch ( CommandAbortedException& )
+                catch (const CommandAbortedException&)
                 {
                     // how to tell the content : forget all changes ?!
                     // or should we assume that the content does it by itself because he throwed an exception ?!
@@ -2448,7 +2438,7 @@ sal_Int16 UCBStorage_Impl::Commit()
                     SetError( ERRCODE_IO_GENERAL );
                     return COMMIT_RESULT_FAILURE;
                 }
-                catch ( RuntimeException& )
+                catch (const RuntimeException&)
                 {
                     // how to tell the content : forget all changes ?!
                     // or should we assume that the content does it by itself because he throwed an exception ?!
@@ -2456,7 +2446,7 @@ sal_Int16 UCBStorage_Impl::Commit()
                     SetError( ERRCODE_IO_GENERAL );
                     return COMMIT_RESULT_FAILURE;
                 }
-                catch ( const InteractiveIOException& r )
+                catch (const InteractiveIOException& r)
                 {
                     if ( r.Code == IOErrorCode_ACCESS_DENIED || r.Code == IOErrorCode_LOCKING_VIOLATION )
                         SetError( ERRCODE_IO_ACCESSDENIED );
@@ -2471,7 +2461,7 @@ sal_Int16 UCBStorage_Impl::Commit()
 
                     return COMMIT_RESULT_FAILURE;
                 }
-                catch ( Exception& )
+                catch (const Exception&)
                 {
                     // how to tell the content : forget all changes ?!
                     // or should we assume that the content does it by itself because he throwed an exception ?!
@@ -2810,7 +2800,7 @@ sal_Bool UCBStorage::Revert()
     return pImp->Revert();
 }
 
-BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey )
+BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nMode, sal_Bool bDirect, const rtl::OString* pKey )
 {
     if( !rEleName.Len() )
         return NULL;
@@ -2856,7 +2846,7 @@ BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nM
             {
                 // check if stream is opened with the same keyword as before
                 // if not, generate a new stream because it could be encrypted vs. decrypted!
-                ByteString aKey;
+                rtl::OString aKey;
                 if ( pKey )
                     aKey = *pKey;
                 if ( pElement->m_xStream->m_aKey == aKey )
@@ -2879,7 +2869,7 @@ BaseStorageStream* UCBStorage::OpenStream( const String& rEleName, StreamMode nM
     return NULL;
 }
 
-UCBStorageStream_Impl* UCBStorage_Impl::OpenStream( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect, const ByteString* pKey )
+UCBStorageStream_Impl* UCBStorage_Impl::OpenStream( UCBStorageElement_Impl* pElement, StreamMode nMode, sal_Bool bDirect, const rtl::OString* pKey )
 {
     String aName( m_aURL );
     aName += '/';
@@ -3303,11 +3293,10 @@ String UCBStorage::GetLinkedFile( SvStream &rStream )
     rStream >> nBytes;
     if( nBytes == 0x04034b50 )
     {
-        ByteString aTmp = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream);
-        if ( aTmp.CompareTo( "ContentURL=", 11 ) == COMPARE_EQUAL )
+        rtl::OString aTmp = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream);
+        if (comphelper::string::matchL(aTmp, RTL_CONSTASCII_STRINGPARAM("ContentURL=")))
         {
-            aTmp.Erase( 0, 11 );
-            aString = String( aTmp, RTL_TEXTENCODING_UTF8 );
+            aString = rtl::OStringToOUString(aTmp.copy(11), RTL_TEXTENCODING_UTF8);
         }
     }
 
@@ -3410,7 +3399,7 @@ sal_Bool UCBStorage::SetProperty( const String& rName, const ::com::sun::star::u
             return sal_True;
         }
     }
-    catch ( Exception& )
+    catch (const Exception&)
     {
     }
 
@@ -3427,7 +3416,7 @@ sal_Bool UCBStorage::GetProperty( const String& rName, ::com::sun::star::uno::An
             return sal_True;
         }
     }
-    catch ( Exception& )
+    catch (const Exception&)
     {
     }
 
@@ -3458,7 +3447,7 @@ sal_Bool UCBStorage::GetProperty( const String& rEleName, const String& rName, :
                 return sal_True;
             }
         }
-        catch ( Exception& )
+        catch (const Exception&)
         {
         }
     }
@@ -3480,7 +3469,7 @@ sal_Bool UCBStorage::GetProperty( const String& rEleName, const String& rName, :
                 return sal_True;
             }
         }
-        catch ( Exception& )
+        catch (const Exception&)
         {
         }
     }
commit 66823037e164af16f2cb24c4299c8776869c682c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 22 06:31:21 2012 +0000

    make chart2 ByteString free

diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
index c0f1751..d14aeb7 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
@@ -380,7 +380,7 @@ void WrappedSymbolBitmapURLProperty::setValueToSeries(
         if( bMatchesPrefix )
         {
             GraphicObject aGrObj = GraphicObject(
-                ByteString( U2C( aNewGraphicURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 ))));
+                rtl::OUStringToOString(aNewGraphicURL.copy( RTL_CONSTASCII_LENGTH(UNO_NAME_GRAPHOBJ_URLPREFIX) ), RTL_TEXTENCODING_ASCII_US));
             aSymbol.Graphic.set( aGrObj.GetGraphic().GetXGraphic());
             xSeriesPropertySet->setPropertyValue( C2U("Symbol"), uno::makeAny( aSymbol ) );
         }
commit 1cb538925ddba61d87b71640475282f60f27ce42
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 21 23:11:25 2012 +0000

    make unotools ByteString free

diff --git a/unotools/source/misc/componentresmodule.cxx b/unotools/source/misc/componentresmodule.cxx
index 1e2d607..5d36b42 100644
--- a/unotools/source/misc/componentresmodule.cxx
+++ b/unotools/source/misc/componentresmodule.cxx
@@ -91,9 +91,9 @@ namespace utl
         if ( !m_pRessources && !m_bInitialized )
         {
             // create a manager with a fixed prefix
-            ByteString aMgrName = m_sResFilePrefix;
+            rtl::OString aMgrName = m_sResFilePrefix;
 
-            m_pRessources = ResMgr::CreateResMgr( aMgrName.GetBuffer() );
+            m_pRessources = ResMgr::CreateResMgr( aMgrName.getStr() );
             OSL_ENSURE( m_pRessources,
                     rtl::OStringBuffer( "OModuleImpl::getResManager: could not create the resource manager (file name: " )
                 .append(aMgrName)
commit cce3e85e0d32a2e66d1c82e0eb072debad1600c5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 21 22:54:27 2012 +0000

    ByteString->rtl::OString

diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx
index 5f20b41..efb34c5 100644
--- a/sot/source/base/formats.cxx
+++ b/sot/source/base/formats.cxx
@@ -1320,8 +1320,8 @@ static sal_Bool CheckTransferableContext_Impl( const Reference< XTransferable >*
 
                                 if( pFDesc->cItems )
                                 {
-                                    ByteString sDesc( pFDesc->fgd[ 0 ].cFileName );
-                                    bRet = 4 < sDesc.Len() && sDesc.Copy( sDesc.Len()-4 ).EqualsIgnoreCaseAscii( ".URL" );
+                                    rtl::OString sDesc( pFDesc->fgd[ 0 ].cFileName );
+                                    bRet = 4 < sDesc.getLength() && sDesc.copy(sDesc.getLength()-4).equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM(".URL"));
                                 }
                             }
                         }


More information about the Libreoffice-commits mailing list