[Libreoffice-commits] .: 2 commits - basic/source connectivity/source dbaccess/source editeng/source filter/source idl/source sc/source sd/source sfx2/source sot/source svl/source svtools/source svx/inc svx/source sw/source tools/inc tools/qa tools/source vcl/source vcl/win

Caolán McNamara caolan at kemper.freedesktop.org
Wed Dec 21 02:31:31 PST 2011


 basic/source/basmgr/basmgr.cxx                   |   11 +-
 basic/source/classes/image.cxx                   |   16 +--
 basic/source/classes/sbxmod.cxx                  |    4 
 basic/source/runtime/iosys.cxx                   |    2 
 basic/source/runtime/methods1.cxx                |    4 
 basic/source/sbx/sbxbase.cxx                     |   18 +---
 basic/source/sbx/sbxcoll.cxx                     |    6 -
 basic/source/sbx/sbxobj.cxx                      |   14 +--
 basic/source/sbx/sbxvalue.cxx                    |   23 ++---
 basic/source/sbx/sbxvar.cxx                      |   19 +---
 connectivity/source/drivers/dbase/DTable.cxx     |    2 
 connectivity/source/drivers/dbase/dindexnode.cxx |    2 
 dbaccess/source/ui/tabledesign/TableRow.cxx      |   16 +--
 editeng/source/editeng/editobj.cxx               |   15 +--
 editeng/source/items/bulitem.cxx                 |   12 +-
 editeng/source/items/flditem.cxx                 |    4 
 editeng/source/items/frmitems.cxx                |    8 -
 editeng/source/items/numitem.cxx                 |    6 -
 editeng/source/items/textitem.cxx                |   16 +--
 filter/source/msfilter/mstoolbar.cxx             |    2 
 idl/source/objects/bastype.cxx                   |    8 -
 idl/source/objects/module.cxx                    |   20 ++--
 idl/source/objects/object.cxx                    |    4 
 idl/source/objects/types.cxx                     |    8 -
 sc/source/core/data/patattr.cxx                  |    8 -
 sc/source/core/tool/autoform.cxx                 |   14 ---
 sc/source/core/tool/ddelink.cxx                  |   12 +-
 sc/source/core/tool/zforauto.cxx                 |    4 
 sc/source/filter/ftools/ftools.cxx               |    6 -
 sc/source/filter/inc/ftools.hxx                  |    6 -
 sc/source/filter/lotus/lotform.cxx               |    6 -
 sc/source/filter/qpro/qproform.cxx               |    2 
 sc/source/ui/unoobj/scdetect.cxx                 |    2 
 sd/source/filter/eppt/epptso.cxx                 |    2 
 sd/source/filter/html/pubdlg.cxx                 |   48 +++--------
 sfx2/source/appl/appmisc.cxx                     |    4 
 sfx2/source/bastyp/sfxhtml.cxx                   |    2 
 sot/source/sdstor/ucbstorage.cxx                 |    5 -
 svl/source/items/cntwall.cxx                     |    3 
 svl/source/items/poolitem.cxx                    |    8 -
 svl/source/numbers/zformat.cxx                   |   13 +--
 svtools/source/filter/igif/gifread.cxx           |    4 
 svtools/source/graphic/grfmgr.cxx                |    7 -
 svtools/source/misc/imap.cxx                     |   37 +++++---
 svtools/source/misc/templatefoldercache.cxx      |    6 -
 svtools/source/misc/transfer.cxx                 |    8 -
 svtools/source/urlobj/inetimg.cxx                |    8 -
 svx/inc/svx/gallery1.hxx                         |   48 +++++------
 svx/inc/svx/galmisc.hxx                          |   14 +--
 svx/inc/svx/galtheme.hxx                         |   18 ++--
 svx/source/gallery2/gallery1.cxx                 |   51 +++++++-----
 svx/source/gallery2/galobj.cxx                   |   36 +++++---
 svx/source/gallery2/galtheme.cxx                 |   19 ++--
 svx/source/items/hlnkitem.cxx                    |   32 +++----
 svx/source/items/pageitem.cxx                    |    4 
 sw/source/core/doc/tblafmt.cxx                   |   14 +--
 sw/source/filter/ww1/w1class.cxx                 |    2 
 sw/source/filter/ww8/ww8par.cxx                  |    2 
 sw/source/filter/ww8/ww8par2.cxx                 |    2 
 sw/source/filter/ww8/ww8scan.cxx                 |   21 +++--
 sw/source/filter/ww8/ww8scan.hxx                 |    5 -
 sw/source/filter/ww8/ww8toolbar.cxx              |    2 
 sw/source/ui/config/uinums.cxx                   |   24 ++---
 sw/source/ui/dochdl/swdtflvr.cxx                 |    6 -
 tools/inc/tools/inetmsg.hxx                      |   96 +++++++++++------------
 tools/inc/tools/stream.hxx                       |   70 ++--------------
 tools/qa/cppunit/test_stream.cxx                 |   59 +-------------
 tools/source/inet/inetmsg.cxx                    |   22 ++---
 tools/source/inet/inetstrm.cxx                   |    2 
 tools/source/stream/stream.cxx                   |   40 +++++++--
 vcl/source/gdi/animate.cxx                       |    6 -
 vcl/source/gdi/cvtsvm.cxx                        |   11 +-
 vcl/source/gdi/font.cxx                          |    8 -
 vcl/source/gdi/jobset.cxx                        |   27 ++----
 vcl/source/gdi/metaact.cxx                       |   25 +++--
 vcl/source/gdi/print.cxx                         |   21 +++--
 vcl/source/gdi/rendergraphic.cxx                 |    6 -
 vcl/win/source/gdi/salgdi3.cxx                   |   13 +--
 78 files changed, 551 insertions(+), 610 deletions(-)

New commits:
commit 6708977331c933b3483b9fe5f66d981b51fd8d49
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 21 10:30:10 2011 +0000

    needs more work first
    
    This reverts commit 92f396733ebc518bcb7a9eae2dd3169d333b82b9.

diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 1a63f94..a2fe3bd 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -656,7 +656,7 @@ SbError SbiStream::Read( ByteString& rBuf, sal_uInt16 n, bool bForceReadingPerBy
             n = nLen;
         if( !n )
             return nError = SbERR_BAD_RECORD_LENGTH;
-        rtl::OStringBuffer aBuffer(read_uInt8s_ToOString(*pStrm, n));
+        rtl::OStringBuffer aBuffer(read_uInt8s_AsOString(*pStrm, n));
         //Pad it out with ' ' to the requested length on short read
         sal_Int32 nRequested = sal::static_int_cast<sal_Int32>(n);
         comphelper::string::padToLength(aBuffer, nRequested, ' ');
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index cfabfbf..fc5afcd 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -2739,7 +2739,7 @@ sal_Bool ODbaseTable::ReadMemo(sal_uIntPtr nBlockNo, ORowSetValue& aVariable)
             {
                 if ( bIsText )
                 {
-                    rtl::OStringBuffer aBuffer(read_uInt8s_ToOString(*m_pMemoStream, nLength));
+                    rtl::OStringBuffer aBuffer(read_uInt8s_AsOString(*m_pMemoStream, nLength));
                     //pad it out with ' ' to expected length on short read
                     sal_Int32 nRequested = sal::static_int_cast<sal_Int32>(nLength);
                     comphelper::string::padToLength(aBuffer, nRequested, ' ');
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index 046b457..1117457 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -673,7 +673,7 @@ void ONDXNode::Read(SvStream &rStream, ODbaseIndex& rIndex)
     else
     {
         sal_uInt16 nLen = rIndex.getHeader().db_keylen;
-        rtl::OString aBuf = read_uInt8s_ToOString(rStream, nLen);
+        rtl::OString aBuf = read_uInt8s_AsOString(rStream, nLen);
         //get length minus trailing whitespace
         sal_Int32 nContentLen = aBuf.getLength();
         while (nContentLen && aBuf[nContentLen-1] == ' ')
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 0fd144b..678f31a 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1131,10 +1131,10 @@ void BinTextObject::StoreData( SvStream& rOStream ) const
 
         // Convert CH_FEATURE to CH_FEATURE_OLD
         aText.SearchAndReplaceAll( cFeatureConverted, CH_FEATURE_OLD );
-        write_lenPrefixed_uInt8s_FromOString(rOStream, aText);
+        rOStream.WriteByteString( aText );
 
         // StyleName and Family...
-        write_lenPrefixed_uInt8s_FromOUString(rOStream, pC->GetStyle(), eEncoding);
+        rOStream.WriteByteString( rtl::OUStringToOString(pC->GetStyle(), eEncoding) );
         rOStream << (sal_uInt16)pC->GetFamily();
 
         // Paragraph attributes ...
@@ -1226,8 +1226,9 @@ void BinTextObject::CreateData( SvStream& rIStream )
         ContentInfo* pC = CreateAndInsertContent();
 
         // The Text...
-        ByteString aByteString = read_lenPrefixed_uInt8s_ToOString(rIStream);
-        pC->GetText() = rtl::OStringToOUString(aByteString, eSrcEncoding);
+        ByteString aByteString;
+        rIStream.ReadByteString( aByteString );
+        pC->GetText() = String( aByteString, eSrcEncoding );
 
         // StyleName and Family...
         rIStream.ReadByteString( pC->GetStyle(), eSrcEncoding );
diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx
index ed1c986..2776e72 100644
--- a/filter/source/msfilter/mstoolbar.cxx
+++ b/filter/source/msfilter/mstoolbar.cxx
@@ -412,7 +412,7 @@ WString::Read( SvStream &rS )
     nOffSet = rS.Tell();
     sal_uInt8 nChars = 0;
     rS >> nChars;
-    sString = read_LEuInt16s_ToOUString(rS, nChars);
+    sString = read_LEuInt16s_AsOUString(rS, nChars);
     return true;
 }
 
diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx
index afeb004..15c56c0 100644
--- a/idl/source/objects/bastype.cxx
+++ b/idl/source/objects/bastype.cxx
@@ -228,13 +228,13 @@ sal_Bool SvIdentifier::WriteSvIdl( SvStringHashEntry * pName,
 
 SvStream& operator << (SvStream & rStm, const SvIdentifier & r )
 {
-    write_lenPrefixed_uInt8s_FromOString(rStm, r);
+    rStm.WriteByteString( r );
     return rStm;
 }
 
 SvStream& operator >> (SvStream & rStm, SvIdentifier & r )
 {
-    r = read_lenPrefixed_uInt8s_ToOString(rStm);
+    rStm.ReadByteString( r );
     return rStm;
 }
 
@@ -343,13 +343,13 @@ sal_Bool SvString::WriteSvIdl( SvStringHashEntry * pName, SvStream & rOutStm,
 
 SvStream& operator << (SvStream & rStm, const SvString & r )
 {
-    write_lenPrefixed_uInt8s_FromOString(rStm, r);
+    rStm.WriteByteString( r );
     return rStm;
 }
 
 SvStream& operator >> (SvStream & rStm, SvString & r )
 {
-    r = read_lenPrefixed_uInt8s_ToOString(rStm);
+    rStm.ReadByteString( r );
     return rStm;
 }
 
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index 4fd5c78..c2be3e2 100644
--- a/idl/source/objects/module.cxx
+++ b/idl/source/objects/module.cxx
@@ -66,9 +66,9 @@ void SvMetaModule::Load( SvPersistStream & rStm )
     rStm >> aAttrList;
     // browser
     rStm.ReadByteString( aIdlFileName );
-    aHelpFileName = read_lenPrefixed_uInt8s_ToOString(rStm);
-    aSlotIdFile = read_lenPrefixed_uInt8s_ToOString(rStm);
-    aModulePrefix = read_lenPrefixed_uInt8s_ToOString(rStm);
+    rStm.ReadByteString( aHelpFileName );
+    rStm.ReadByteString( aSlotIdFile );
+    rStm.ReadByteString( aModulePrefix );
 
     // read compiler data
     sal_uInt16 nCmpLen;
@@ -91,9 +91,9 @@ void SvMetaModule::Save( SvPersistStream & rStm )
     rStm << aAttrList;
     // browser
     rStm.WriteByteString( aIdlFileName );
-    write_lenPrefixed_uInt8s_FromOString(rStm, aHelpFileName);
-    write_lenPrefixed_uInt8s_FromOString(rStm, aSlotIdFile);
-    write_lenPrefixed_uInt8s_FromOString(rStm, aModulePrefix);
+    rStm.WriteByteString( aHelpFileName );
+    rStm.WriteByteString( aSlotIdFile );
+    rStm.WriteByteString( aModulePrefix );
 
     // write compiler data
     sal_uInt16 nCmpLen = 0;
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index 798acbc..0b3e1cf 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -55,7 +55,7 @@ void SvClassElement::Load( SvPersistStream & rStm )
         return;
     }
     if( nMask & 0x01 ) rStm >> aAutomation;
-    if( nMask & 0x02 ) aPrefix = read_lenPrefixed_uInt8s_ToOString(rStm);
+    if( nMask & 0x02 ) rStm.ReadByteString( aPrefix );
     if( nMask & 0x04 )
     {
         SvMetaClass * p;
@@ -75,7 +75,7 @@ void SvClassElement::Save( SvPersistStream & rStm )
     // write data
     rStm << nMask;
     if( nMask & 0x01 ) rStm << aAutomation;
-    if( nMask & 0x02 ) write_lenPrefixed_uInt8s_FromOString(rStm, aPrefix);
+    if( nMask & 0x02 ) rStm.WriteByteString( aPrefix );
     if( nMask & 0x04 ) rStm << xClass;
 }
 
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index f2488aa..06db9ed 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -1780,7 +1780,7 @@ void SvMetaEnumValue::Load( SvPersistStream & rStm )
         OSL_FAIL( "wrong format" );
         return;
     }
-    if( nMask & 0x01 ) aEnumValue = read_lenPrefixed_uInt8s_ToOString(rStm);
+    if( nMask & 0x01 ) rStm.ReadByteString( aEnumValue );
 }
 
 void SvMetaEnumValue::Save( SvPersistStream & rStm )
@@ -1793,7 +1793,7 @@ void SvMetaEnumValue::Save( SvPersistStream & rStm )
 
     // write data
     rStm << nMask;
-    if( nMask & 0x01 ) write_lenPrefixed_uInt8s_FromOString(rStm, aEnumValue);
+    if( nMask & 0x01 ) rStm.WriteByteString( aEnumValue );
 }
 
 sal_Bool SvMetaEnumValue::ReadSvIdl( SvIdlDataBase & rBase,
@@ -1837,7 +1837,7 @@ void SvMetaTypeEnum::Load( SvPersistStream & rStm )
         return;
     }
     if( nMask & 0x01 ) rStm >> aEnumValueList;
-    if( nMask & 0x02 ) aPrefix = read_lenPrefixed_uInt8s_ToOString(rStm);
+    if( nMask & 0x02 ) rStm.ReadByteString( aPrefix );
 }
 
 void SvMetaTypeEnum::Save( SvPersistStream & rStm )
@@ -1852,7 +1852,7 @@ void SvMetaTypeEnum::Save( SvPersistStream & rStm )
     // write data
     rStm << nMask;
     if( nMask & 0x01 ) rStm << aEnumValueList;
-    if( nMask & 0x02 ) write_lenPrefixed_uInt8s_FromOString(rStm, aPrefix);
+    if( nMask & 0x02 ) rStm.WriteByteString( aPrefix );
 }
 
 void SvMetaTypeEnum::ReadContextSvIdl( SvIdlDataBase & rBase,
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
index bbfbe41..21d3e12 100644
--- a/sc/source/filter/ftools/ftools.cxx
+++ b/sc/source/filter/ftools/ftools.cxx
@@ -276,9 +276,9 @@ ScStyleSheet& ScfTools::MakePageStyleSheet( ScStyleSheetPool& rPool, const Strin
 
 // *** byte string import operations *** --------------------------------------
 
-rtl::OString ScfTools::read_zeroTerminated_uInt8s_ToOString(SvStream& rStrm, sal_Int32& rnBytesLeft)
+rtl::OString ScfTools::read_zeroTerminated_uInt8s_AsOString(SvStream& rStrm, sal_Int32& rnBytesLeft)
 {
-    rtl::OString aRet(::read_zeroTerminated_uInt8s_ToOString(rStrm));
+    rtl::OString aRet(::read_zeroTerminated_uInt8s_AsOString(rStrm));
     rnBytesLeft -= aRet.getLength(); //we read this number of bytes anyway
     if (rStrm.good()) //if the stream is happy we read the null terminator as well
         --rnBytesLeft;
@@ -287,7 +287,7 @@ rtl::OString ScfTools::read_zeroTerminated_uInt8s_ToOString(SvStream& rStrm, sal
 
 void ScfTools::AppendCString( SvStream& rStrm, String& rString, rtl_TextEncoding eTextEnc )
 {
-    rString += ::read_zeroTerminated_uInt8s_ToOUString(rStrm, eTextEnc);
+    rString += ::read_zeroTerminated_uInt8s_AsOUString(rStrm, eTextEnc);
 }
 
 // *** HTML table names <-> named range names *** -----------------------------
diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
index 4bfac09..e57d42c 100644
--- a/sc/source/filter/inc/ftools.hxx
+++ b/sc/source/filter/inc/ftools.hxx
@@ -237,11 +237,11 @@ public:
 // *** byte string import operations *** --------------------------------------
 
     /** Reads and returns a zero terminated byte string and decreases a stream counter. */
-    static rtl::OString read_zeroTerminated_uInt8s_ToOString(SvStream& rStrm, sal_Int32& rnBytesLeft);
+    static rtl::OString read_zeroTerminated_uInt8s_AsOString(SvStream& rStrm, sal_Int32& rnBytesLeft);
     /** Reads and returns a zero terminated byte string and decreases a stream counter. */
-    inline static rtl::OUString read_zeroTerminated_uInt8s_ToOUString(SvStream& rStrm, sal_Int32& rnBytesLeft, rtl_TextEncoding eTextEnc)
+    inline static rtl::OUString read_zeroTerminated_uInt8s_AsOUString(SvStream& rStrm, sal_Int32& rnBytesLeft, rtl_TextEncoding eTextEnc)
     {
-        return rtl::OStringToOUString(read_zeroTerminated_uInt8s_ToOString(rStrm, rnBytesLeft), eTextEnc);
+        return rtl::OStringToOUString(read_zeroTerminated_uInt8s_AsOString(rStrm, rnBytesLeft), eTextEnc);
     }
 
     /** Appends a zero terminated byte string. */
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index d649c44..5bd02b1 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -542,7 +542,7 @@ ConvErr LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest,
                 break;
             case FT_ConstString:
             {
-                String  aTmp(ScfTools::read_zeroTerminated_uInt8s_ToOUString(aIn, nBytesLeft, eSrcChar));
+                String  aTmp(ScfTools::read_zeroTerminated_uInt8s_AsOUString(aIn, nBytesLeft, eSrcChar));
                 aStack << aPool.Store( aTmp );
             }
                 break;
@@ -561,7 +561,7 @@ ConvErr LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest,
                 break;
             case FT_Nrref:
             {
-                String  aTmp(ScfTools::read_zeroTerminated_uInt8s_ToOUString(aIn, nBytesLeft, eSrcChar));
+                String  aTmp(ScfTools::read_zeroTerminated_uInt8s_AsOUString(aIn, nBytesLeft, eSrcChar));
                 if( rRangeNameBufferWK3.FindRel( aTmp, nRngIndex ) )
                     aStack << aPool.Store( nRngIndex );
                 else
@@ -574,7 +574,7 @@ ConvErr LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest,
                 break;
             case FT_Absnref:
             {
-                String aTmp(ScfTools::read_zeroTerminated_uInt8s_ToOUString(aIn, nBytesLeft, eSrcChar));
+                String aTmp(ScfTools::read_zeroTerminated_uInt8s_AsOUString(aIn, nBytesLeft, eSrcChar));
                 if( rRangeNameBufferWK3.FindAbs( aTmp, nRngIndex ) )
                     aStack << aPool.Store( nRngIndex );
                 else
diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index 6c8e8b7..30b7d60 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -249,7 +249,7 @@ ConvErr QProToSc::Convert( const ScTokenArray*& pArray, sal_uInt16 /*nLen*/, con
             }
             if( nFmla[ i ] == 0x06 )
             {
-                String aTmp(::read_zeroTerminated_uInt8s_ToOUString(maIn, maIn.GetStreamCharSet()));
+                String aTmp(::read_zeroTerminated_uInt8s_AsOUString(maIn, maIn.GetStreamCharSet()));
                 sStringArray[ nStringCount ] = aTmp;
                 nStringCount++;
         SAFEDEC_OR_RET(nRef, aTmp.Len() + 1, ConvErrCount);
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index fd3b0d2..9d33f09 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -734,7 +734,7 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
                             // get file header
                             rStr.Seek( 0 );
                             const sal_Size nTrySize = 80;
-                            ByteString aHeader = read_uInt8s_ToOString(rStr, nTrySize);
+                            ByteString aHeader = read_uInt8s_AsOString(rStr, nTrySize);
 
                             if ( HTMLParser::IsHTMLFormat( aHeader.GetBuffer() ) )
                             {
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index c320f0c..7e8064f 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -2605,7 +2605,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
                                 *xCompObj   >> nStringLen;
                                 if ( ( nStringLen > 1 ) && ( ( xCompObj->Tell() + nStringLen ) < nStreamLen ) )
                                 {   // i think that the OleIdentifier will follow
-                                    rtl::OString aTemp = read_uInt8s_ToOString(*xCompObj, nStringLen - 1);
+                                    rtl::OString aTemp = read_uInt8s_AsOString(*xCompObj, nStringLen - 1);
                                     aOleIdentifier = rtl::OStringToOUString(aTemp, RTL_TEXTENCODING_MS_1252);
                                 }
                             }
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index acf6918..18214c5 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -274,7 +274,7 @@ sal_Bool SfxHTMLParser::FinishFileDownload( String& rStr )
                         : STRING_MAXLEN;
 
         aStream.Seek( 0 );
-        rtl::OString sBuffer = read_uInt8s_ToOString(aStream, nLen);
+        rtl::OString sBuffer = read_uInt8s_AsOString(aStream, nLen);
         rStr = S2U(sBuffer);
     }
 
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index f1cf5c0..b6fb581 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -3303,7 +3303,8 @@ String UCBStorage::GetLinkedFile( SvStream &rStream )
     rStream >> nBytes;
     if( nBytes == 0x04034b50 )
     {
-        ByteString aTmp = read_lenPrefixed_uInt8s_ToOString(rStream);
+        ByteString aTmp;
+        rStream.ReadByteString( aTmp );
         if ( aTmp.CompareTo( "ContentURL=", 11 ) == COMPARE_EQUAL )
         {
             aTmp.Erase( 0, 11 );
diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx
index 31ef07e..f81bd48 100644
--- a/svl/source/items/cntwall.cxx
+++ b/svl/source/items/cntwall.cxx
@@ -80,7 +80,8 @@ CntWallpaperItem::CntWallpaperItem( sal_uInt16 which, SvStream& rStream, sal_uIn
         readUnicodeString(rStream, _aURL, false);
 
         // "Read" SfxWallpaperItem's string member _aFilter.
-        read_lenPrefixed_uInt8s_ToOString(rStream);
+        ByteString aDummy;
+        rStream.ReadByteString(aDummy);
     }
 }
 
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 424aaa0..a85491e 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1768,7 +1768,8 @@ void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter,
 void SvNumberformat::LoadString( SvStream& rStream, String& rStr )
 {
     CharSet eStream = rStream.GetStreamCharSet();
-    ByteString aStr = read_lenPrefixed_uInt8s_ToOString(rStream);
+    ByteString aStr;
+    rStream.ReadByteString( aStr );
     sal_Char cStream = NfCurrencyEntry::GetEuroSymbol( eStream );
     if ( aStr.Search( cStream ) == STRING_NOTFOUND )
     {   // simple conversion to unicode
diff --git a/svtools/source/filter/igif/gifread.cxx b/svtools/source/filter/igif/gifread.cxx
index 607b6a8..81dee55 100644
--- a/svtools/source/filter/igif/gifread.cxx
+++ b/svtools/source/filter/igif/gifread.cxx
@@ -257,8 +257,8 @@ sal_Bool GIFReader::ReadExtension()
                     // Appl.-Extension hat Laenge 11
                     if ( cSize == 0x0b )
                     {
-                        rtl::OString aAppId = read_uInt8s_ToOString(rIStm, 8);
-                        rtl::OString aAppCode = read_uInt8s_ToOString(rIStm, 3);
+                        rtl::OString aAppId = read_uInt8s_AsOString(rIStm, 8);
+                        rtl::OString aAppCode = read_uInt8s_AsOString(rIStm, 3);
                         rIStm >> cSize;
 
                         // NetScape-Extension
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index db3e872..f259ccb 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -1125,6 +1125,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj )
     VersionCompat   aCompat( rIStm, STREAM_READ );
     Graphic         aGraphic;
     GraphicAttr     aAttr;
+    ByteString      aLink;
     sal_Bool            bLink;
 
     rIStm >> aGraphic >> aAttr >> bLink;
@@ -1134,8 +1135,8 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj )
 
     if( bLink )
     {
-        rtl::OUString aLink = read_lenPrefixed_uInt8s_ToOUString(rIStm, RTL_TEXTENCODING_UTF8);
-        rGraphicObj.SetLink(aLink);
+        rIStm.ReadByteString(aLink);
+        rGraphicObj.SetLink( UniString( aLink, RTL_TEXTENCODING_UTF8 ) );
     }
     else
         rGraphicObj.SetLink();
@@ -1153,7 +1154,7 @@ SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj )
     rOStm << rGraphicObj.GetGraphic() << rGraphicObj.GetAttr() << bLink;
 
     if( bLink )
-        write_lenPrefixed_uInt8s_FromOUString(rOStm, rGraphicObj.GetLink(), RTL_TEXTENCODING_UTF8);
+        rOStm.WriteByteString(rtl::OUStringToOString(rGraphicObj.GetLink(), RTL_TEXTENCODING_UTF8));
 
     return rOStm;
 }
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index bb720f6..016250c 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -104,16 +104,16 @@ void IMapObject::Write( SvStream& rOStm, const String& rBaseURL ) const
 
     const rtl::OString aRelURL = rtl::OUStringToOString(
         URIHelper::simpleNormalizedMakeRelative(rBaseURL, aURL), eEncoding);
-    write_lenPrefixed_uInt8s_FromOString(rOStm, aRelURL);
-    write_lenPrefixed_uInt8s_FromOUString(rOStm, aAltText, eEncoding);
+    rOStm.WriteByteString(aRelURL);
+    rOStm.WriteByteString(rtl::OUStringToOString(aAltText, eEncoding));
     rOStm << bActive;
-    write_lenPrefixed_uInt8s_FromOUString(rOStm, aTarget, eEncoding);
+    rOStm.WriteByteString(rtl::OUStringToOString(aTarget, eEncoding));
 
     pCompat = new IMapCompat( rOStm, STREAM_WRITE );
 
     WriteIMapObject( rOStm );
-    aEventList.Write( rOStm );                                      // V4
-    write_lenPrefixed_uInt8s_FromOUString(rOStm, aName, eEncoding); // V5
+    aEventList.Write( rOStm );                                 // V4
+    rOStm.WriteByteString(rtl::OUStringToOString(aName, eEncoding));   // V5
 
     delete pCompat;
 }
@@ -129,15 +129,16 @@ void IMapObject::Read( SvStream& rIStm, const String& rBaseURL )
 {
     IMapCompat*         pCompat;
     rtl_TextEncoding    nTextEncoding;
+    ByteString          aString;
 
     // Typ und Version ueberlesen wir
     rIStm.SeekRel( 2 );
     rIStm >> nReadVersion;
     rIStm >> nTextEncoding;
-    aURL = read_lenPrefixed_uInt8s_ToOUString(rIStm, nTextEncoding);
-    aAltText = read_lenPrefixed_uInt8s_ToOUString(rIStm, nTextEncoding);
+    rIStm.ReadByteString( aString ); aURL = String( aString.GetBuffer(), nTextEncoding );
+    rIStm.ReadByteString( aString ); aAltText = String( aString.GetBuffer(), nTextEncoding );
     rIStm >> bActive;
-    aTarget = read_lenPrefixed_uInt8s_ToOUString(rIStm, nTextEncoding);
+    rIStm.ReadByteString( aString ); aTarget = String( aString.GetBuffer(), nTextEncoding );
 
     // URL absolut machen
     aURL = URIHelper::SmartRel2Abs( INetURLObject(rBaseURL), aURL, URIHelper::GetMaybeFileHdl(), true, false, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS );
@@ -152,7 +153,9 @@ void IMapObject::Read( SvStream& rIStm, const String& rBaseURL )
 
         // ab Version 5 kann ein Objektname vorhanden sein
         if ( nReadVersion >= 0x0005 )
-            aName = read_lenPrefixed_uInt8s_ToOUString(rIStm, nTextEncoding);
+        {
+            rIStm.ReadByteString( aString ); aName = String( aString.GetBuffer(), nTextEncoding );
+        }
     }
 
     delete pCompat;
@@ -1114,19 +1117,20 @@ void ImageMap::Write( SvStream& rOStm, const String& rBaseURL ) const
 {
     IMapCompat*             pCompat;
     String                  aImageName( GetName() );
+    String                  aDummy;
     sal_uInt16                  nOldFormat = rOStm.GetNumberFormatInt();
     sal_uInt16                  nCount = (sal_uInt16) GetIMapObjectCount();
-    const rtl_TextEncoding  eEncoding = osl_getThreadTextEncoding(); //vomit!
+    const rtl_TextEncoding  eEncoding = osl_getThreadTextEncoding();
 
     rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
 
     // MagicCode schreiben
     rOStm << IMAPMAGIC;
     rOStm << GetVersion();
-    write_lenPrefixed_uInt8s_FromOUString(rOStm, aImageName, eEncoding);
-    write_lenPrefixed_uInt8s_FromOString(rOStm, rtl::OString()); //dummy
+    rOStm.WriteByteString(rtl::OUStringToOString(aImageName, eEncoding));
+    rOStm.WriteByteString(rtl::OUStringToOString(aDummy, eEncoding));
     rOStm << nCount;
-    write_lenPrefixed_uInt8s_FromOUString(rOStm, aImageName, eEncoding);
+    rOStm.WriteByteString(rtl::OUStringToOString(aImageName, eEncoding));
 
     pCompat = new IMapCompat( rOStm, STREAM_WRITE );
 
@@ -1148,6 +1152,7 @@ void ImageMap::Write( SvStream& rOStm, const String& rBaseURL ) const
 
 void ImageMap::Read( SvStream& rIStm, const String& rBaseURL )
 {
+    ByteString  aString;
     char        cMagic[6];
     sal_uInt16      nOldFormat = rIStm.GetNumberFormatInt();
     sal_uInt16      nCount;
@@ -1165,10 +1170,10 @@ void ImageMap::Read( SvStream& rIStm, const String& rBaseURL )
         // Version ueberlesen wir
         rIStm.SeekRel( 2 );
 
-        aName = read_lenPrefixed_uInt8s_ToOUString(rIStm, osl_getThreadTextEncoding());
-        read_lenPrefixed_uInt8s_ToOString(rIStm); // Dummy
+        rIStm.ReadByteString( aString ); aName = String( aString, osl_getThreadTextEncoding() );
+        rIStm.ReadByteString( aString ); // Dummy
         rIStm >> nCount;
-        read_lenPrefixed_uInt8s_ToOString(rIStm); // Dummy
+        rIStm.ReadByteString( aString ); // Dummy
 
         pCompat = new IMapCompat( rIStm, STREAM_READ );
 
diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx
index 8ed7996..fff9d17 100644
--- a/svtools/source/urlobj/inetimg.cxx
+++ b/svtools/source/urlobj/inetimg.cxx
@@ -73,7 +73,7 @@ sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat )
     {
     case SOT_FORMATSTR_ID_INET_IMAGE:
         {
-            String sINetImg = read_zeroTerminated_uInt8s_ToOUString(rIStm, RTL_TEXTENCODING_UTF8);
+            String sINetImg = read_zeroTerminated_uInt8s_AsOUString(rIStm, RTL_TEXTENCODING_UTF8);
             xub_StrLen nStart = 0;
             aImageURL = sINetImg.GetToken( 0, TOKEN_SEPARATOR, nStart );
             aTargetURL = sINetImg.GetToken( 0, TOKEN_SEPARATOR, nStart );
@@ -119,11 +119,11 @@ sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat )
             // skip over iExtraHTML_Offset
             rIStm.SeekRel( sizeof( int ) );
 
-            aImageURL = read_zeroTerminated_uInt8s_ToOUString(rIStm, eSysCSet);
+            aImageURL = read_zeroTerminated_uInt8s_AsOUString(rIStm, eSysCSet);
             if( nAltOffset )
             {
                 rIStm.Seek( nFilePos + nAltOffset );
-                aAlternateText = read_zeroTerminated_uInt8s_ToOUString(rIStm, eSysCSet);
+                aAlternateText = read_zeroTerminated_uInt8s_AsOUString(rIStm, eSysCSet);
             }
             else if( aAlternateText.Len() )
                 aAlternateText.Erase();
@@ -131,7 +131,7 @@ sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat )
             if( nAnchorOffset )
             {
                 rIStm.Seek( nFilePos + nAnchorOffset );
-                aTargetURL = read_zeroTerminated_uInt8s_ToOUString(rIStm, eSysCSet);
+                aTargetURL = read_zeroTerminated_uInt8s_AsOUString(rIStm, eSysCSet);
             }
             else if( aTargetURL.Len() )
                 aTargetURL.Erase();
diff --git a/svx/inc/svx/gallery1.hxx b/svx/inc/svx/gallery1.hxx
index de6ebc6..aa5cc4a 100644
--- a/svx/inc/svx/gallery1.hxx
+++ b/svx/inc/svx/gallery1.hxx
@@ -47,16 +47,16 @@ class GalleryThemeEntry
 {
 private:
 
-    rtl::OUString           aName;
+    String                  aName;
     INetURLObject           aThmURL;
     INetURLObject           aSdgURL;
     INetURLObject           aSdvURL;
-    sal_uInt32              nFileNumber;
-    sal_uInt32              nId;
-    sal_Bool                bReadOnly;
-    sal_Bool                bImported;
-    sal_Bool                bModified;
-    sal_Bool                bThemeNameFromResource;
+    sal_uInt32                  nFileNumber;
+    sal_uInt32                  nId;
+    sal_Bool                    bReadOnly;
+    sal_Bool                    bImported;
+    sal_Bool                    bModified;
+    sal_Bool                    bThemeNameFromResource;
 
                             GalleryThemeEntry();
     INetURLObject           ImplGetURLIgnoreCase( const INetURLObject& rURL ) const;
@@ -68,26 +68,26 @@ public:
                                                sal_Bool bNewFile, sal_uInt32 nId, sal_Bool bThemeNameFromResource );
                             ~GalleryThemeEntry() {};
 
-    const rtl::OUString&    GetThemeName() const { return aName; }
-    sal_uInt32              GetFileNumber() const { return nFileNumber; }
+    const String&           GetThemeName() const { return aName; }
+    sal_uInt32                  GetFileNumber() const { return nFileNumber; }
 
     const INetURLObject&    GetThmURL() const { return aThmURL; }
     const INetURLObject&    GetSdgURL() const { return aSdgURL; }
     const INetURLObject&    GetSdvURL() const { return aSdvURL; }
 
-    sal_Bool                IsImported() const { return bImported; }
-    sal_Bool                IsReadOnly() const { return bReadOnly; }
-    sal_Bool                IsDefault() const;
+    sal_Bool                    IsImported() const { return bImported; }
+    sal_Bool                    IsReadOnly() const { return bReadOnly; }
+    sal_Bool                    IsDefault() const;
 
-    sal_Bool                IsHidden() const { return aName.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("private://gallery/hidden/")); }
+    sal_Bool                    IsHidden() const { return aName.SearchAscii( "private://gallery/hidden/" ) == 0; }
 
-    sal_Bool                IsModified() const { return bModified; }
+    sal_Bool                    IsModified() const { return bModified; }
     void                    SetModified( sal_Bool bSet ) { bModified = ( bSet && !IsImported() && !IsReadOnly() ); }
 
-    void                    SetName( const rtl::OUString& rNewName );
-    sal_Bool                IsNameFromResource() const { return bThemeNameFromResource; }
+    void                    SetName( const String& rNewName );
+    sal_Bool                    IsNameFromResource() const { return bThemeNameFromResource; }
 
-    sal_uInt32              GetId() const { return nId; }
+    sal_uInt32                  GetId() const { return nId; }
     void                    SetId( sal_uInt32 nNewId, sal_Bool bResetThemeName );
 };
 
@@ -99,10 +99,10 @@ typedef ::std::vector< GalleryThemeEntry* > GalleryThemeList;
 
 struct GalleryImportThemeEntry
 {
-    rtl::OUString aThemeName;
-    rtl::OUString aUIName;
-    INetURLObject aURL;
-    rtl::OUString aImportName;
+    String          aThemeName;
+    String          aUIName;
+    INetURLObject   aURL;
+    String          aImportName;
 };
 
 typedef ::std::vector< GalleryImportThemeEntry* > GalleryImportThemeList;
@@ -144,9 +144,9 @@ private:
     void                        ImplLoadImports();
     void                        ImplWriteImportList();
 
-    SVX_DLLPUBLIC GalleryThemeEntry*            ImplGetThemeEntry( const rtl::OUString& rThemeName );
+    SVX_DLLPUBLIC GalleryThemeEntry*            ImplGetThemeEntry( const String& rThemeName );
     GalleryThemeEntry*          ImplGetThemeEntry( sal_uIntPtr nThemeId );
-    GalleryImportThemeEntry*    ImplGetImportThemeEntry( const rtl::OUString& rImportName );
+    GalleryImportThemeEntry*    ImplGetImportThemeEntry( const String& rImportName );
 
     GalleryTheme*               ImplGetCachedTheme( const GalleryThemeEntry* pThemeEntry );
     void                        ImplDeleteCachedTheme( GalleryTheme* pTheme );
@@ -164,7 +164,7 @@ public:
     const GalleryThemeEntry*    GetThemeInfo( const String& rThemeName ) { return ImplGetThemeEntry( rThemeName ); }
 
     SVX_DLLPUBLIC sal_Bool          HasTheme( const String& rThemeName );
-    rtl::OUString                   GetThemeName( sal_uIntPtr nThemeId ) const;
+    String                      GetThemeName( sal_uIntPtr nThemeId ) const;
 
     SVX_DLLPUBLIC sal_Bool          CreateTheme( const String& rThemeName, sal_uInt32 nNumFrom = 0 );
     sal_Bool                        RenameTheme( const String& rOldName, const String& rNewName );
diff --git a/svx/inc/svx/galmisc.hxx b/svx/inc/svx/galmisc.hxx
index 7f4563e..c7ed89c 100644
--- a/svx/inc/svx/galmisc.hxx
+++ b/svx/inc/svx/galmisc.hxx
@@ -245,8 +245,8 @@ class GalleryHint : public SfxHint
 private:
 
     sal_uIntPtr         mnType;
-    rtl::OUString       maThemeName;
-    rtl::OUString       maStringData;
+    String          maThemeName;
+    String          maStringData;
     sal_uIntPtr         mnData1;
     sal_uIntPtr         mnData2;
 
@@ -258,11 +258,11 @@ public:
                     GalleryHint( sal_uIntPtr nType, const String& rThemeName, const String& rStringData, sal_uIntPtr nData1 = 0UL, sal_uIntPtr nData2 = 0UL ) :
                         mnType( nType ), maThemeName( rThemeName ), maStringData( rStringData ), mnData1( nData1 ), mnData2( nData2 ) {}
 
-    sal_uIntPtr          GetType() const { return mnType; }
-    const rtl::OUString& GetThemeName() const { return maThemeName; }
-    const rtl::OUString& GetStringData() const { return maStringData; }
-    sal_uIntPtr          GetData1() const { return mnData1; }
-    sal_uIntPtr          GetData2() const { return mnData2; }
+    sal_uIntPtr         GetType() const { return mnType; }
+    const String&   GetThemeName() const { return maThemeName; }
+    const String&   GetStringData() const { return maStringData; }
+    sal_uIntPtr         GetData1() const { return mnData1; }
+    sal_uIntPtr         GetData2() const { return mnData2; }
 };
 
     #endif
diff --git a/svx/inc/svx/galtheme.hxx b/svx/inc/svx/galtheme.hxx
index 766bb44..2bfdddf 100644
--- a/svx/inc/svx/galtheme.hxx
+++ b/svx/inc/svx/galtheme.hxx
@@ -70,10 +70,10 @@ class ListBox;
 
 struct GalDragParams
 {
-    Region  aDragRegion;
-    sal_uIntPtr nDragObjPos;
-    rtl::OUString aThemeName;
-    rtl::OUString aFileName;
+    Region      aDragRegion;
+    sal_uIntPtr     nDragObjPos;
+    String      aThemeName;
+    String      aFileName;
     SgaObjKind  eObjKind;
 };
 
@@ -99,7 +99,7 @@ class GalleryTheme : public SfxBroadcaster
 private:
 
     GalleryObjectList           aObjectList;
-    rtl::OUString               aImportName;
+    String                      aImportName;
     String                      m_aDestDir;
     SotStorageRef               aSvDrawStorageRef;
     Gallery*                    pParent;
@@ -147,10 +147,10 @@ public:
     SVX_DLLPUBLIC bool          RemoveObject( size_t nPos );
     bool                        ChangeObjectPos( size_t nOldPos, size_t nNewPos );
 
-    SVX_DLLPUBLIC const rtl::OUString& GetName() const;
-    const rtl::OUString&        GetRealName() const;
-    const rtl::OUString&        GetImportName() const { return aImportName; }
-    void                        SetImportName(const rtl::OUString& rImportName) { aImportName = rImportName; }
+    SVX_DLLPUBLIC const String& GetName() const;
+    const String&               GetRealName() const;
+    const String&               GetImportName() const { return aImportName; }
+    void                        SetImportName(const String& rImportName) { aImportName = rImportName; }
 
     const String&               GetDestDir() const { return m_aDestDir; }
     void                        SetDestDir(const String& rDestDir) { m_aDestDir = rDestDir; }
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 9b7cfe2..4c10186 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -78,7 +78,7 @@ GalleryThemeEntry::GalleryThemeEntry( const INetURLObject& rBaseURL, const Strin
     if( nId && bThemeNameFromResource )
         aName = String( GAL_RESID( RID_GALLERYSTR_THEME_START + (sal_uInt16) nId ) );
 
-    if( !aName.getLength() )
+    if( !aName.Len() )
         aName = rName;
 }
 
@@ -107,7 +107,7 @@ INetURLObject GalleryThemeEntry::ImplGetURLIgnoreCase( const INetURLObject& rURL
 
 // -----------------------------------------------------------------------------
 
-void GalleryThemeEntry::SetName( const rtl::OUString& rNewName )
+void GalleryThemeEntry::SetName( const String& rNewName )
 {
     if( aName != rNewName )
     {
@@ -132,12 +132,16 @@ void GalleryThemeEntry::SetId( sal_uInt32 nNewId, sal_Bool bResetThemeName )
 
 SvStream& operator<<( SvStream& rOut, const GalleryImportThemeEntry& rEntry )
 {
-    write_lenPrefixed_uInt8s_FromOUString(rOut, rEntry.aThemeName, RTL_TEXTENCODING_UTF8);
-    write_lenPrefixed_uInt8s_FromOUString(rOut, rEntry.aUIName, RTL_TEXTENCODING_UTF8);
-    write_lenPrefixed_uInt8s_FromOUString(rOut, (rEntry.aURL.GetMainURL( INetURLObject::NO_DECODE )), RTL_TEXTENCODING_UTF8);
-    write_lenPrefixed_uInt8s_FromOUString(rOut, rEntry.aImportName, RTL_TEXTENCODING_UTF8);
+    rOut.WriteByteString(rtl::OUStringToOString(rEntry.aThemeName, RTL_TEXTENCODING_UTF8));
+
+    rOut.WriteByteString(rtl::OUStringToOString(rEntry.aUIName, RTL_TEXTENCODING_UTF8));
+
+    rOut.WriteByteString(rtl::OUStringToOString(String(rEntry.aURL.GetMainURL( INetURLObject::NO_DECODE )), RTL_TEXTENCODING_UTF8));
+
+    rOut.WriteByteString(rtl::OUStringToOString(rEntry.aImportName, RTL_TEXTENCODING_UTF8));
+
+    rOut.WriteByteString(rtl::OUString());
 
-    write_lenPrefixed_uInt8s_FromOString(rOut, rtl::OString());
     return rOut;
 }
 
@@ -145,11 +149,22 @@ SvStream& operator<<( SvStream& rOut, const GalleryImportThemeEntry& rEntry )
 
 SvStream& operator>>( SvStream& rIn, GalleryImportThemeEntry& rEntry )
 {
-    rEntry.aThemeName = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8);
-    rEntry.aUIName = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8);
-    rEntry.aURL = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8);
-    rEntry.aImportName = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8);
-    read_lenPrefixed_uInt8s_ToOString(rIn);
+    ByteString aTmpStr;
+
+    rIn.ReadByteString(aTmpStr);
+    rEntry.aThemeName = String( aTmpStr, RTL_TEXTENCODING_UTF8 );
+
+    rIn.ReadByteString(aTmpStr);
+    rEntry.aUIName = String( aTmpStr, RTL_TEXTENCODING_UTF8 );
+
+    rIn.ReadByteString(aTmpStr);
+    rEntry.aURL = INetURLObject( String( aTmpStr, RTL_TEXTENCODING_UTF8 ) );
+
+    rIn.ReadByteString(aTmpStr);
+    rEntry.aImportName = String( aTmpStr, RTL_TEXTENCODING_UTF8 );
+
+    rIn.ReadByteString(aTmpStr);
+
     return rIn;
 }
 
@@ -532,23 +547,21 @@ void Gallery::ImplWriteImportList()
 
 // ------------------------------------------------------------------------
 
-GalleryThemeEntry* Gallery::ImplGetThemeEntry( const rtl::OUString& rThemeName )
+GalleryThemeEntry* Gallery::ImplGetThemeEntry( const String& rThemeName )
 {
     GalleryThemeEntry* pFound = NULL;
 
-    if( rThemeName.getLength() )
-    {
+    if( rThemeName.Len() )
         for ( size_t i = 0, n = aThemeList.size(); i < n && !pFound; ++i )
             if( rThemeName == aThemeList[ i ]->GetThemeName() )
                 pFound = aThemeList[ i ];
-    }
 
     return pFound;
 }
 
 // ------------------------------------------------------------------------
 
-GalleryImportThemeEntry* Gallery::ImplGetImportThemeEntry( const rtl::OUString& rImportName )
+GalleryImportThemeEntry* Gallery::ImplGetImportThemeEntry( const String& rImportName )
 {
     for ( size_t i = 0, n = aImportList.size(); i < n; ++i )
         if ( rImportName == aImportList[ i ]->aUIName )
@@ -558,7 +571,7 @@ GalleryImportThemeEntry* Gallery::ImplGetImportThemeEntry( const rtl::OUString&
 
 // ------------------------------------------------------------------------
 
-rtl::OUString Gallery::GetThemeName( sal_uIntPtr nThemeId ) const
+String Gallery::GetThemeName( sal_uIntPtr nThemeId ) const
 {
     GalleryThemeEntry* pFound = NULL;
 
@@ -593,7 +606,7 @@ rtl::OUString Gallery::GetThemeName( sal_uIntPtr nThemeId ) const
         pFound = ( (Gallery*) this )->ImplGetThemeEntry( String::CreateFromAscii( aFallback.GetBuffer() ) );
     }
 
-    return( pFound ? pFound->GetThemeName() : rtl::OUString() );
+    return( pFound ? pFound->GetThemeName() : String() );
 }
 
 // ------------------------------------------------------------------------
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index ddf56cb..1f03f13 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -168,7 +168,7 @@ void SgaObject::WriteData( SvStream& rOut, const String& rDestDir ) const
 
     String aURLWithoutDestDir = String(aURL.GetMainURL( INetURLObject::NO_DECODE ));
     aURLWithoutDestDir.SearchAndReplace(rDestDir, String());
-    write_lenPrefixed_uInt8s_FromOUString(rOut, aURLWithoutDestDir, RTL_TEXTENCODING_UTF8);
+    rOut.WriteByteString(rtl::OUStringToOString(aURLWithoutDestDir, RTL_TEXTENCODING_UTF8));
 }
 
 // ------------------------------------------------------------------------
@@ -185,8 +185,9 @@ void SgaObject::ReadData(SvStream& rIn, sal_uInt16& rReadVersion )
     else
         rIn >> aThumbMtf;
 
-    rtl::OUString aTmpStr = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8);
-    aURL = INetURLObject(aTmpStr);
+    ByteString aTmpStr;
+    rIn.ReadByteString(aTmpStr);
+    aURL = INetURLObject(rtl::OStringToOUString(aTmpStr,RTL_TEXTENCODING_UTF8));
 }
 
 // ------------------------------------------------------------------------
@@ -293,8 +294,9 @@ void SgaObjectBmp::WriteData( SvStream& rOut, const String& rDestDir ) const
     SgaObject::WriteData( rOut, rDestDir );
     char aDummy[ 10 ];
     rOut.Write( aDummy, 10 );
-    write_lenPrefixed_uInt8s_FromOString(rOut, rtl::OString()); //dummy
-    write_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8);
+    String aDummyStr;
+    rOut.WriteByteString(rtl::OUStringToOString(aDummyStr, RTL_TEXTENCODING_UTF8));
+    rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8));
 }
 
 // ------------------------------------------------------------------------
@@ -304,10 +306,14 @@ void SgaObjectBmp::ReadData( SvStream& rIn, sal_uInt16& rReadVersion )
 
     SgaObject::ReadData( rIn, rReadVersion );
     rIn.SeekRel( 10 ); // 16, 16, 32, 16
-    read_lenPrefixed_uInt8s_ToOString(rIn); //dummy
+    ByteString aTmpStr;
+    rIn.ReadByteString(aTmpStr); // dummy
 
     if( rReadVersion >= 5 )
-        aTitle = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8);
+    {
+        rIn.ReadByteString(aTmpStr);
+        aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8);
+    }
 }
 
 // ------------------
@@ -374,7 +380,7 @@ void SgaObjectSound::WriteData( SvStream& rOut, const String& rDestDir ) const
 {
     SgaObject::WriteData( rOut, rDestDir );
     rOut << (sal_uInt16) eSoundType;
-    write_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8);
+    rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8));
 }
 
 // ------------------------------------------------------------------------
@@ -390,7 +396,11 @@ void SgaObjectSound::ReadData( SvStream& rIn, sal_uInt16& rReadVersion )
         rIn >> nTmp16; eSoundType = (GalSoundType) nTmp16;
 
         if( rReadVersion >= 6 )
-            aTitle = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8);
+        {
+            ByteString  aTmpStr;
+            rIn.ReadByteString(aTmpStr);
+            aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8);
+        }
     }
 }
 
@@ -581,7 +591,7 @@ sal_Bool SgaObjectSvDraw::DrawCentered( OutputDevice* pOut, const FmFormModel& r
 void SgaObjectSvDraw::WriteData( SvStream& rOut, const String& rDestDir ) const
 {
     SgaObject::WriteData( rOut, rDestDir );
-    write_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8);
+    rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8));
 }
 
 // ------------------------------------------------------------------------
@@ -591,7 +601,11 @@ void SgaObjectSvDraw::ReadData( SvStream& rIn, sal_uInt16& rReadVersion )
     SgaObject::ReadData( rIn, rReadVersion );
 
     if( rReadVersion >= 5 )
-        aTitle = read_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8);
+    {
+        ByteString aTmpStr;
+        rIn.ReadByteString(aTmpStr);
+        aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8);
+    }
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 4a34a85..12f1e6d 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -733,7 +733,8 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, sa
             {
                 sal_uInt32      nThemeId = 0;
 
-                rtl::OString aTmpStr = read_lenPrefixed_uInt8s_ToOString(*pIStm);
+                ByteString aTmpStr;
+                pIStm->ReadByteString(aTmpStr);
                 aThemeName = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8);
 
                 // Charakterkonvertierung durchfuehren
@@ -1354,7 +1355,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const
     sal_Bool                bRel;
 
     rOStm << (sal_uInt16) 0x0004;
-    write_lenPrefixed_uInt8s_FromOUString(rOStm, GetRealName(), RTL_TEXTENCODING_UTF8);
+    rOStm.WriteByteString(rtl::OUStringToOString(GetRealName(), RTL_TEXTENCODING_UTF8));
     rOStm << nCount << (sal_uInt16) osl_getThreadTextEncoding();
 
     for( sal_uInt32 i = 0; i < nCount; i++ )
@@ -1394,7 +1395,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const
 
         aPath.SearchAndReplace(m_aDestDir, String());
         rOStm << bRel;
-        write_lenPrefixed_uInt8s_FromOUString(rOStm, aPath, RTL_TEXTENCODING_UTF8);
+        rOStm.WriteByteString(rtl::OUStringToOString(aPath, RTL_TEXTENCODING_UTF8));
         rOStm << pObj->nOffset << (sal_uInt16) pObj->eObjKind;
     }
 
@@ -1432,9 +1433,10 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm )
     String              aThemeName;
     rtl_TextEncoding    nTextEncoding;
 
-    aImportName = rtl::OUString();
+    aImportName = String();
     rIStm >> nVersion;
-    rtl::OString aTmpStr = read_lenPrefixed_uInt8s_ToOString(rIStm);
+    ByteString aTmpStr;
+    rIStm.ReadByteString(aTmpStr);
     rIStm >> nCount;
 
     if( nVersion >= 0x0004 )
@@ -1469,12 +1471,13 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm )
         {
             pObj = new GalleryObject;
 
+            ByteString  aTempFileName;
             String      aFileName;
             String      aPath;
             sal_uInt16  nTemp;
 
             rIStm >> bRel;
-            rtl::OString aTempFileName = read_lenPrefixed_uInt8s_ToOString(rIStm);
+            rIStm.ReadByteString(aTempFileName);
             rIStm >> pObj->nOffset;
             rIStm >> nTemp; pObj->eObjKind = (SgaObjKind) nTemp;
 
@@ -1580,7 +1583,7 @@ SvStream& operator>>( SvStream& rIn, GalleryTheme& rTheme )
 void GalleryTheme::ImplSetModified( sal_Bool bModified )
 { pThm->SetModified( bModified ); }
 
-const rtl::OUString& GalleryTheme::GetRealName() const { return pThm->GetThemeName(); }
+const String& GalleryTheme::GetRealName() const { return pThm->GetThemeName(); }
 const INetURLObject& GalleryTheme::GetThmURL() const { return pThm->GetThmURL(); }
 const INetURLObject& GalleryTheme::GetSdgURL() const { return pThm->GetSdgURL(); }
 const INetURLObject& GalleryTheme::GetSdvURL() const { return pThm->GetSdvURL(); }
@@ -1591,7 +1594,7 @@ sal_Bool GalleryTheme::IsImported() const { return pThm->IsImported(); }
 sal_Bool GalleryTheme::IsReadOnly() const { return pThm->IsReadOnly(); }
 sal_Bool GalleryTheme::IsDefault() const { return pThm->IsDefault(); }
 sal_Bool GalleryTheme::IsModified() const { return pThm->IsModified(); }
-const rtl::OUString& GalleryTheme::GetName() const { return IsImported() ? aImportName : pThm->GetThemeName(); }
+const String& GalleryTheme::GetName() const { return IsImported() ? aImportName : pThm->GetThemeName(); }
 
 void GalleryTheme::InsertAllThemes( ListBox& rListBox )
 {
diff --git a/sw/source/filter/ww1/w1class.cxx b/sw/source/filter/ww1/w1class.cxx
index a7e35cd..3e5c3e6 100644
--- a/sw/source/filter/ww1/w1class.cxx
+++ b/sw/source/filter/ww1/w1class.cxx
@@ -85,7 +85,7 @@ String Ww1PlainText::GetText( sal_uLong ulOffset, sal_uLong nLen ) const
 
     bool bSeekOk = rFib.GetStream().Seek(nPos) == nPos;
     rtl::OString a8BitStr = bSeekOk ?
-        read_uInt8s_ToOString(rFib.GetStream(), nLen) :
+        read_uInt8s_AsOString(rFib.GetStream(), nLen) :
         rtl::OString();
     return rtl::OStringToOUString(a8BitStr, RTL_TEXTENCODING_MS_1252);
 }
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0ab1cf6..9923768 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -281,7 +281,7 @@ bool Sttb::Read( SvStream& rS )
         {
             SBBItem aItem;
             rS >> aItem.cchData;
-            aItem.data = read_LEuInt16s_ToOUString(rS, aItem.cchData);
+            aItem.data = read_LEuInt16s_AsOUString(rS, aItem.cchData);
             dataItems.push_back( aItem );
         }
     }
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index b72fcd5..c6702c5 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -4334,7 +4334,7 @@ void WW8RStyle::ImportOldFormatStyles()
             }
             else               // user style
             {
-                rtl::OString aTmp = read_uInt8s_ToOString(rSt, nCount);
+                rtl::OString aTmp = read_uInt8s_AsOString(rSt, nCount);
                 nByteCount += aTmp.getLength();
                 sName = rtl::OStringToOUString(aTmp, eStructChrSet);
             }
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 56981ac..56631b9 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1910,16 +1910,23 @@ Err:
     return false;
 }
 
+String read_uInt8_PascalString(SvStream& rStrm, rtl_TextEncoding eEnc)
+{
+    sal_uInt8 nLen(0);
+    rStrm >> nLen;
+    return rtl::OStringToOUString(read_uInt8s_AsOString(rStrm, nLen), eEnc);
+}
+
 String read_LEuInt16_PascalString(SvStream& rStrm)
 {
     sal_uInt16 nLen(0);
     rStrm >> nLen;
-    return read_LEuInt16s_ToOUString(rStrm, nLen);
+    return read_LEuInt16s_AsOUString(rStrm, nLen);
 }
 
 String read_uInt8_BeltAndBracesString(SvStream& rStrm, rtl_TextEncoding eEnc)
 {
-    rtl::OUString aRet = read_lenPrefixed_uInt8s_ToOUString<sal_uInt8>(rStrm, eEnc);
+    String aRet = read_uInt8_PascalString(rStrm, eEnc);
     rStrm.SeekRel(sizeof(sal_uInt8)); // skip null-byte at end
     return aRet;
 }
@@ -1961,11 +1968,11 @@ xub_StrLen WW8ScannerBase::WW8ReadString( SvStream& rStrm, String& rStr,
             nLen = USHRT_MAX - 1;
 
         if( bIsUnicode )
-            rStr.Append(String(read_LEuInt16s_ToOUString(rStrm, nLen)));
+            rStr.Append(String(read_LEuInt16s_AsOUString(rStrm, nLen)));
         else
         {
             // Alloc method automatically sets Zero at the end
-            rtl::OString aByteStr = read_uInt8s_ToOString(rStrm, nLen);
+            rtl::OString aByteStr = read_uInt8s_AsOString(rStrm, nLen);
             rStr.Append(String(rtl::OStringToOUString(aByteStr, eEnc)));
         }
         nTotalRead  += nLen;
@@ -3869,7 +3876,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen
                 {
                     sal_uInt8 nBChar(0);
                     rStrm >> nBChar;
-                    rtl::OString aTmp = read_uInt8s_ToOString(rStrm, nBChar);
+                    rtl::OString aTmp = read_uInt8s_AsOString(rStrm, nBChar);
                     rArray.push_back(rtl::OStringToOUString(aTmp, eCS));
                 }
 
@@ -3902,7 +3909,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen
                     {
                         sal_uInt8 nBChar(0);
                         rStrm >> nBChar;
-                        rtl::OString aTmp = read_uInt8s_ToOString(rStrm, nBChar);
+                        rtl::OString aTmp = read_uInt8s_AsOString(rStrm, nBChar);
                         pValueArray->push_back(rtl::OStringToOUString(aTmp, eCS));
                     }
                 }
@@ -3928,7 +3935,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen
                 ++nRead;
                 if (nBChar)
                 {
-                    rtl::OString aTmp = read_uInt8s_ToOString(rStrm, nBChar);
+                    rtl::OString aTmp = read_uInt8s_AsOString(rStrm, nBChar);
                     nRead += aTmp.getLength();
                     rArray.push_back(rtl::OStringToOUString(aTmp, eCS));
                 }
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 9cac3eb..a323b84 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -136,10 +136,7 @@ public:
 
 //Read a Pascal-style, i.e. single byte string length followed
 //by string contents
-inline String read_uInt8_PascalString(SvStream& rStrm, rtl_TextEncoding eEnc)
-{
-    return read_lenPrefixed_uInt8s_ToOUString<sal_uInt8>(rStrm, eEnc);
-}
+String read_uInt8_PascalString(SvStream& rStrm, rtl_TextEncoding eEnc);
 String read_LEuInt16_PascalString(SvStream& rStrm);
 
 //Belt and Braces strings, i.e. Pascal-style strings followed by
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx
index 06cf7e7..d615d86 100644
--- a/sw/source/filter/ww8/ww8toolbar.cxx
+++ b/sw/source/filter/ww8/ww8toolbar.cxx
@@ -1128,7 +1128,7 @@ bool TcgSttbfCore::Read( SvStream& rS )
         for ( sal_Int32 index = 0; index < cData; ++index )
         {
             rS >> dataItems[ index ].cchData;
-            dataItems[ index ].data = read_LEuInt16s_ToOUString(rS, dataItems[index].cchData);
+            dataItems[ index ].data = read_LEuInt16s_AsOUString(rS, dataItems[index].cchData);
             rS >> dataItems[ index ].extraData;
         }
     }
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 422e090..6f39051 100755
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -1993,9 +1993,9 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
         }   // report useful error!!
 
         rtl_TextEncoding eEncoding = DDE_TXT_ENCODING;
-        aApp = read_zeroTerminated_uInt8s_ToOUString(*xStrm, eEncoding);
-        aTopic = read_zeroTerminated_uInt8s_ToOUString(*xStrm, eEncoding);
-        aItem = read_zeroTerminated_uInt8s_ToOUString(*xStrm, eEncoding);
+        aApp = read_zeroTerminated_uInt8s_AsOUString(*xStrm, eEncoding);
+        aTopic = read_zeroTerminated_uInt8s_AsOUString(*xStrm, eEncoding);
+        aItem = read_zeroTerminated_uInt8s_AsOUString(*xStrm, eEncoding);
     }
 
     String aCmd;
diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx
index 7c88b9c..610b804 100644
--- a/tools/inc/tools/inetmsg.hxx
+++ b/tools/inc/tools/inetmsg.hxx
@@ -51,7 +51,7 @@ class INetMessageHeader
     ByteString m_aValue;
 
 public:
-    INetMessageHeader()
+    INetMessageHeader (void)
     {}
 
     INetMessageHeader (
@@ -64,7 +64,7 @@ public:
         : m_aName (rHdr.m_aName), m_aValue (rHdr.m_aValue)
     {}
 
-    ~INetMessageHeader()
+    ~INetMessageHeader (void)
     {}
 
     INetMessageHeader& operator= (const INetMessageHeader& rHdr)
@@ -74,22 +74,22 @@ public:
         return *this;
     }
 
-    const ByteString& GetName() const { return m_aName; }
-    const ByteString& GetValue() const { return m_aValue; }
+    const ByteString& GetName  (void) const { return m_aName; }
+    const ByteString& GetValue (void) const { return m_aValue; }
 
     friend SvStream& operator<< (
         SvStream& rStrm, const INetMessageHeader& rHdr)
     {
-        write_lenPrefixed_uInt8s_FromOString(rStrm, rHdr.m_aName);
-        write_lenPrefixed_uInt8s_FromOString(rStrm, rHdr.m_aValue);
+        rStrm.WriteByteString (rHdr.m_aName);
+        rStrm.WriteByteString (rHdr.m_aValue);
         return rStrm;
     }
 
     friend SvStream& operator>> (
         SvStream& rStrm, INetMessageHeader& rHdr)
     {
-        rHdr.m_aName = read_lenPrefixed_uInt8s_ToOString(rStrm);
-        rHdr.m_aValue = read_lenPrefixed_uInt8s_ToOString(rStrm);
+        rStrm.ReadByteString (rHdr.m_aName);
+        rStrm.ReadByteString (rHdr.m_aValue);
         return rStrm;
     }
 };
@@ -108,7 +108,7 @@ class INetMessage
     UniString       m_aDocName;
     SvLockBytesRef  m_xDocLB;
 
-    void ListCleanup_Impl();
+    void ListCleanup_Impl (void);
     void ListCopy (const INetMessage& rMsg);
 
 protected:
@@ -158,8 +158,8 @@ protected:
     virtual SvStream& operator>> (SvStream& rStrm);
 
 public:
-    INetMessage() : m_nDocSize(0) {}
-    virtual ~INetMessage();
+    INetMessage (void) : m_nDocSize(0) {}
+    virtual ~INetMessage (void);
 
     INetMessage (const INetMessage& rMsg)
         : m_nDocSize (rMsg.m_nDocSize),
@@ -178,7 +178,7 @@ public:
         return *this;
     }
 
-    sal_uIntPtr GetHeaderCount() const { return m_aHeaderList.size(); }
+    sal_uIntPtr GetHeaderCount (void) const { return m_aHeaderList.size(); }
 
     UniString GetHeaderName (sal_uIntPtr nIndex) const
     {
@@ -204,13 +204,13 @@ public:
         sal_uIntPtr nIndex = ((sal_uIntPtr)-1)
     );
 
-    sal_uIntPtr GetDocumentSize() const { return m_nDocSize; }
+    sal_uIntPtr GetDocumentSize (void) const { return m_nDocSize; }
     void  SetDocumentSize (sal_uIntPtr nSize) { m_nDocSize = nSize; }
 
-    const UniString& GetDocumentName() const { return m_aDocName; }
+    const UniString& GetDocumentName (void) const { return m_aDocName; }
     void  SetDocumentName (const UniString& rName) { m_aDocName = rName; }
 
-    SvLockBytes* GetDocumentLB() const { return m_xDocLB; }
+    SvLockBytes* GetDocumentLB (void) const { return m_xDocLB; }
     void         SetDocumentLB (SvLockBytes *pDocLB) { m_xDocLB = pDocLB; }
 
     friend SvStream& operator<< (
@@ -260,9 +260,9 @@ protected:
     virtual SvStream& operator>> (SvStream& rStrm);
 
 public:
-    INetRFC822Message();
+    INetRFC822Message (void);
     INetRFC822Message (const INetRFC822Message& rMsg);
-    virtual ~INetRFC822Message();
+    virtual ~INetRFC822Message (void);
 
     INetRFC822Message& operator= (const INetRFC822Message& rMsg);
 
@@ -277,105 +277,105 @@ public:
 
     /** Header fields.
      */
-    UniString GetBCC() const
+    UniString GetBCC (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_BCC],
             INetMIME::HEADER_FIELD_ADDRESS);
     }
 
-    UniString GetCC() const
+    UniString GetCC (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_CC],
             INetMIME::HEADER_FIELD_ADDRESS);
     }
 
-    UniString GetComments() const
+    UniString GetComments (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_COMMENTS],
             INetMIME::HEADER_FIELD_TEXT);
     }
 
-    UniString GetDate() const
+    UniString GetDate (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_DATE],
             INetMIME::HEADER_FIELD_STRUCTURED);
     }
 
-    UniString GetFrom() const
+    UniString GetFrom (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_FROM],
             INetMIME::HEADER_FIELD_ADDRESS);
     }
 
-    UniString GetInReplyTo() const
+    UniString GetInReplyTo (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_IN_REPLY_TO],
             INetMIME::HEADER_FIELD_ADDRESS); // ??? MESSAGE_ID ???
     }
 
-    UniString GetKeywords() const
+    UniString GetKeywords (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_KEYWORDS],
             INetMIME::HEADER_FIELD_PHRASE);
     }
 
-    UniString GetMessageID() const
+    UniString GetMessageID (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_MESSAGE_ID],
             INetMIME::HEADER_FIELD_MESSAGE_ID);
     }
 
-    UniString GetReferences() const
+    UniString GetReferences (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_REFERENCES],
             INetMIME::HEADER_FIELD_ADDRESS);
     }
 
-    UniString GetReplyTo() const
+    UniString GetReplyTo (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_REPLY_TO],
             INetMIME::HEADER_FIELD_ADDRESS);
     }
 
-    UniString GetReturnPath() const
+    UniString GetReturnPath (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_RETURN_PATH],
             INetMIME::HEADER_FIELD_ADDRESS);
     }
 
-    UniString GetReturnReceiptTo() const
+    UniString GetReturnReceiptTo (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_RETURN_RECEIPT_TO],
             INetMIME::HEADER_FIELD_ADDRESS);
     }
 
-    UniString GetSender() const
+    UniString GetSender (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_SENDER],
             INetMIME::HEADER_FIELD_ADDRESS);
     }
 
-    UniString GetSubject() const
+    UniString GetSubject (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_SUBJECT],
             INetMIME::HEADER_FIELD_TEXT);
     }
 
-    UniString GetTo() const
+    UniString GetTo (void) const
     {
         return GetHeaderValue_Impl (
             m_nIndex[INETMSG_RFC822_TO],
@@ -430,15 +430,15 @@ class TOOLS_DLLPUBLIC INetMIMEMessage : public INetRFC822Message
 
     INetMIMEMessage*        pParent;
     INetMIMEMessgeList_impl aChildren;
-    rtl::OString            m_aBoundary;
+    ByteString              m_aBoundary;
     sal_Bool                bHeaderParsed;
 
     friend class INetMIMEMessageStream;
 
-    const rtl::OString& GetMultipartBoundary() const { return m_aBoundary; }
-    void SetMultipartBoundary (const rtl::OString& rBnd) { m_aBoundary = rBnd; }
+    const ByteString& GetMultipartBoundary (void) const { return m_aBoundary; }
+    void SetMultipartBoundary (const ByteString& rBnd) { m_aBoundary = rBnd; }
 
-    void CleanupImp();
+    void CleanupImp (void);
     void CopyImp    (const INetMIMEMessage& rMsg);
     void SetHeaderParsed() { bHeaderParsed = sal_True; }
 
@@ -447,9 +447,9 @@ protected:
     virtual SvStream& operator>> (SvStream& rStrm);
 
 public:
-    INetMIMEMessage();
+    INetMIMEMessage (void);
     INetMIMEMessage (const INetMIMEMessage& rMsg);
-    virtual ~INetMIMEMessage();
+    virtual ~INetMIMEMessage (void);
 
     INetMIMEMessage& operator= (const INetMIMEMessage& rMsg);
 
@@ -467,35 +467,35 @@ public:
     /** Header fields.
      */
     void      SetMIMEVersion (const UniString& rVersion);
-    UniString GetMIMEVersion() const
+    UniString GetMIMEVersion (void) const
     {
         return GetHeaderValue (m_nIndex[INETMSG_MIME_VERSION]);
     }
 
-    UniString GetContentDescription() const
+    UniString GetContentDescription (void) const
     {
         return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_DESCRIPTION]);
     }
 
     void      SetContentDisposition (const UniString& rDisposition);
-    UniString GetContentDisposition() const
+    UniString GetContentDisposition (void) const
     {
         return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_DISPOSITION]);
     }
 
-    UniString GetContentID() const
+    UniString GetContentID (void) const
     {
         return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_ID]);
     }
 
     void      SetContentType (const UniString& rType);
-    UniString GetContentType() const
+    UniString GetContentType (void) const
     {
         return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_TYPE]);
     }
 
     void      SetContentTransferEncoding (const UniString& rEncoding);
-    UniString GetContentTransferEncoding() const
+    UniString GetContentTransferEncoding (void) const
     {
         return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_TRANSFER_ENCODING]);
     }
@@ -504,16 +504,16 @@ public:
 
     /** Message container methods.
      */
-    sal_Bool IsContainer() const
+    sal_Bool IsContainer (void) const
     {
         return (IsMessage() || IsMultipart());
     }
-    sal_Bool IsMessage() const
+    sal_Bool IsMessage (void) const
     {
         UniString aType (GetContentType());
         return (aType.CompareIgnoreCaseToAscii("message/", 8) == 0);
     }
-    sal_Bool IsMultipart() const
+    sal_Bool IsMultipart (void) const
     {
         UniString aType (GetContentType());
         return (aType.CompareIgnoreCaseToAscii("multipart/", 10) == 0);
@@ -523,7 +523,7 @@ public:
     {
         return ( nIndex < aChildren.size() ) ? aChildren[ nIndex ] : NULL;
     }
-    INetMIMEMessage* GetParent() const { return pParent; }
+    INetMIMEMessage* GetParent (void) const { return pParent; }
 
     sal_Bool EnableAttachChild (
         INetMessageContainerType eType = INETMSG_MULTIPART_MIXED);
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index e6e939b..66312b7 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -28,7 +28,6 @@
 #ifndef _STREAM_HXX
 #define _STREAM_HXX
 
-#include <limits>
 #include "tools/toolsdllapi.h"
 #include <tools/solar.h>
 #include <tools/string.hxx>
@@ -365,8 +364,10 @@ public:
 
     SvStream&       ReadByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet );
     SvStream&       ReadByteString( UniString& rStr ) { return ReadByteString( rStr, GetStreamCharSet() ); }
+    SvStream&       ReadByteString( ByteString& rStr );
     SvStream&       WriteByteString( const UniString& rStr, rtl_TextEncoding eDestCharSet );
     SvStream&       WriteByteString( const UniString& rStr ) { return WriteByteString( rStr, GetStreamCharSet() ); }
+    SvStream&       WriteByteString( const ByteString& rStr );
 
     SvStream&       WriteNumber( sal_uInt32 nUInt32 );
     SvStream&       WriteNumber( sal_Int32 nInt32 );
@@ -545,70 +546,22 @@ TOOLS_DLLPUBLIC SvStream& endlub( SvStream& rStr );
 
 //Attempt to read nLen 8bit units to an OString, returned rtl::OString's length
 //is number of units successfully read
-TOOLS_DLLPUBLIC rtl::OString read_uInt8s_ToOString(SvStream& rStrm, sal_Size nLen);
+TOOLS_DLLPUBLIC rtl::OString read_uInt8s_AsOString(SvStream& rStr, sal_Size nLen);
 
 //Attempt to read nLen little endian 16bit units to an OUString, returned
 //rtl::OUString's length is number of units successfully read
-TOOLS_DLLPUBLIC rtl::OUString read_LEuInt16s_ToOUString(SvStream& rStrm, sal_Size nLen);
+TOOLS_DLLPUBLIC rtl::OUString read_LEuInt16s_AsOUString(SvStream& rStr, sal_Size nLen);
 
 //Attempt to read 8bit units to an OString until a zero terminator is
 //encountered, returned rtl::OString's length is number of units *definitely*
 //successfully read, check SvStream::good() to see if null terminator was
 //sucessfully read
-TOOLS_DLLPUBLIC rtl::OString read_zeroTerminated_uInt8s_ToOString(SvStream& rStrm);
+TOOLS_DLLPUBLIC rtl::OString read_zeroTerminated_uInt8s_AsOString(SvStream& rStr);
 
 //Attempt to read 8bit units assuming source encoding eEnc to an OUString until
 //a zero terminator is encountered. Check SvStream::good() to see if null
 //terminator was sucessfully read
-TOOLS_DLLPUBLIC rtl::OUString read_zeroTerminated_uInt8s_ToOUString(SvStream& rStrm, rtl_TextEncoding eEnc);
-
-//Attempt to read a pascal-style length (of type prefix) prefixed sequence of
-//8bit units to an OString, returned rtl::OString's length is number of units
-//successfully read.
-template<typename prefix=sal_uInt16> rtl::OString read_lenPrefixed_uInt8s_ToOString(SvStream& rStrm)
-{
-    prefix nLen = 0;
-    rStrm >> nLen;
-    return read_uInt8s_ToOString(rStrm, nLen);
-}
-
-//Attempt to read a pascal-style length (of type prefix) prefixed sequence of
-//8bit units to an OUString
-template<typename prefix=sal_uInt16> rtl::OUString read_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm,
-    rtl_TextEncoding eEnc)
-{
-    return rtl::OStringToOUString(read_lenPrefixed_uInt8s_ToOString<prefix>(rStrm), eEnc);
-}
-
-//Attempt to write a pascal-style length (of type prefix) prefixed sequence of
-//8bit units from an OString, returned value is number of bytes written (including
-//byte-count of prefix)
-template<typename prefix=sal_uInt16> sal_Size write_lenPrefixed_uInt8s_FromOString(SvStream& rStrm,
-    const rtl::OString &rStr)
-{
-    SAL_WARN_IF(rStr.getLength() > std::numeric_limits<prefix>::max(),
-        "tools.stream",
-        "string too long for prefix count to fit in output type");
-
-    sal_Size nWritten = 0;
-    prefix nLen = std::min<sal_Size>(rStr.getLength(), std::numeric_limits<prefix>::max());
-    rStrm << nLen;
-    if (rStrm.good())
-    {
-        nWritten += sizeof(prefix);
-        nWritten += rStrm.Write(rStr.getStr(), nLen);
-    }
-    return nWritten;
-}
-
-//Attempt to write a pascal-style length (of type prefix) prefixed sequence of
-//8bit units from an OUString, returned value is number of bytes written (including
-//byte-count of prefix)
-template<typename prefix=sal_uInt16> sal_Size write_lenPrefixed_uInt8s_FromOUString(SvStream& rStrm,
-    const rtl::OUString &rStr, rtl_TextEncoding eEnc)
-{
-    return write_lenPrefixed_uInt8s_FromOString<prefix>(rStrm, rtl::OUStringToOString(rStr, eEnc));
-}
+TOOLS_DLLPUBLIC rtl::OUString read_zeroTerminated_uInt8s_AsOUString(SvStream& rStr, rtl_TextEncoding eEnc);
 
 // --------------
 // - FileStream -
diff --git a/tools/qa/cppunit/test_stream.cxx b/tools/qa/cppunit/test_stream.cxx
index 3e7580f..77c2b9e 100644
--- a/tools/qa/cppunit/test_stream.cxx
+++ b/tools/qa/cppunit/test_stream.cxx
@@ -47,13 +47,11 @@ namespace
         void test_stdstream();
         void test_fastostring();
         void test_read_cstring();
-        void test_read_pstring();
 
         CPPUNIT_TEST_SUITE(Test);
         CPPUNIT_TEST(test_stdstream);
         CPPUNIT_TEST(test_fastostring);
         CPPUNIT_TEST(test_read_cstring);
-        CPPUNIT_TEST(test_read_pstring);
         CPPUNIT_TEST_SUITE_END();
     };
 
@@ -69,7 +67,7 @@ namespace
 
         char tools_a(78);
         aMemStream >> tools_a;
-        CPPUNIT_ASSERT(tools_a == 'f');
+        CPPUNIT_ASSERT(std_a == 'f');
 
         iss.seekg(0, std::ios_base::end);
         //seeking to end doesn't set eof, reading past eof does
@@ -100,7 +98,7 @@ namespace
         //a failed read doesn't change the data, it remains unchanged
         CPPUNIT_ASSERT(tools_a == 78);
         //nothing wrong with the stream, so not bad
-        CPPUNIT_ASSERT(!aMemStream.bad());
+        CPPUNIT_ASSERT(!aMemStream.GetError());
         //yet, the read didn't succeed
         CPPUNIT_ASSERT(!aMemStream.good());
 
@@ -135,18 +133,18 @@ namespace
         char foo[] = "foobar";
         SvMemoryStream aMemStream(RTL_CONSTASCII_STRINGPARAM(foo), STREAM_READ);
 
-        rtl::OString aOne = read_uInt8s_ToOString(aMemStream, 3);
+        rtl::OString aOne = read_uInt8s_AsOString(aMemStream, 3);
         CPPUNIT_ASSERT(aOne.equalsL(RTL_CONSTASCII_STRINGPARAM("foo")));
 
-        rtl::OString aTwo = read_uInt8s_ToOString(aMemStream, 3);
+        rtl::OString aTwo = read_uInt8s_AsOString(aMemStream, 3);
         CPPUNIT_ASSERT(aTwo.equalsL(RTL_CONSTASCII_STRINGPARAM("bar")));
 
-        rtl::OString aThree = read_uInt8s_ToOString(aMemStream, 3);
+        rtl::OString aThree = read_uInt8s_AsOString(aMemStream, 3);
         CPPUNIT_ASSERT(!aThree.getLength());
 
         aMemStream.Seek(0);
 
-        rtl::OString aFour = read_uInt8s_ToOString(aMemStream, 100);
+        rtl::OString aFour = read_uInt8s_AsOString(aMemStream, 100);
         CPPUNIT_ASSERT(aFour.equalsL(RTL_CONSTASCII_STRINGPARAM(foo)));
     }
 
@@ -155,7 +153,7 @@ namespace
         char foo[] = "foobar";
         SvMemoryStream aMemStream(RTL_CONSTASCII_STRINGPARAM(foo), STREAM_READ);
 
-        rtl::OString aOne = read_zeroTerminated_uInt8s_ToOString(aMemStream);
+        rtl::OString aOne = read_zeroTerminated_uInt8s_AsOString(aMemStream);
         CPPUNIT_ASSERT(aOne.equalsL(RTL_CONSTASCII_STRINGPARAM("foobar")));
         CPPUNIT_ASSERT(!aMemStream.good());
         CPPUNIT_ASSERT(!aMemStream.bad());
@@ -163,52 +161,11 @@ namespace
 
         aMemStream.Seek(0);
         foo[3] = 0;
-        rtl::OString aTwo = read_zeroTerminated_uInt8s_ToOString(aMemStream);
+        rtl::OString aTwo = read_zeroTerminated_uInt8s_AsOString(aMemStream);
         CPPUNIT_ASSERT(aTwo.equalsL(RTL_CONSTASCII_STRINGPARAM("foo")));
         CPPUNIT_ASSERT(aMemStream.good());
     }
 
-    void Test::test_read_pstring()
-    {
-        char foo[] = "\3foobar";
-        SvMemoryStream aMemStream(RTL_CONSTASCII_STRINGPARAM(foo), STREAM_READ);
-
-        rtl::OString aFoo = read_lenPrefixed_uInt8s_ToOString<sal_uInt8>(aMemStream);
-        CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("foo")));
-        CPPUNIT_ASSERT(aMemStream.good());
-        CPPUNIT_ASSERT(!aMemStream.bad());
-        CPPUNIT_ASSERT(!aMemStream.eof());
-
-        aMemStream.Seek(0);
-        foo[0] = 10;
-        aFoo = read_lenPrefixed_uInt8s_ToOString<sal_uInt8>(aMemStream);
-        CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("foobar")));
-        CPPUNIT_ASSERT(!aMemStream.good());
-        CPPUNIT_ASSERT(!aMemStream.bad());
-        CPPUNIT_ASSERT(aMemStream.eof());
-
-        aMemStream.SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN);
-        aMemStream.Seek(0);
-        foo[0] = 0;
-        foo[1] = 3;
-        aFoo = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(aMemStream);
-        CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("oob")));
-        CPPUNIT_ASSERT(aMemStream.good());
-        CPPUNIT_ASSERT(!aMemStream.bad());
-        CPPUNIT_ASSERT(!aMemStream.eof());
-
-        aMemStream.SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
-        aMemStream.Seek(0);
-        foo[0] = 3;
-        foo[1] = 0;
-        foo[2] = 0;
-        foo[3] = 0;
-        aFoo = read_lenPrefixed_uInt8s_ToOString<sal_uInt32>(aMemStream);
-        CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("bar")));
-        CPPUNIT_ASSERT(aMemStream.good());
-        CPPUNIT_ASSERT(!aMemStream.bad());
-        CPPUNIT_ASSERT(!aMemStream.eof());
-    }
 
     CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 }
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index f626dcc..f5fa071 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -66,7 +66,7 @@ inline sal_Unicode ascii_toLowerCase( sal_Unicode ch )
 /*
  * ~INetMessage.
  */
-INetMessage::~INetMessage()
+INetMessage::~INetMessage (void)
 {
     ListCleanup_Impl();
 }
@@ -74,7 +74,7 @@ INetMessage::~INetMessage()
 /*
  * ListCleanup_Impl.
  */
-void INetMessage::ListCleanup_Impl()
+void INetMessage::ListCleanup_Impl (void)
 {
     // Cleanup.
     sal_uIntPtr i, n = m_aHeaderList.size();
@@ -243,7 +243,7 @@ enum _ImplINetRFC822MessageHeaderState
 /*
  * INetRFC822Message.
  */
-INetRFC822Message::INetRFC822Message()
+INetRFC822Message::INetRFC822Message (void)
     : INetMessage()
 {
     for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++)
@@ -275,7 +275,7 @@ INetRFC822Message& INetRFC822Message::operator= (const INetRFC822Message& rMsg)
 /*
  * ~INetRFC822Message.
  */
-INetRFC822Message::~INetRFC822Message()
+INetRFC822Message::~INetRFC822Message (void)
 {
 }
 
@@ -753,7 +753,7 @@ enum _ImplINetMIMEMessageHeaderState
 /*
  * INetMIMEMessage.
  */
-INetMIMEMessage::INetMIMEMessage()
+INetMIMEMessage::INetMIMEMessage (void)
     : INetRFC822Message (),
       pParent       (NULL),
       bHeaderParsed (sal_False)
@@ -792,7 +792,7 @@ INetMIMEMessage& INetMIMEMessage::operator= (
 /*
  * ~INetMIMEMessage.
  */
-INetMIMEMessage::~INetMIMEMessage()
+INetMIMEMessage::~INetMIMEMessage (void)
 {
     // Cleanup.
     CleanupImp();
@@ -801,7 +801,7 @@ INetMIMEMessage::~INetMIMEMessage()
 /*
  * CleanupImp.
  */
-void INetMIMEMessage::CleanupImp()
+void INetMIMEMessage::CleanupImp (void)
 {
     for( size_t i = 0, n = aChildren.size(); i < n; ++i ) {
         delete aChildren[ i ];
@@ -1161,7 +1161,7 @@ SvStream& INetMIMEMessage::operator<< (SvStream& rStrm) const
     for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++)
         rStrm << static_cast<sal_uInt32>(m_nIndex[i]);
 
-    write_lenPrefixed_uInt8s_FromOString(rStrm, m_aBoundary);
+    rStrm.WriteByteString (m_aBoundary);
     rStrm << static_cast<sal_uInt32>(aChildren.size());
 
     return rStrm;
@@ -1181,7 +1181,7 @@ SvStream& INetMIMEMessage::operator>> (SvStream& rStrm)
         m_nIndex[i] = nTemp;
     }
 
-    m_aBoundary = read_lenPrefixed_uInt8s_ToOString(rStrm);
+    rStrm.ReadByteString (m_aBoundary);
 
     rStrm >> nTemp;
 
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index 5345067..d70d84d 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -1608,7 +1608,7 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize)
 
                 // Multipart message body. Initialize multipart delimiters.
                 // Multipart message.
-                if (pMsg->GetMultipartBoundary().getLength() == 0)
+                if (pMsg->GetMultipartBoundary().Len() == 0)
                 {
                     // Determine boundary.
                     rtl::OString aType(rtl::OUStringToOString(
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index b701959..5fa5b0e 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -806,7 +806,7 @@ sal_Bool SvStream::ReadUniOrByteStringLine( String& rStr, rtl_TextEncoding eSrcC
         return ReadByteStringLine( rStr, eSrcCharSet );
 }
 
-rtl::OString read_zeroTerminated_uInt8s_ToOString(SvStream& rStream)
+rtl::OString read_zeroTerminated_uInt8s_AsOString(SvStream& rStream)
 {
     rtl::OStringBuffer aOutput;
 
@@ -839,10 +839,10 @@ rtl::OString read_zeroTerminated_uInt8s_ToOString(SvStream& rStream)
     return aOutput.makeStringAndClear();
 }
 
-rtl::OUString read_zeroTerminated_uInt8s_ToOUString(SvStream& rStream, rtl_TextEncoding eEnc)
+rtl::OUString read_zeroTerminated_uInt8s_AsOUString(SvStream& rStream, rtl_TextEncoding eEnc)
 {
     return rtl::OStringToOUString(
-        read_zeroTerminated_uInt8s_ToOString(rStream), eEnc);
+        read_zeroTerminated_uInt8s_AsOString(rStream), eEnc);
 }
 
 /*************************************************************************
@@ -1517,7 +1517,19 @@ SvStream& SvStream::ReadByteString( UniString& rStr, rtl_TextEncoding eSrcCharSe
         return *this;
     }
 
-    rStr = read_lenPrefixed_uInt8s_ToOUString(*this, eSrcCharSet);
+    ByteString aStr;
+    ReadByteString( aStr );
+    rStr = UniString( aStr, eSrcCharSet );
+    return *this;
+}
+
+// -----------------------------------------------------------------------
+
+SvStream& SvStream::ReadByteString( ByteString& rStr )
+{
+    sal_uInt16 nLen = 0;
+    operator>>( nLen );
+    rStr = read_uInt8s_AsOString(*this, nLen);
     return *this;
 }
 
@@ -1551,7 +1563,17 @@ SvStream& SvStream::WriteByteString( const UniString& rStr, rtl_TextEncoding eDe
         return *this;
     }
 
-    write_lenPrefixed_uInt8s_FromOUString(*this, rStr, eDestCharSet);
+    return WriteByteString(rtl::OUStringToOString(rStr, eDestCharSet));
+}
+
+// -----------------------------------------------------------------------
+
+SvStream& SvStream::WriteByteString( const ByteString& rStr)
+{
+    sal_uInt16 nLen = rStr.Len();
+    operator<< ( nLen );
+    if( nLen != 0 )
+        Write( rStr.GetBuffer(), nLen );
     return *this;
 }
 
@@ -2432,7 +2454,7 @@ void SvDataCopyStream::Assign( const SvDataCopyStream& )
 }
 
 //Create a OString of nLen bytes from rStream
-rtl::OString read_uInt8s_ToOString(SvStream& rStrm, sal_Size nLen)
+rtl::OString read_uInt8s_AsOString(SvStream& rStrm, sal_Size nLen)
 {
     using comphelper::string::rtl_string_alloc;
 
@@ -2459,7 +2481,7 @@ rtl::OString read_uInt8s_ToOString(SvStream& rStrm, sal_Size nLen)
 }
 
 //Create a OUString of nLen little endian sal_Unicodes from rStream
-rtl::OUString read_LEuInt16s_ToOUString(SvStream& rStrm, sal_Size nLen)
+rtl::OUString read_LEuInt16s_AsOUString(SvStream& rStrm, sal_Size nLen)
 {
     using comphelper::string::rtl_uString_alloc;
 
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 636df96..30a2337 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -795,6 +795,7 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
 
     if( nCount )
     {
+        const ByteString    aDummyStr;
         const sal_uInt32    nDummy32 = 0UL;
 
         // Falls keine BitmapEx gesetzt wurde, schreiben wir
@@ -824,7 +825,7 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
             rOStm << nDummy32;  // unbenutzt
             rOStm << nDummy32;  // unbenutzt
             rOStm << nDummy32;  // unbenutzt
-            write_lenPrefixed_uInt8s_FromOString(rOStm, rtl::OString()); // dummy
+            rOStm.WriteByteString(aDummyStr); // unbenutzt
             rOStm << nRest;     // Anzahl der Strukturen, die noch _folgen_
         }
     }
@@ -871,6 +872,7 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
     {
         AnimationBitmap aAnimBmp;
         BitmapEx        aBmpEx;
+        ByteString      aDummyStr;
         sal_uInt32          nTmp32;
         sal_uInt16          nTmp16;
         sal_uInt8           cTmp;
@@ -888,7 +890,7 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
             rIStm >> nTmp32;    // unbenutzt
             rIStm >> nTmp32;    // unbenutzt
             rIStm >> nTmp32;    // unbenutzt
-            read_lenPrefixed_uInt8s_ToOString(rIStm); // unbenutzt
+            rIStm.ReadByteString(aDummyStr); // unbenutzt
             rIStm >> nTmp16;    // Rest zu lesen
 
             rAnimation.Insert( aAnimBmp );
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 738a590..7efd1f6 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -877,7 +877,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
                     rIStm >> aPt >> nIndex >> nLen >> nTmp;
                     if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) )
                     {
-                        rtl::OString aByteStr = read_uInt8s_ToOString(rIStm, nTmp);
+                        rtl::OString aByteStr = read_uInt8s_AsOString(rIStm, nTmp);
                         sal_uInt8 nTerminator = 0;
                         rIStm >> nTerminator;
                         DBG_ASSERT( nTerminator == 0, "expected string to be NULL terminated" );
@@ -899,7 +899,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
                     rIStm >> aPt >> nIndex >> nLen >> nTmp >> nAryLen;
                     if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) )
                     {
-                        rtl::OString aByteStr = read_uInt8s_ToOString(rIStm, nTmp);
+                        rtl::OString aByteStr = read_uInt8s_AsOString(rIStm, nTmp);
                         sal_uInt8 nTerminator = 0;
                         rIStm >> nTerminator;
                         DBG_ASSERT( nTerminator == 0, "expected string to be NULL terminated" );
@@ -962,7 +962,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
                     rIStm >> aPt >> nIndex >> nLen >> nTmp >> nWidth;
                     if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_INT16 - 1 ) ) )
                     {
-                        rtl::OString aByteStr = read_uInt8s_ToOString(rIStm, nTmp);
+                        rtl::OString aByteStr = read_uInt8s_AsOString(rIStm, nTmp);
                         sal_uInt8 nTerminator = 0;
                         rIStm >> nTerminator;
                         DBG_ASSERT( nTerminator == 0, "expected string to be NULL terminated" );
@@ -1322,12 +1322,13 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
 
                 case( GDI_COMMENT_COMMENT ):
                 {
+                    ByteString  aComment;
                     sal_Int32   nValue;
                     sal_uInt32  nDataSize;
                     sal_uInt8*      pData;
                     sal_Int32       nFollowingActionCount;
 
-                    rtl::OString aComment = read_lenPrefixed_uInt8s_ToOString(rIStm);
+                    rIStm.ReadByteString(aComment);
                     rIStm >> nValue >> nDataSize;
 
                     if( nDataSize )
@@ -2412,7 +2413,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
                 rOStm.SeekRel( 4 );
 
                 // write data
-                write_lenPrefixed_uInt8s_FromOString(rOStm, pA->GetComment());
+                rOStm.WriteByteString(pA->GetComment());
                 rOStm << pA->GetValue() << nDataSize;
 
                 if( nDataSize )
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index 796659c..14b86b2 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -410,21 +410,13 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
                 rOStream.WriteByteString( it->first, RTL_TEXTENCODING_UTF8 );
                 rOStream.WriteByteString( it->second, RTL_TEXTENCODING_UTF8 );
             }
-            write_lenPrefixed_uInt8s_FromOString(rOStream, "COMPAT_DUPLEX_MODE");
+            rOStream.WriteByteString( "COMPAT_DUPLEX_MODE" ) ;
             switch( pJobData->meDuplexMode )
             {
-                case DUPLEX_UNKNOWN:
-                    write_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_UNKNOWN");
-                    break;
-                case DUPLEX_OFF:
-                    write_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_OFF");
-                    break;
-                case DUPLEX_SHORTEDGE:
-                    write_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_SHORTEDGE");
-                    break;
-                case DUPLEX_LONGEDGE:
-                    write_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_LONGEDGE");
-                    break;
+            case DUPLEX_UNKNOWN: rOStream.WriteByteString( "DUPLEX_UNKNOWN" );break;
+            case DUPLEX_OFF: rOStream.WriteByteString( "DUPLEX_OFF" );break;
+            case DUPLEX_SHORTEDGE: rOStream.WriteByteString( "DUPLEX_SHORTEDGE" );break;
+            case DUPLEX_LONGEDGE: rOStream.WriteByteString( "DUPLEX_LONGEDGE" );break;
             }
             nLen = sal::static_int_cast<sal_uInt16>(rOStream.Tell() - nPos);
             rOStream.Seek( nPos );
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 9961705..a0b6c3b 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -4198,7 +4198,7 @@ sal_Bool MetaCommentAction::Compare( const MetaAction& rMetaAction ) const
 void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
 {
     WRITE_BASE_COMPAT( rOStm, 1, pData );
-    write_lenPrefixed_uInt8s_FromOString(rOStm, maComment);
+    rOStm.WriteByteString(maComment);
     rOStm << mnValue << mnDataSize;
 
     if ( mnDataSize )
@@ -4210,10 +4210,13 @@ void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
 void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
     COMPAT( rIStm );
-    maComment = read_lenPrefixed_uInt8s_ToOString(rIStm);
+    ByteString sTmp;
+    rIStm.ReadByteString(sTmp);
+    maComment = sTmp;
     rIStm >> mnValue >> mnDataSize;
 
-    delete[] mpData;
+    if( mpData )
+        delete[] mpData;
 
     if( mnDataSize )
     {
commit fffae28952f20fed693df4de8b8645cf0aedabfa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 21 10:29:33 2011 +0000

    bah, need to tweak for pre c++0x
    
    This reverts commit d00fc0e293852cfc019ffaffa65bee327397677b.

diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 9052458..e6c829a 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -643,17 +643,17 @@ BasicLibInfo* BasicLibInfo::Create( SotStorageStream& rSStream )
 
         // The name of the lib...
         String aName;
-        rSStream.ReadUniOrByteString(aName, rSStream.GetStreamCharSet());
+        rSStream.ReadByteString(aName);
         pInfo->SetLibName( aName );
 
         // Absolute path...
         String aStorageName;
-        rSStream.ReadUniOrByteString(aStorageName, rSStream.GetStreamCharSet());
+        rSStream.ReadByteString(aStorageName);
         pInfo->SetStorageName( aStorageName );
 
         // Relative path...
         String aRelStorageName;
-        rSStream.ReadUniOrByteString(aRelStorageName, rSStream.GetStreamCharSet());
+        rSStream.ReadByteString(aRelStorageName);
         pInfo->SetRelStorageName( aRelStorageName );
 
         if ( nVer >= 2 )
@@ -1041,7 +1041,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
     }
     xManagerStream->Seek( nBasicEndOff+1 ); // +1: 0x00 as separator
     String aLibs;
-    xManagerStream->ReadUniOrByteString(aLibs, xManagerStream->GetStreamCharSet());
+    xManagerStream->ReadByteString(aLibs);
     xManagerStream->SetBufferSize( 0 );
     xManagerStream.Clear(); // Close stream
 
@@ -1235,8 +1235,7 @@ sal_Bool BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurSt
                 if ( ( nPasswordMarker == PASSWORD_MARKER ) && !xBasicStream->IsEof() )
                 {
                     String aPassword;
-                    xBasicStream->ReadUniOrByteString(aPassword,
-                        xBasicStream->GetStreamCharSet());
+                    xBasicStream->ReadByteString(aPassword);
                     pLibInfo->SetPassword( aPassword );
                 }
                 xBasicStream->SetCryptMaskKey(rtl::OString());
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 79b3765..1208184 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -147,15 +147,15 @@ sal_Bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
           switch( nSign )
         {
             case B_NAME:
-                r.ReadUniOrByteString( aName, eCharSet );
+                r.ReadByteString( aName, eCharSet );
                 break;
             case B_COMMENT:
-                r.ReadUniOrByteString( aComment, eCharSet );
+                r.ReadByteString( aComment, eCharSet );
                 break;
             case B_SOURCE:
             {
                 String aTmp;
-                r.ReadUniOrByteString( aTmp, eCharSet );
+                r.ReadByteString( aTmp, eCharSet );
                 aOUSource = aTmp;
                 break;
             }
@@ -164,7 +164,7 @@ sal_Bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
                 for( sal_uInt16 j = 0 ; j < nCount ; j++ )
                 {
                     String aTmp;
-                    r.ReadUniOrByteString( aTmp, eCharSet );
+                    r.ReadByteString( aTmp, eCharSet );
                     aOUSource += aTmp;
                 }
                 break;
@@ -274,14 +274,14 @@ sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
     if( aName.Len() && SbiGood( r ) )
     {
         nPos = SbiOpenRecord( r, B_NAME, 1 );
-        r.WriteUniOrByteString( aName, eCharSet );
+        r.WriteByteString( aName, eCharSet );
         SbiCloseRecord( r, nPos );
     }
     // Comment?
     if( aComment.Len() && SbiGood( r ) )
     {
         nPos = SbiOpenRecord( r, B_COMMENT, 1 );
-        r.WriteUniOrByteString( aComment, eCharSet );
+        r.WriteByteString( aComment, eCharSet );
         SbiCloseRecord( r, nPos );
     }
     // Source?
@@ -295,7 +295,7 @@ sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
             aTmp = aOUSource.copy( 0, nMaxUnitSize );
         else
             aTmp = aOUSource;
-        r.WriteUniOrByteString( aTmp, eCharSet );
+        r.WriteByteString( aTmp, eCharSet );
         SbiCloseRecord( r, nPos );
 
         if( nLen > STRING_MAXLEN )
@@ -309,7 +309,7 @@ sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
                     (nRemainingLen > nMaxUnitSize) ? nMaxUnitSize : nRemainingLen;
                 String aTmp2 = aOUSource.copy( (i+1) * nMaxUnitSize, nCopyLen );
                 nRemainingLen -= nCopyLen;
-                r.WriteUniOrByteString( aTmp2, eCharSet );
+                r.WriteByteString( aTmp2, eCharSet );
             }
             SbiCloseRecord( r, nPos );
         }
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 975ecc2..07194fa 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -2002,7 +2002,7 @@ sal_Bool SbJScriptModule::LoadData( SvStream& rStrm, sal_uInt16 nVer )
 
     // Get the source string
     String aTmp;
-    rStrm.ReadUniOrByteString( aTmp, osl_getThreadTextEncoding() );
+    rStrm.ReadByteString( aTmp, osl_getThreadTextEncoding() );
     aOUSource = aTmp;
     return sal_True;
 }
@@ -2014,7 +2014,7 @@ sal_Bool SbJScriptModule::StoreData( SvStream& rStrm ) const
 
     // Write the source string
     String aTmp = aOUSource;
-    rStrm.WriteUniOrByteString( aTmp, osl_getThreadTextEncoding() );
+    rStrm.WriteByteString( aTmp, osl_getThreadTextEncoding() );
     return sal_True;
 }
 
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 5b25252..2ff6990 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -991,7 +991,7 @@ sal_Bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm,
                 {
                     if( bIsVariant )
                         *pStrm << (sal_uInt16)SbxSTRING;
-                    pStrm->WriteUniOrByteString( rStr, osl_getThreadTextEncoding() );
+                    pStrm->WriteByteString( rStr, osl_getThreadTextEncoding() );
                 }
                 else
                 {
@@ -1107,7 +1107,7 @@ sal_Bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm,
         case SbxLPSTR:
                 {
                 String aStr;
-                pStrm->ReadUniOrByteString( aStr, osl_getThreadTextEncoding() );
+                pStrm->ReadByteString( aStr, osl_getThreadTextEncoding() );
                 rVar.PutString( aStr );
                 }
                 break;
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 7ab2d6c..711efdc 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -383,18 +383,15 @@ sal_Bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
 {
     aParams.Remove( 0, aParams.Count() );
     sal_uInt16 nParam;
-    aComment = read_lenPrefixed_uInt8s_ToOUString(rStrm,
-        RTL_TEXTENCODING_ASCII_US);
-    aHelpFile = read_lenPrefixed_uInt8s_ToOUString(rStrm,
-        RTL_TEXTENCODING_ASCII_US);
+    rStrm.ReadByteString( aComment, RTL_TEXTENCODING_ASCII_US );
+    rStrm.ReadByteString( aHelpFile, RTL_TEXTENCODING_ASCII_US );
     rStrm >> nHelpId >> nParam;
     while( nParam-- )
     {
         XubString aName;
         sal_uInt16 nType, nFlags;
         sal_uInt32 nUserData = 0;
-        aName = read_lenPrefixed_uInt8s_ToOUString(rStrm,
-            RTL_TEXTENCODING_ASCII_US);
+        rStrm.ReadByteString( aName, RTL_TEXTENCODING_ASCII_US );
         rStrm >> nType >> nFlags;
         if( nVer > 1 )
             rStrm >> nUserData;
@@ -407,16 +404,13 @@ sal_Bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
 
 sal_Bool SbxInfo::StoreData( SvStream& rStrm ) const
 {
-    write_lenPrefixed_uInt8s_FromOUString(rStrm, aComment,
-        RTL_TEXTENCODING_ASCII_US );
-    write_lenPrefixed_uInt8s_FromOUString(rStrm, aHelpFile,
-        RTL_TEXTENCODING_ASCII_US);
+    rStrm.WriteByteString( aComment, RTL_TEXTENCODING_ASCII_US );
+    rStrm.WriteByteString( aHelpFile, RTL_TEXTENCODING_ASCII_US );
     rStrm << nHelpId << aParams.Count();
     for( sal_uInt16 i = 0; i < aParams.Count(); i++ )
     {
         SbxParamInfo* p = aParams.GetObject( i );
-        write_lenPrefixed_uInt8s_FromOUString(rStrm, p->aName,
-            RTL_TEXTENCODING_ASCII_US);
+        rStrm.WriteByteString( p->aName, RTL_TEXTENCODING_ASCII_US );
         rStrm << (sal_uInt16) p->eType
               << (sal_uInt16) p->nFlags
               << (sal_uInt32) p->nUserData;
diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx
index 9757387..7803ee0 100644
--- a/basic/source/sbx/sbxcoll.cxx
+++ b/basic/source/sbx/sbxcoll.cxx
@@ -279,8 +279,7 @@ sal_Bool SbxStdCollection::LoadData( SvStream& rStrm, sal_uInt16 nVer )
     sal_Bool bRes = SbxCollection::LoadData( rStrm, nVer );
     if( bRes )
     {
-        aElemClass = read_lenPrefixed_uInt8s_ToOUString(rStrm,
-            RTL_TEXTENCODING_ASCII_US);
+        rStrm.ReadByteString( aElemClass, RTL_TEXTENCODING_ASCII_US );
         rStrm >> bAddRemoveOk;
     }
     return bRes;
@@ -291,8 +290,7 @@ sal_Bool SbxStdCollection::StoreData( SvStream& rStrm ) const
     sal_Bool bRes = SbxCollection::StoreData( rStrm );
     if( bRes )
     {
-        write_lenPrefixed_uInt8s_FromOUString(rStrm, aElemClass,
-            RTL_TEXTENCODING_ASCII_US);
+        rStrm.WriteByteString( aElemClass, RTL_TEXTENCODING_ASCII_US );
         rStrm << bAddRemoveOk;
     }
     return bRes;
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 0c98fca..81574ef 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -591,10 +591,8 @@ sal_Bool SbxObject::LoadData( SvStream& rStrm, sal_uInt16 nVer )
         aData.pObj = this;
     sal_uInt32 nSize;
     XubString aDfltProp;
-    aClassName = read_lenPrefixed_uInt8s_ToOUString(rStrm,
-        RTL_TEXTENCODING_ASCII_US);
-    aDfltProp = read_lenPrefixed_uInt8s_ToOUString(rStrm,
-        RTL_TEXTENCODING_ASCII_US);
+    rStrm.ReadByteString( aClassName, RTL_TEXTENCODING_ASCII_US );
+    rStrm.ReadByteString( aDfltProp, RTL_TEXTENCODING_ASCII_US );
     sal_uIntPtr nPos = rStrm.Tell();
     rStrm >> nSize;
     if( !LoadPrivateData( rStrm, nVer ) )
@@ -622,8 +620,8 @@ sal_Bool SbxObject::StoreData( SvStream& rStrm ) const
     XubString aDfltProp;
     if( pDfltProp )
         aDfltProp = pDfltProp->GetName();
-    write_lenPrefixed_uInt8s_FromOUString(rStrm, aClassName, RTL_TEXTENCODING_ASCII_US);
-    write_lenPrefixed_uInt8s_FromOUString(rStrm, aDfltProp, RTL_TEXTENCODING_ASCII_US);
+    rStrm.WriteByteString( aClassName, RTL_TEXTENCODING_ASCII_US );
+    rStrm.WriteByteString( aDfltProp, RTL_TEXTENCODING_ASCII_US );
     sal_uIntPtr nPos = rStrm.Tell();
     rStrm << (sal_uInt32) 0L;
     if( !StorePrivateData( rStrm ) )
@@ -799,7 +797,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
                 aLine += aAttrs2;
             if( !pVar->IsA( TYPE(SbxMethod) ) )
                 aLine.AppendAscii( "  !! Not a Method !!" );
-            write_lenPrefixed_uInt8s_FromOUString(rStrm, aLine, RTL_TEXTENCODING_ASCII_US);
+            rStrm.WriteByteString( aLine, RTL_TEXTENCODING_ASCII_US );
 
             // Output also the object at object-methods
             if ( pVar->GetValues_Impl().eType == SbxOBJECT &&
@@ -832,7 +830,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
                     aLine += aAttrs3;
                 if( !pVar->IsA( TYPE(SbxProperty) ) )
                     aLine.AppendAscii( "  !! Not a Property !!" );
-                write_lenPrefixed_uInt8s_FromOUString(rStrm, aLine, RTL_TEXTENCODING_ASCII_US);
+                rStrm.WriteByteString( aLine, RTL_TEXTENCODING_ASCII_US );
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list