summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-12-19 22:19:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-12-21 10:10:58 +0000
commitd00fc0e293852cfc019ffaffa65bee327397677b (patch)
tree3b28b98fb451bee33eff7c06a93dbb4063f07554
parent92f396733ebc518bcb7a9eae2dd3169d333b82b9 (diff)
disentangle Read/WriteByteString OUString variants
The ones which use a definite 8-bit encoding read/write pascal-style strings with a 16bit length prefix. The ones which use a definite 16-bit encoding read/write pascal-style UTF-16 strings with a 32bit length prefix, i.e. not ByteStrings at all The "I dunno" ones might be UTF-16 strings or 8-bit strings, depending on the charset. Rename to ReadUniOrByteString like the other similar horrors to flag this misery
-rw-r--r--basic/source/basmgr/basmgr.cxx11
-rw-r--r--basic/source/classes/image.cxx16
-rw-r--r--basic/source/classes/sbxmod.cxx4
-rw-r--r--basic/source/runtime/methods1.cxx4
-rw-r--r--basic/source/sbx/sbxbase.cxx18
-rw-r--r--basic/source/sbx/sbxcoll.cxx6
-rw-r--r--basic/source/sbx/sbxobj.cxx14
-rw-r--r--basic/source/sbx/sbxvalue.cxx23
-rw-r--r--basic/source/sbx/sbxvar.cxx19
-rw-r--r--dbaccess/source/ui/tabledesign/TableRow.cxx16
-rw-r--r--editeng/source/editeng/editobj.cxx6
-rw-r--r--editeng/source/items/bulitem.cxx12
-rw-r--r--editeng/source/items/flditem.cxx4
-rw-r--r--editeng/source/items/frmitems.cxx8
-rw-r--r--editeng/source/items/numitem.cxx6
-rw-r--r--editeng/source/items/textitem.cxx16
-rw-r--r--idl/source/objects/module.cxx8
-rw-r--r--sc/source/core/data/patattr.cxx8
-rw-r--r--sc/source/core/tool/autoform.cxx14
-rw-r--r--sc/source/core/tool/ddelink.cxx12
-rw-r--r--sc/source/core/tool/zforauto.cxx4
-rw-r--r--sd/source/filter/html/pubdlg.cxx48
-rw-r--r--sfx2/source/appl/appmisc.cxx4
-rw-r--r--sot/source/sdstor/ucbstorage.cxx2
-rw-r--r--svl/source/items/poolitem.cxx8
-rw-r--r--svl/source/numbers/zformat.cxx10
-rw-r--r--svtools/source/misc/templatefoldercache.cxx6
-rw-r--r--svtools/source/misc/transfer.cxx8
-rw-r--r--svx/source/items/hlnkitem.cxx32
-rw-r--r--svx/source/items/pageitem.cxx4
-rw-r--r--sw/source/core/doc/tblafmt.cxx14
-rw-r--r--sw/source/ui/config/uinums.cxx24
-rw-r--r--tools/inc/tools/stream.hxx11
-rw-r--r--tools/source/inet/inetmsg.cxx4
-rw-r--r--tools/source/stream/stream.cxx4
-rw-r--r--vcl/source/gdi/font.cxx8
-rw-r--r--vcl/source/gdi/jobset.cxx9
-rw-r--r--vcl/source/gdi/metaact.cxx16
-rw-r--r--vcl/source/gdi/print.cxx21
-rw-r--r--vcl/source/gdi/rendergraphic.cxx6
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx13
41 files changed, 257 insertions, 224 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index e6c829adbe2c..9052458e84db 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.ReadByteString(aName);
+ rSStream.ReadUniOrByteString(aName, rSStream.GetStreamCharSet());
pInfo->SetLibName( aName );
// Absolute path...
String aStorageName;
- rSStream.ReadByteString(aStorageName);
+ rSStream.ReadUniOrByteString(aStorageName, rSStream.GetStreamCharSet());
pInfo->SetStorageName( aStorageName );
// Relative path...
String aRelStorageName;
- rSStream.ReadByteString(aRelStorageName);
+ rSStream.ReadUniOrByteString(aRelStorageName, rSStream.GetStreamCharSet());
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->ReadByteString(aLibs);
+ xManagerStream->ReadUniOrByteString(aLibs, xManagerStream->GetStreamCharSet());
xManagerStream->SetBufferSize( 0 );
xManagerStream.Clear(); // Close stream
@@ -1235,7 +1235,8 @@ sal_Bool BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurSt
if ( ( nPasswordMarker == PASSWORD_MARKER ) && !xBasicStream->IsEof() )
{
String aPassword;
- xBasicStream->ReadByteString(aPassword);
+ xBasicStream->ReadUniOrByteString(aPassword,
+ xBasicStream->GetStreamCharSet());
pLibInfo->SetPassword( aPassword );
}
xBasicStream->SetCryptMaskKey(rtl::OString());
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 1208184b5672..79b3765fa1fc 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.ReadByteString( aName, eCharSet );
+ r.ReadUniOrByteString( aName, eCharSet );
break;
case B_COMMENT:
- r.ReadByteString( aComment, eCharSet );
+ r.ReadUniOrByteString( aComment, eCharSet );
break;
case B_SOURCE:
{
String aTmp;
- r.ReadByteString( aTmp, eCharSet );
+ r.ReadUniOrByteString( 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.ReadByteString( aTmp, eCharSet );
+ r.ReadUniOrByteString( 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.WriteByteString( aName, eCharSet );
+ r.WriteUniOrByteString( aName, eCharSet );
SbiCloseRecord( r, nPos );
}
// Comment?
if( aComment.Len() && SbiGood( r ) )
{
nPos = SbiOpenRecord( r, B_COMMENT, 1 );
- r.WriteByteString( aComment, eCharSet );
+ r.WriteUniOrByteString( 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.WriteByteString( aTmp, eCharSet );
+ r.WriteUniOrByteString( 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.WriteByteString( aTmp2, eCharSet );
+ r.WriteUniOrByteString( aTmp2, eCharSet );
}
SbiCloseRecord( r, nPos );
}
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 07194fafc966..975ecc20a0a2 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.ReadByteString( aTmp, osl_getThreadTextEncoding() );
+ rStrm.ReadUniOrByteString( 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.WriteByteString( aTmp, osl_getThreadTextEncoding() );
+ rStrm.WriteUniOrByteString( aTmp, osl_getThreadTextEncoding() );
return sal_True;
}
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 2ff6990e215d..5b25252a780d 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->WriteByteString( rStr, osl_getThreadTextEncoding() );
+ pStrm->WriteUniOrByteString( rStr, osl_getThreadTextEncoding() );
}
else
{
@@ -1107,7 +1107,7 @@ sal_Bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm,
case SbxLPSTR:
{
String aStr;
- pStrm->ReadByteString( aStr, osl_getThreadTextEncoding() );
+ pStrm->ReadUniOrByteString( aStr, osl_getThreadTextEncoding() );
rVar.PutString( aStr );
}
break;
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 711efdcb5afc..7ab2d6c15b37 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -383,15 +383,18 @@ sal_Bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
{
aParams.Remove( 0, aParams.Count() );
sal_uInt16 nParam;
- rStrm.ReadByteString( aComment, RTL_TEXTENCODING_ASCII_US );
- rStrm.ReadByteString( aHelpFile, RTL_TEXTENCODING_ASCII_US );
+ aComment = read_lenPrefixed_uInt8s_ToOUString(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
+ aHelpFile = read_lenPrefixed_uInt8s_ToOUString(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
rStrm >> nHelpId >> nParam;
while( nParam-- )
{
XubString aName;
sal_uInt16 nType, nFlags;
sal_uInt32 nUserData = 0;
- rStrm.ReadByteString( aName, RTL_TEXTENCODING_ASCII_US );
+ aName = read_lenPrefixed_uInt8s_ToOUString(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
rStrm >> nType >> nFlags;
if( nVer > 1 )
rStrm >> nUserData;
@@ -404,13 +407,16 @@ sal_Bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
sal_Bool SbxInfo::StoreData( SvStream& rStrm ) const
{
- rStrm.WriteByteString( aComment, RTL_TEXTENCODING_ASCII_US );
- rStrm.WriteByteString( aHelpFile, RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(rStrm, aComment,
+ RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(rStrm, aHelpFile,
+ RTL_TEXTENCODING_ASCII_US);
rStrm << nHelpId << aParams.Count();
for( sal_uInt16 i = 0; i < aParams.Count(); i++ )
{
SbxParamInfo* p = aParams.GetObject( i );
- rStrm.WriteByteString( p->aName, RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(rStrm, 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 7803ee013b2f..97573876064c 100644
--- a/basic/source/sbx/sbxcoll.cxx
+++ b/basic/source/sbx/sbxcoll.cxx
@@ -279,7 +279,8 @@ sal_Bool SbxStdCollection::LoadData( SvStream& rStrm, sal_uInt16 nVer )
sal_Bool bRes = SbxCollection::LoadData( rStrm, nVer );
if( bRes )
{
- rStrm.ReadByteString( aElemClass, RTL_TEXTENCODING_ASCII_US );
+ aElemClass = read_lenPrefixed_uInt8s_ToOUString(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
rStrm >> bAddRemoveOk;
}
return bRes;
@@ -290,7 +291,8 @@ sal_Bool SbxStdCollection::StoreData( SvStream& rStrm ) const
sal_Bool bRes = SbxCollection::StoreData( rStrm );
if( bRes )
{
- rStrm.WriteByteString( aElemClass, RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(rStrm, aElemClass,
+ RTL_TEXTENCODING_ASCII_US);
rStrm << bAddRemoveOk;
}
return bRes;
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 81574efd0fba..0c98fca20049 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -591,8 +591,10 @@ sal_Bool SbxObject::LoadData( SvStream& rStrm, sal_uInt16 nVer )
aData.pObj = this;
sal_uInt32 nSize;
XubString aDfltProp;
- rStrm.ReadByteString( aClassName, RTL_TEXTENCODING_ASCII_US );
- rStrm.ReadByteString( aDfltProp, RTL_TEXTENCODING_ASCII_US );
+ aClassName = read_lenPrefixed_uInt8s_ToOUString(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
+ aDfltProp = read_lenPrefixed_uInt8s_ToOUString(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
sal_uIntPtr nPos = rStrm.Tell();
rStrm >> nSize;
if( !LoadPrivateData( rStrm, nVer ) )
@@ -620,8 +622,8 @@ sal_Bool SbxObject::StoreData( SvStream& rStrm ) const
XubString aDfltProp;
if( pDfltProp )
aDfltProp = pDfltProp->GetName();
- rStrm.WriteByteString( aClassName, RTL_TEXTENCODING_ASCII_US );
- rStrm.WriteByteString( aDfltProp, RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(rStrm, aClassName, RTL_TEXTENCODING_ASCII_US);
+ write_lenPrefixed_uInt8s_FromOUString(rStrm, aDfltProp, RTL_TEXTENCODING_ASCII_US);
sal_uIntPtr nPos = rStrm.Tell();
rStrm << (sal_uInt32) 0L;
if( !StorePrivateData( rStrm ) )
@@ -797,7 +799,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
aLine += aAttrs2;
if( !pVar->IsA( TYPE(SbxMethod) ) )
aLine.AppendAscii( " !! Not a Method !!" );
- rStrm.WriteByteString( aLine, RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(rStrm, aLine, RTL_TEXTENCODING_ASCII_US);
// Output also the object at object-methods
if ( pVar->GetValues_Impl().eType == SbxOBJECT &&
@@ -830,7 +832,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
aLine += aAttrs3;
if( !pVar->IsA( TYPE(SbxProperty) ) )
aLine.AppendAscii( " !! Not a Property !!" );
- rStrm.WriteByteString( aLine, RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(rStrm, aLine, RTL_TEXTENCODING_ASCII_US);
// output also the object at object properties
if ( pVar->GetValues_Impl().eType == SbxOBJECT &&
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index 0d6aa84e19c7..692959aa9c18 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -1479,8 +1479,8 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
case SbxSINGLE:
{
// Floats as ASCII
- XubString aVal;
- r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
+ XubString aVal = read_lenPrefixed_uInt8s_ToOUString(r,
+ RTL_TEXTENCODING_ASCII_US);
double d;
SbxDataType t;
if( ImpScan( aVal, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE )
@@ -1495,8 +1495,8 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
case SbxDOUBLE:
{
// Floats as ASCII
- XubString aVal;
- r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
+ XubString aVal = read_lenPrefixed_uInt8s_ToOUString(r,
+ RTL_TEXTENCODING_ASCII_US);
SbxDataType t;
if( ImpScan( aVal, aData.nDouble, t, NULL ) != SbxERR_OK )
{
@@ -1524,9 +1524,9 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
}
case SbxSTRING:
{
- XubString aVal;
- r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
- if( aVal.Len() )
+ rtl::OUString aVal = read_lenPrefixed_uInt8s_ToOUString(r,
+ RTL_TEXTENCODING_ASCII_US);
+ if( aVal.getLength() )
aData.pOUString = new ::rtl::OUString( aVal );
else
aData.pOUString = NULL; // JSM 1995-09-22
@@ -1621,12 +1621,12 @@ sal_Bool SbxValue::StoreData( SvStream& r ) const
case SbxDATE:
// #49935: Save as double, elsewise an error during the read in
((SbxValue*)this)->aData.eType = (SbxDataType)( ( nType & 0xF000 ) | SbxDOUBLE );
- r.WriteByteString( GetCoreString(), RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(r, GetCoreString(), RTL_TEXTENCODING_ASCII_US);
((SbxValue*)this)->aData.eType = (SbxDataType)nType;
break;
case SbxSINGLE:
case SbxDOUBLE:
- r.WriteByteString( GetCoreString(), RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(r, GetCoreString(), RTL_TEXTENCODING_ASCII_US);
break;
case SbxSALUINT64:
case SbxSALINT64:
@@ -1643,12 +1643,11 @@ sal_Bool SbxValue::StoreData( SvStream& r ) const
case SbxSTRING:
if( aData.pOUString )
{
- r.WriteByteString( *aData.pOUString, RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(r, *aData.pOUString, RTL_TEXTENCODING_ASCII_US);
}
else
{
- String aEmpty;
- r.WriteByteString( aEmpty, RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(r, rtl::OUString(), RTL_TEXTENCODING_ASCII_US);
}
break;
case SbxERROR:
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 58b3cb73f9d4..6ca253355603 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -445,7 +445,8 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer )
{
if( !SbxValue::LoadData( rStrm, nVer ) )
return sal_False;
- rStrm.ReadByteString( maName, RTL_TEXTENCODING_ASCII_US );
+ maName = read_lenPrefixed_uInt8s_ToOUString(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
sal_uInt32 nTemp;
rStrm >> nTemp;
nUserData = nTemp;
@@ -454,7 +455,8 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer )
{
rStrm.SeekRel( -1L );
rStrm >> nType;
- rStrm.ReadByteString( maName, RTL_TEXTENCODING_ASCII_US );
+ maName = read_lenPrefixed_uInt8s_ToOUString(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
sal_uInt32 nTemp;
rStrm >> nTemp;
nUserData = nTemp;
@@ -477,7 +479,8 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer )
case SbxSINGLE:
{
// Floats as ASCII
- rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
+ aTmpString = read_lenPrefixed_uInt8s_ToOUString(
+ rStrm, RTL_TEXTENCODING_ASCII_US);
double d;
SbxDataType t;
if( ImpScan( aTmpString, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE )
@@ -492,7 +495,8 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer )
case SbxDOUBLE:
{
// Floats as ASCII
- rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
+ aTmpString = read_lenPrefixed_uInt8s_ToOUString(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
SbxDataType t;
if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != SbxERR_OK )
{
@@ -502,8 +506,8 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer )
break;
}
case SbxSTRING:
- rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
- aVal = aTmpString;
+ aVal = read_lenPrefixed_uInt8s_ToOUString(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
break;
case SbxEMPTY:
case SbxNULL:
@@ -561,7 +565,8 @@ sal_Bool SbxVariable::StoreData( SvStream& rStrm ) const
bValStore = SbxValue::StoreData( rStrm );
if( !bValStore )
return sal_False;
- rStrm.WriteByteString( maName, RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(rStrm, maName,
+ RTL_TEXTENCODING_ASCII_US);
rStrm << (sal_uInt32)nUserData;
if( pInfo.Is() )
{
diff --git a/dbaccess/source/ui/tabledesign/TableRow.cxx b/dbaccess/source/ui/tabledesign/TableRow.cxx
index b4ed28a4f0f4..35be52c28521 100644
--- a/dbaccess/source/ui/tabledesign/TableRow.cxx
+++ b/dbaccess/source/ui/tabledesign/TableRow.cxx
@@ -128,9 +128,9 @@ namespace dbaui
if(pFieldDesc)
{
_rStr << (sal_Int32)1;
- _rStr.WriteByteString(pFieldDesc->GetName());
- _rStr.WriteByteString(pFieldDesc->GetDescription());
- _rStr.WriteByteString(pFieldDesc->GetHelpText());
+ _rStr.WriteUniOrByteString(pFieldDesc->GetName(), _rStr.GetStreamCharSet());
+ _rStr.WriteUniOrByteString(pFieldDesc->GetDescription(), _rStr.GetStreamCharSet());
+ _rStr.WriteUniOrByteString(pFieldDesc->GetHelpText(), _rStr.GetStreamCharSet());
double nValue = 0.0;
Any aValue = pFieldDesc->GetControlDefault();
if ( aValue >>= nValue )
@@ -141,7 +141,7 @@ namespace dbaui
else
{
_rStr << sal_Int32(2);
- _rStr.WriteByteString(::comphelper::getString(aValue));
+ _rStr.WriteUniOrByteString(::comphelper::getString(aValue), _rStr.GetStreamCharSet());
}
_rStr << pFieldDesc->GetType();
@@ -170,12 +170,12 @@ namespace dbaui
OFieldDescription* pFieldDesc = new OFieldDescription();
_rRow.m_pActFieldDescr = pFieldDesc;
String sValue;
- _rStr.ReadByteString(sValue);
+ _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
pFieldDesc->SetName(sValue);
- _rStr.ReadByteString(sValue);
+ _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
pFieldDesc->SetDescription(sValue);
- _rStr.ReadByteString(sValue);
+ _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
pFieldDesc->SetHelpText(sValue);
_rStr >> nValue;
@@ -190,7 +190,7 @@ namespace dbaui
break;
}
case 2:
- _rStr.ReadByteString(sValue);
+ _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
aControlDefault <<= ::rtl::OUString(sValue);
break;
}
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 0fd144b42514..8435e66d923f 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1230,7 +1230,7 @@ void BinTextObject::CreateData( SvStream& rIStream )
pC->GetText() = rtl::OStringToOUString(aByteString, eSrcEncoding);
// StyleName and Family...
- rIStream.ReadByteString( pC->GetStyle(), eSrcEncoding );
+ rIStream.ReadUniOrByteString( pC->GetStyle(), eSrcEncoding );
sal_uInt16 nStyleFamily;
rIStream >> nStyleFamily;
pC->GetFamily() = (SfxStyleFamily)nStyleFamily;
@@ -1522,10 +1522,10 @@ void BinTextObject::CreateData300( SvStream& rIStream )
ContentInfo* pC = CreateAndInsertContent();
// The Text...
- rIStream.ReadByteString( pC->GetText() );
+ rIStream.ReadUniOrByteString( pC->GetText(), rIStream.GetStreamCharSet() );
// StyleName and Family...
- rIStream.ReadByteString( pC->GetStyle() );
+ rIStream.ReadUniOrByteString( pC->GetStyle(), rIStream.GetStreamCharSet() );
sal_uInt16 nStyleFamily;
rIStream >> nStyleFamily;
pC->GetFamily() = (SfxStyleFamily)nStyleFamily;
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index 2d0e066e4091..caca392a6d18 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -64,7 +64,7 @@ void SvxBulletItem::StoreFont( SvStream& rStream, const Font& rFont )
nTemp = (sal_uInt16)rFont.GetItalic(); rStream << nTemp;
// UNICODE: rStream << rFont.GetName();
- rStream.WriteByteString(rFont.GetName());
+ rStream.WriteUniOrByteString(rFont.GetName(), rStream.GetStreamCharSet());
rStream << rFont.IsOutline();
rStream << rFont.IsShadow();
@@ -94,7 +94,7 @@ Font SvxBulletItem::CreateFont( SvStream& rStream, sal_uInt16 nVer )
// UNICODE: rStream >> aName; aFont.SetName( aName );
String aName;
- rStream.ReadByteString(aName);
+ rStream.ReadUniOrByteString(aName, rStream.GetStreamCharSet());
aFont.SetName( aName );
if( nVer == 1 )
@@ -217,10 +217,10 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) :
rStrm >> nScale;
// UNICODE: rStrm >> aPrevText;
- rStrm.ReadByteString(aPrevText);
+ rStrm.ReadUniOrByteString(aPrevText, rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aFollowText;
- rStrm.ReadByteString(aFollowText);
+ rStrm.ReadUniOrByteString(aFollowText, rStrm.GetStreamCharSet());
nValidMask = 0xFFFF;
}
@@ -416,10 +416,10 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) c
rStrm << nScale;
// UNICODE: rStrm << aPrevText;
- rStrm.WriteByteString(aPrevText);
+ rStrm.WriteUniOrByteString(aPrevText, rStrm.GetStreamCharSet());
// UNICODE: rStrm << aFollowText;
- rStrm.WriteByteString(aFollowText);
+ rStrm.WriteUniOrByteString(aFollowText, rStrm.GetStreamCharSet());
return rStrm;
}
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 56b2d71f68fa..bafb976f057b 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -735,7 +735,7 @@ void SvxExtFileField::Load( SvPersistStream & rStm )
sal_uInt16 nType, nFormat;
// UNICODE: rStm >> aFile;
- rStm.ReadByteString(aFile);
+ rStm.ReadUniOrByteString(aFile, rStm.GetStreamCharSet());
rStm >> nType;
rStm >> nFormat;
@@ -749,7 +749,7 @@ void SvxExtFileField::Load( SvPersistStream & rStm )
void SvxExtFileField::Save( SvPersistStream & rStm )
{
// UNICODE: rStm << aFile;
- rStm.WriteByteString(aFile);
+ rStm.WriteUniOrByteString(aFile, rStm.GetStreamCharSet());
rStm << (sal_uInt16) eType;
rStm << (sal_uInt16) eFormat;
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index addb3f630a68..18af4a61ec7b 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3443,7 +3443,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
{
String aRel;
// UNICODE: rStream >> aRel;
- rStream.ReadByteString(aRel);
+ rStream.ReadUniOrByteString(aRel, rStream.GetStreamCharSet());
// TODO/MBA: how can we get a BaseURL here?!
OSL_FAIL("No BaseURL!");
@@ -3456,7 +3456,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
{
pStrFilter = new String;
// UNICODE: rStream >> *pStrFilter;
- rStream.ReadByteString(*pStrFilter);
+ rStream.ReadUniOrByteString(*pStrFilter, rStream.GetStreamCharSet());
}
rStream >> nPos;
@@ -3834,12 +3834,12 @@ SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ )
// TODO/MBA: how to get a BaseURL?!
String aRel = INetURLObject::GetRelURL( String(), *pStrLink );
// UNICODE: rStream << aRel;
- rStream.WriteByteString(aRel);
+ rStream.WriteUniOrByteString(aRel, rStream.GetStreamCharSet());
}
if ( pStrFilter )
{
// UNICODE: rStream << *pStrFilter;
- rStream.WriteByteString(*pStrFilter);
+ rStream.WriteUniOrByteString(*pStrFilter, rStream.GetStreamCharSet());
}
rStream << (sal_Int8)eGraphicPos;
return rStream;
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 8f71ff238b11..01fc4630ff23 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -219,9 +219,9 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC
rStream << nCharTextDistance;
rtl_TextEncoding eEnc = osl_getThreadTextEncoding();
- rStream.WriteByteString(sPrefix, eEnc);
- rStream.WriteByteString(sSuffix, eEnc);
- rStream.WriteByteString(sCharStyleName, eEnc);
+ rStream.WriteUniOrByteString(sPrefix, eEnc);
+ rStream.WriteUniOrByteString(sSuffix, eEnc);
+ rStream.WriteUniOrByteString(sCharStyleName, eEnc);
if(pGraphicBrush)
{
rStream << (sal_uInt16)1;
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 4f5dc8dc29e6..e3069074573a 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -398,16 +398,16 @@ SvStream& SvxFontItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) co
String aStoreFamilyName( GetFamilyName() );
if( bToBats )
aStoreFamilyName = String( "StarBats", sizeof("StarBats")-1, RTL_TEXTENCODING_ASCII_US );
- rStrm.WriteByteString(aStoreFamilyName);
- rStrm.WriteByteString(GetStyleName());
+ rStrm.WriteUniOrByteString(aStoreFamilyName, rStrm.GetStreamCharSet());
+ rStrm.WriteUniOrByteString(GetStyleName(), rStrm.GetStreamCharSet());
// cach for EditEngine, only set while creating clipboard stream.
if ( bEnableStoreUnicodeNames )
{
sal_uInt32 nMagic = STORE_UNICODE_MAGIC_MARKER;
rStrm << nMagic;
- rStrm.WriteByteString( aStoreFamilyName, RTL_TEXTENCODING_UNICODE );
- rStrm.WriteByteString( GetStyleName(), RTL_TEXTENCODING_UNICODE );
+ rStrm.WriteUniOrByteString( aStoreFamilyName, RTL_TEXTENCODING_UNICODE );
+ rStrm.WriteUniOrByteString( GetStyleName(), RTL_TEXTENCODING_UNICODE );
}
return rStrm;
@@ -424,10 +424,10 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const
rStrm >> eFontTextEncoding;
// UNICODE: rStrm >> aName;
- rStrm.ReadByteString(aName);
+ rStrm.ReadUniOrByteString(aName, rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aStyle;
- rStrm.ReadByteString(aStyle);
+ rStrm.ReadUniOrByteString(aStyle, rStrm.GetStreamCharSet());
// Set the "correct" textencoding
eFontTextEncoding = (sal_uInt8)GetSOLoadTextEncoding( eFontTextEncoding, (sal_uInt16)rStrm.GetVersion() );
@@ -442,8 +442,8 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const
rStrm >> nMagic;
if ( nMagic == STORE_UNICODE_MAGIC_MARKER )
{
- rStrm.ReadByteString( aName, RTL_TEXTENCODING_UNICODE );
- rStrm.ReadByteString( aStyle, RTL_TEXTENCODING_UNICODE );
+ rStrm.ReadUniOrByteString( aName, RTL_TEXTENCODING_UNICODE );
+ rStrm.ReadUniOrByteString( aStyle, RTL_TEXTENCODING_UNICODE );
}
else
{
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index 4fd5c78f7f6f..e8e6542eb1b0 100644
--- a/idl/source/objects/module.cxx
+++ b/idl/source/objects/module.cxx
@@ -65,7 +65,7 @@ void SvMetaModule::Load( SvPersistStream & rStm )
rStm >> aTypeList;
rStm >> aAttrList;
// browser
- rStm.ReadByteString( aIdlFileName );
+ rStm.ReadUniOrByteString( aIdlFileName, rStm.GetStreamCharSet() );
aHelpFileName = read_lenPrefixed_uInt8s_ToOString(rStm);
aSlotIdFile = read_lenPrefixed_uInt8s_ToOString(rStm);
aModulePrefix = read_lenPrefixed_uInt8s_ToOString(rStm);
@@ -90,7 +90,7 @@ void SvMetaModule::Save( SvPersistStream & rStm )
rStm << aTypeList;
rStm << aAttrList;
// browser
- rStm.WriteByteString( aIdlFileName );
+ rStm.WriteUniOrByteString( aIdlFileName, rStm.GetStreamCharSet() );
write_lenPrefixed_uInt8s_FromOString(rStm, aHelpFileName);
write_lenPrefixed_uInt8s_FromOString(rStm, aSlotIdFile);
write_lenPrefixed_uInt8s_FromOString(rStm, aModulePrefix);
@@ -368,9 +368,9 @@ void SvMetaModule::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
{
rOutStm << SvHash_module()->GetName().GetBuffer() << endl
<< '\"';
- rOutStm.WriteByteString( aBeginName.GetHexName() );
+ rOutStm.WriteUniOrByteString( aBeginName.GetHexName(), rOutStm.GetStreamCharSet() );
rOutStm << '\"' << endl << '\"';
- rOutStm.WriteByteString( aEndName.GetHexName() );
+ rOutStm.WriteUniOrByteString( aEndName.GetHexName(), rOutStm.GetStreamCharSet() );
rOutStm << '\"' << endl;
SvMetaExtern::WriteSvIdl( rBase, rOutStm, nTab );
}
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index fbd982db364a..93adcfeea75e 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -172,7 +172,7 @@ SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */
{
short eFamDummy;
pStr = new String;
- rStream.ReadByteString( *pStr, rStream.GetStreamCharSet() );
+ rStream.ReadUniOrByteString( *pStr, rStream.GetStreamCharSet() );
rStream >> eFamDummy; // wg. altem Dateiformat
}
else
@@ -194,11 +194,11 @@ SvStream& ScPatternAttr::Store(SvStream& rStream, sal_uInt16 /* nItemVersion */)
rStream << (sal_Bool)sal_True;
if ( pStyle )
- rStream.WriteByteString( pStyle->GetName(), rStream.GetStreamCharSet() );
+ rStream.WriteUniOrByteString( pStyle->GetName(), rStream.GetStreamCharSet() );
else if ( pName ) // wenn Style geloescht ist/war
- rStream.WriteByteString( *pName, rStream.GetStreamCharSet() );
+ rStream.WriteUniOrByteString( *pName, rStream.GetStreamCharSet() );
else
- rStream.WriteByteString( ScGlobal::GetRscString(STR_STYLENAME_STANDARD),
+ rStream.WriteUniOrByteString( ScGlobal::GetRscString(STR_STYLENAME_STANDARD),
rStream.GetStreamCharSet() );
rStream << (short)SFX_STYLE_FAMILY_PARA; // wg. altem Dateiformat
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index fa7836bc604a..61b8355826f8 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -797,8 +797,14 @@ sal_Bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersion
(AUTOFORMAT_DATA_ID_504 <= nVer && nVer <= AUTOFORMAT_DATA_ID)) )
{
// --- from 680/dr25 on: store strings as UTF-8
- CharSet eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
- rStream.ReadByteString( aName, eCharSet );
+ if (nVer >= AUTOFORMAT_ID_680DR25)
+ {
+ aName = read_lenPrefixed_uInt8s_ToOUString(rStream,
+ RTL_TEXTENCODING_UTF8);
+ }
+ else
+ rStream.ReadUniOrByteString( aName, rStream.GetStreamCharSet() );
+
if( AUTOFORMAT_DATA_ID_552 <= nVer )
{
rStream >> nStrResId;
@@ -838,7 +844,7 @@ sal_Bool ScAutoFormatData::LoadOld( SvStream& rStream, const ScAfVersions& rVers
bRet = (rStream.GetError() == 0);
if (bRet && (nVal == AUTOFORMAT_OLD_DATA_ID))
{
- rStream.ReadByteString( aName, rStream.GetStreamCharSet() );
+ rStream.ReadUniOrByteString( aName, rStream.GetStreamCharSet() );
sal_Bool b;
rStream >> b; bIncludeFont = b;
rStream >> b; bIncludeJustify = b;
@@ -863,7 +869,7 @@ sal_Bool ScAutoFormatData::Save(SvStream& rStream)
sal_Bool b;
rStream << nVal;
// --- from 680/dr25 on: store strings as UTF-8
- rStream.WriteByteString( aName, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOUString(rStream, aName, RTL_TEXTENCODING_UTF8);
rStream << nStrResId;
rStream << ( b = bIncludeFont );
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index 7fbb58b0ea4f..ca956813697b 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -92,9 +92,9 @@ ScDdeLink::ScDdeLink( ScDocument* pD, SvStream& rStream, ScMultipleReadHeader& r
rHdr.StartEntry();
rtl_TextEncoding eCharSet = rStream.GetStreamCharSet();
- rStream.ReadByteString( aAppl, eCharSet );
- rStream.ReadByteString( aTopic, eCharSet );
- rStream.ReadByteString( aItem, eCharSet );
+ rStream.ReadUniOrByteString( aAppl, eCharSet );
+ rStream.ReadUniOrByteString( aTopic, eCharSet );
+ rStream.ReadUniOrByteString( aItem, eCharSet );
sal_Bool bHasValue;
rStream >> bHasValue;
@@ -114,9 +114,9 @@ void ScDdeLink::Store( SvStream& rStream, ScMultipleWriteHeader& rHdr ) const
rHdr.StartEntry();
rtl_TextEncoding eCharSet = rStream.GetStreamCharSet();
- rStream.WriteByteString( aAppl, eCharSet );
- rStream.WriteByteString( aTopic, eCharSet );
- rStream.WriteByteString( aItem, eCharSet );
+ rStream.WriteUniOrByteString( aAppl, eCharSet );
+ rStream.WriteUniOrByteString( aTopic, eCharSet );
+ rStream.WriteUniOrByteString( aItem, eCharSet );
sal_Bool bHasValue = ( pResult != NULL );
rStream << bHasValue;
diff --git a/sc/source/core/tool/zforauto.cxx b/sc/source/core/tool/zforauto.cxx
index 4ebbee3551c0..048c981df3bf 100644
--- a/sc/source/core/tool/zforauto.cxx
+++ b/sc/source/core/tool/zforauto.cxx
@@ -61,7 +61,7 @@ ScNumFormatAbbrev::ScNumFormatAbbrev(sal_uLong nFormat,
void ScNumFormatAbbrev::Load( SvStream& rStream, CharSet eByteStrSet )
{
sal_uInt16 nSysLang, nLang;
- rStream.ReadByteString( sFormatstring, eByteStrSet );
+ rStream.ReadUniOrByteString( sFormatstring, eByteStrSet );
rStream >> nSysLang >> nLang;
eLnge = (LanguageType) nLang;
eSysLnge = (LanguageType) nSysLang;
@@ -71,7 +71,7 @@ void ScNumFormatAbbrev::Load( SvStream& rStream, CharSet eByteStrSet )
void ScNumFormatAbbrev::Save( SvStream& rStream, CharSet eByteStrSet ) const
{
- rStream.WriteByteString( sFormatstring, eByteStrSet );
+ rStream.WriteUniOrByteString( sFormatstring, eByteStrSet );
rStream << (sal_uInt16) eSysLnge << (sal_uInt16) eLnge;
}
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index 6a9515d4f540..55714612b2df 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -267,19 +267,25 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign)
sal_uInt16 nTemp16;
- rIn.ReadByteString( rDesign.m_aDesignName, RTL_TEXTENCODING_UTF8 );
+ rDesign.m_aDesignName = read_lenPrefixed_uInt8s_ToOUString(rIn,
+ RTL_TEXTENCODING_UTF8);
rIn >> nTemp16;
rDesign.m_eMode = (HtmlPublishMode)nTemp16;
rIn >> rDesign.m_bContentPage;
rIn >> rDesign.m_bNotes;
rIn >> rDesign.m_nResolution;
- rIn.ReadByteString( rDesign.m_aCompression, RTL_TEXTENCODING_UTF8 );
+ rDesign.m_aCompression = read_lenPrefixed_uInt8s_ToOUString(rIn,
+ RTL_TEXTENCODING_UTF8);
rIn >> nTemp16;
rDesign.m_eFormat = (PublishingFormat)nTemp16;
- rIn.ReadByteString( rDesign.m_aAuthor, RTL_TEXTENCODING_UTF8 );
- rIn.ReadByteString( rDesign.m_aEMail, RTL_TEXTENCODING_UTF8 );
- rIn.ReadByteString( rDesign.m_aWWW, RTL_TEXTENCODING_UTF8 );
- rIn.ReadByteString( rDesign.m_aMisc, RTL_TEXTENCODING_UTF8 );
+ rDesign.m_aAuthor = read_lenPrefixed_uInt8s_ToOUString(rIn,
+ RTL_TEXTENCODING_UTF8);
+ rDesign.m_aEMail = read_lenPrefixed_uInt8s_ToOUString(rIn,
+ RTL_TEXTENCODING_UTF8);
+ rDesign.m_aWWW = read_lenPrefixed_uInt8s_ToOUString(rIn,
+ RTL_TEXTENCODING_UTF8);
+ rDesign.m_aMisc = read_lenPrefixed_uInt8s_ToOUString(rIn,
+ RTL_TEXTENCODING_UTF8);
rIn >> rDesign.m_bDownload;
rIn >> rDesign.m_bCreated; // not used
rIn >> rDesign.m_nButtonThema;
@@ -294,8 +300,10 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign)
rIn >> nTemp16;
rDesign.m_eScript = (PublishingScript)nTemp16;
- rIn.ReadByteString( rDesign.m_aURL, RTL_TEXTENCODING_UTF8 );
- rIn.ReadByteString( rDesign.m_aCGI, RTL_TEXTENCODING_UTF8 );
+ rDesign.m_aURL = read_lenPrefixed_uInt8s_ToOUString(rIn,
+ RTL_TEXTENCODING_UTF8);
+ rDesign.m_aCGI = read_lenPrefixed_uInt8s_ToOUString(rIn,
+ RTL_TEXTENCODING_UTF8);
rIn >> rDesign.m_bAutoSlide;
rIn >> rDesign.m_nSlideDuration;
@@ -315,18 +323,24 @@ SvStream& operator << (SvStream& rOut, const SdPublishingDesign& rDesign)
SdIOCompat aIO(rOut, STREAM_WRITE, 0);
// Name
- rOut.WriteByteString( rDesign.m_aDesignName, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aDesignName,
+ RTL_TEXTENCODING_UTF8);
rOut << (sal_uInt16)rDesign.m_eMode;
rOut << rDesign.m_bContentPage;
rOut << rDesign.m_bNotes;
rOut << rDesign.m_nResolution;
- rOut.WriteByteString( rDesign.m_aCompression, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCompression,
+ RTL_TEXTENCODING_UTF8);
rOut << (sal_uInt16)rDesign.m_eFormat;
- rOut.WriteByteString( rDesign.m_aAuthor, RTL_TEXTENCODING_UTF8 );
- rOut.WriteByteString( rDesign.m_aEMail, RTL_TEXTENCODING_UTF8 );
- rOut.WriteByteString( rDesign.m_aWWW, RTL_TEXTENCODING_UTF8 );
- rOut.WriteByteString( rDesign.m_aMisc, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aAuthor,
+ RTL_TEXTENCODING_UTF8);
+ write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aEMail,
+ RTL_TEXTENCODING_UTF8);
+ write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aWWW,
+ RTL_TEXTENCODING_UTF8);
+ write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aMisc,
+ RTL_TEXTENCODING_UTF8);
rOut << rDesign.m_bDownload;
rOut << rDesign.m_bCreated; // not used
rOut << rDesign.m_nButtonThema;
@@ -340,8 +354,10 @@ SvStream& operator << (SvStream& rOut, const SdPublishingDesign& rDesign)
rOut << rDesign.m_bUseColor;
rOut << (sal_uInt16)rDesign.m_eScript;
- rOut.WriteByteString( rDesign.m_aURL, RTL_TEXTENCODING_UTF8 );
- rOut.WriteByteString( rDesign.m_aCGI, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aURL,
+ RTL_TEXTENCODING_UTF8);
+ write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCGI,
+ RTL_TEXTENCODING_UTF8);
rOut << rDesign.m_bAutoSlide;
rOut << rDesign.m_nSlideDuration;
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index e323361ed09c..eaef4b41ce49 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -192,7 +192,7 @@ std::vector<sal_uInt16>* SfxApplication::GetDisabledSlotList_Impl()
{
// Read Slot file
String aTitle;
- pStream->ReadByteString(aTitle);
+ pStream->ReadUniOrByteString(aTitle, pStream->GetStreamCharSet());
if ( aTitle.CompareToAscii("SfxSlotFile" ) == COMPARE_EQUAL )
{
sal_uInt16 nCount;
@@ -207,7 +207,7 @@ std::vector<sal_uInt16>* SfxApplication::GetDisabledSlotList_Impl()
pList->push_back( nSlot );
}
- pStream->ReadByteString(aTitle);
+ pStream->ReadUniOrByteString(aTitle, pStream->GetStreamCharSet());
if ( aTitle.CompareToAscii("END" ) != COMPARE_EQUAL || pStream->GetError() )
{
// Read failed
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index f1cf5c0c3127..49c7bd3cdcc6 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -3375,7 +3375,7 @@ String UCBStorage::CreateLinkFile( const String& rName )
// store it as key/value pair
String aLink = String::CreateFromAscii("ContentURL=");
aLink += aURL;
- pStream->WriteByteString( aLink, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOUString(*pStream, aLink, RTL_TEXTENCODING_UTF8);
pStream->Flush();
// move the stream to its desired location
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index e6dab39b6706..8970688be602 100644
--- a/svl/source/items/poolitem.cxx
+++ b/svl/source/items/poolitem.cxx
@@ -187,7 +187,7 @@ SvStream& SfxPoolItem::Store(SvStream &rStream, sal_uInt16 ) const
// static
bool SfxPoolItem::readByteString(SvStream & rStream, UniString & rString)
{
- rStream.ReadByteString(rString);
+ rStream.ReadUniOrByteString(rString, rStream.GetStreamCharSet());
return rStream.GetError() == ERRCODE_NONE;
}
@@ -196,7 +196,7 @@ bool SfxPoolItem::readByteString(SvStream & rStream, UniString & rString)
void SfxPoolItem::writeByteString(SvStream & rStream,
UniString const & rString)
{
- rStream.WriteByteString(rString);
+ rStream.WriteUniOrByteString(rString, rStream.GetStreamCharSet());
}
//============================================================================
@@ -204,7 +204,7 @@ void SfxPoolItem::writeByteString(SvStream & rStream,
bool SfxPoolItem::readUnicodeString(SvStream & rStream, UniString & rString,
bool bUnicode)
{
- rStream.ReadByteString(rString,
+ rStream.ReadUniOrByteString(rString,
bUnicode ? RTL_TEXTENCODING_UCS2 :
rStream.GetStreamCharSet());
return rStream.GetError() == ERRCODE_NONE;
@@ -215,7 +215,7 @@ bool SfxPoolItem::readUnicodeString(SvStream & rStream, UniString & rString,
void SfxPoolItem::writeUnicodeString(SvStream & rStream,
UniString const & rString)
{
- rStream.WriteByteString(rString, RTL_TEXTENCODING_UCS2);
+ rStream.WriteUniOrByteString(rString, RTL_TEXTENCODING_UCS2);
}
// ------------------------------------------------------------------------
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 424aaa0204ce..852e16d32487 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -154,7 +154,7 @@ void ImpSvNumberformatInfo::Save(SvStream& rStream, sal_uInt16 nAnz) const
{
for (sal_uInt16 i = 0; i < nAnz; i++)
{
- rStream.WriteByteString( sStrArray[i], rStream.GetStreamCharSet() );
+ rStream.WriteUniOrByteString( sStrArray[i], rStream.GetStreamCharSet() );
short nType = nTypeArray[i];
switch ( nType )
{ // der Krampf fuer Versionen vor SV_NUMBERFORMATTER_VERSION_NEW_CURR
@@ -392,7 +392,7 @@ void ImpSvNumFor::Save(SvStream& rStream) const
{
rStream << nAnzStrings;
aI.Save(rStream, nAnzStrings);
- rStream.WriteByteString( sColorName, rStream.GetStreamCharSet() );
+ rStream.WriteUniOrByteString( sColorName, rStream.GetStreamCharSet() );
}
void ImpSvNumFor::Load(SvStream& rStream, ImpSvNumberformatScan& rSc,
@@ -402,7 +402,7 @@ void ImpSvNumFor::Load(SvStream& rStream, ImpSvNumberformatScan& rSc,
rStream >> nAnz; //! noch nicht direkt nAnzStrings wg. Enlarge
Enlarge( nAnz );
aI.Load( rStream, nAnz );
- rStream.ReadByteString( sColorName, rStream.GetStreamCharSet() );
+ rStream.ReadUniOrByteString( sColorName, rStream.GetStreamCharSet() );
rLoadedColorName = sColorName;
pColor = rSc.GetColor(sColorName);
}
@@ -1828,13 +1828,13 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr
}
rHdr.StartEntry();
- rStream.WriteByteString( aFormatstring, rStream.GetStreamCharSet() );
+ rStream.WriteUniOrByteString( aFormatstring, rStream.GetStreamCharSet() );
rStream << eType << fLimit1 << fLimit2 << (sal_uInt16) eOp1 << (sal_uInt16) eOp2
<< sal_Bool(bOldStandard) << sal_Bool(bIsUsed);
for (sal_uInt16 i = 0; i < 4; i++)
NumFor[i].Save(rStream);
// ab SV_NUMBERFORMATTER_VERSION_NEWSTANDARD
- rStream.WriteByteString( aComment, rStream.GetStreamCharSet() );
+ rStream.WriteUniOrByteString( aComment, rStream.GetStreamCharSet() );
rStream << nNewStandardDefined;
// ab SV_NUMBERFORMATTER_VERSION_NEW_CURR
rStream << nNewCurrencyVersionId;
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index 41f0af0839cd..e2a340a8291b 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -292,7 +292,7 @@ namespace svt
void operator() ( const String& _rString ) const
{
- m_rStorage.WriteByteString( _rString );
+ m_rStorage.WriteUniOrByteString( _rString, m_rStorage.GetStreamCharSet() );
}
};
@@ -418,7 +418,7 @@ namespace svt
while ( nChildren-- )
{
String sURL;
- m_rStorage.ReadByteString( sURL );
+ m_rStorage.ReadUniOrByteString( sURL, m_rStorage.GetStreamCharSet() );
sURL = m_xOfficeInstDirs->makeAbsoluteURL( sURL );
INetURLObject aChildURL( sURL );
rChildren.push_back( new TemplateContent( aChildURL ) );
@@ -736,7 +736,7 @@ namespace svt
while ( nRootDirectories-- )
{
String sURL;
- m_pCacheStream->ReadByteString( sURL );
+ m_pCacheStream->ReadUniOrByteString( sURL, m_pCacheStream->GetStreamCharSet() );
// #116281# Keep office installtion relocatable. Never store
// any direct references to office installation directory.
sURL = getOfficeInstDirs()->makeAbsoluteURL( sURL );
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index aac712644d95..c8158d19b52a 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -96,8 +96,8 @@ SvStream& operator>>( SvStream& rIStm, TransferableObjectDescriptor& rObjDesc )
rIStm >> rObjDesc.maSize.Height();
rIStm >> rObjDesc.maDragStartPos.X();
rIStm >> rObjDesc.maDragStartPos.Y();
- rIStm.ReadByteString( rObjDesc.maTypeName, osl_getThreadTextEncoding() );
- rIStm.ReadByteString( rObjDesc.maDisplayName, osl_getThreadTextEncoding() );
+ rIStm.ReadUniOrByteString( rObjDesc.maTypeName, osl_getThreadTextEncoding() );
+ rIStm.ReadUniOrByteString( rObjDesc.maDisplayName, osl_getThreadTextEncoding() );
rIStm >> nSig1 >> nSig2;
rObjDesc.mnViewAspect = static_cast< sal_uInt16 >( nViewAspect );
@@ -126,8 +126,8 @@ SvStream& operator<<( SvStream& rOStm, const TransferableObjectDescriptor& rObjD
rOStm << rObjDesc.maSize.Height();
rOStm << rObjDesc.maDragStartPos.X();
rOStm << rObjDesc.maDragStartPos.Y();
- rOStm.WriteByteString( rObjDesc.maTypeName, osl_getThreadTextEncoding() );
- rOStm.WriteByteString( rObjDesc.maDisplayName, osl_getThreadTextEncoding() );
+ rOStm.WriteUniOrByteString( rObjDesc.maTypeName, osl_getThreadTextEncoding() );
+ rOStm.WriteUniOrByteString( rObjDesc.maDisplayName, osl_getThreadTextEncoding() );
rOStm << nSig1 << nSig2;
const sal_uInt32 nLastPos = rOStm.Tell();
diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx
index 11a26aa04d49..1f6dfa83a794 100644
--- a/svx/source/items/hlnkitem.cxx
+++ b/svx/source/items/hlnkitem.cxx
@@ -49,13 +49,13 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/
{
// store 'simple' data
// UNICODE: rStrm << sName;
- rStrm.WriteByteString(sName);
+ rStrm.WriteUniOrByteString(sName, rStrm.GetStreamCharSet());
// UNICODE: rStrm << sURL;
- rStrm.WriteByteString(sURL);
+ rStrm.WriteUniOrByteString(sURL, rStrm.GetStreamCharSet());
// UNICODE: rStrm << sTarget;
- rStrm.WriteByteString(sTarget);
+ rStrm.WriteUniOrByteString(sTarget, rStrm.GetStreamCharSet());
rStrm << (sal_uInt32) eType;
@@ -64,7 +64,7 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/
// new data
// UNICODE: rStrm << sIntName;
- rStrm.WriteByteString(sIntName);
+ rStrm.WriteUniOrByteString(sIntName, rStrm.GetStreamCharSet());
// macro-events
rStrm << nMacroEvents;
@@ -91,10 +91,10 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/
rStrm << (sal_uInt16)pMacroTable->GetCurKey();
// UNICODE: rStrm << pMac->GetLibName();
- rStrm.WriteByteString(pMac->GetLibName());
+ rStrm.WriteUniOrByteString(pMac->GetLibName(), rStrm.GetStreamCharSet());
// UNICODE: rStrm << pMac->GetMacName();
- rStrm.WriteByteString(pMac->GetMacName());
+ rStrm.WriteUniOrByteString(pMac->GetMacName(), rStrm.GetStreamCharSet());
}
}
}
@@ -111,10 +111,10 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/
rStrm << (sal_uInt16)pMacroTable->GetCurKey();
// UNICODE: rStrm << pMac->GetLibName();
- rStrm.WriteByteString(pMac->GetLibName());
+ rStrm.WriteUniOrByteString(pMac->GetLibName(), rStrm.GetStreamCharSet());
// UNICODE: rStrm << pMac->GetMacName();
- rStrm.WriteByteString(pMac->GetMacName());
+ rStrm.WriteUniOrByteString(pMac->GetMacName(), rStrm.GetStreamCharSet());
rStrm << (sal_uInt16)pMac->GetScriptType();
}
@@ -131,13 +131,13 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer
// simple data-types
// UNICODE: rStrm >> pNew->sName;
- rStrm.ReadByteString(pNew->sName);
+ rStrm.ReadUniOrByteString(pNew->sName, rStrm.GetStreamCharSet());
// UNICODE: rStrm >> pNew->sURL;
- rStrm.ReadByteString(pNew->sURL);
+ rStrm.ReadUniOrByteString(pNew->sURL, rStrm.GetStreamCharSet());
// UNICODE: rStrm >> pNew->sTarget;
- rStrm.ReadByteString(pNew->sTarget);
+ rStrm.ReadUniOrByteString(pNew->sTarget, rStrm.GetStreamCharSet());
rStrm >> nType;
pNew->eType = (SvxLinkInsertMode) nType;
@@ -149,7 +149,7 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer
{
// new data
// UNICODE: rStrm >> pNew->sIntName;
- rStrm.ReadByteString(pNew->sIntName);
+ rStrm.ReadUniOrByteString(pNew->sIntName, rStrm.GetStreamCharSet());
// macro-events
rStrm >> pNew->nMacroEvents;
@@ -164,10 +164,10 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer
rStrm >> nCurKey;
// UNICODE: rStrm >> aLibName;
- rStrm.ReadByteString(aLibName);
+ rStrm.ReadUniOrByteString(aLibName, rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aMacName;
- rStrm.ReadByteString(aMacName);
+ rStrm.ReadUniOrByteString(aMacName, rStrm.GetStreamCharSet());
pNew->SetMacro( nCurKey, SvxMacro( aMacName, aLibName, STARBASIC ) );
}
@@ -181,10 +181,10 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer
rStrm >> nCurKey;
// UNICODE: rStrm >> aLibName;
- rStrm.ReadByteString(aLibName);
+ rStrm.ReadUniOrByteString(aLibName, rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aMacName;
- rStrm.ReadByteString(aMacName);
+ rStrm.ReadUniOrByteString(aMacName, rStrm.GetStreamCharSet());
rStrm >> nScriptType;
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index 0ac676debe0a..7dcffd0c9dd4 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -251,7 +251,7 @@ SfxPoolItem* SvxPageItem::Create( SvStream& rStream, sal_uInt16 ) const
sal_uInt16 nUse;
// UNICODE: rStream >> sStr;
- rStream.ReadByteString( sStr );
+ rStream.ReadUniOrByteString( sStr, rStream.GetStreamCharSet() );
rStream >> eType;
rStream >> bLand;
@@ -270,7 +270,7 @@ SfxPoolItem* SvxPageItem::Create( SvStream& rStream, sal_uInt16 ) const
SvStream& SvxPageItem::Store( SvStream &rStrm, sal_uInt16 /*nItemVersion*/ ) const
{
// UNICODE: rStrm << aDescName;
- rStrm.WriteByteString(aDescName);
+ rStrm.WriteUniOrByteString(aDescName, rStrm.GetStreamCharSet());
rStrm << (sal_uInt8)eNumType << bLandscape << eUse;
return rStrm;
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index d9c3a010eccd..be2d325aef8f 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -401,7 +401,7 @@ sal_Bool SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, s
sal_uInt16 eSys, eLge;
// --- from 680/dr25 on: store strings as UTF-8
CharSet eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
- rStream.ReadByteString( sNumFmtString, eCharSet )
+ rStream.ReadUniOrByteString( sNumFmtString, eCharSet )
>> eSys >> eLge;
eSysLanguage = (LanguageType) eSys;
eNumFmtLanguage = (LanguageType) eLge;
@@ -486,8 +486,9 @@ sal_Bool SwBoxAutoFmt::Save( SvStream& rStream ) const
aRotateMode.Store( rStream, aRotateMode.GetVersion(SOFFICE_FILEFORMAT_40) );
// --- from 680/dr25 on: store strings as UTF-8
- rStream.WriteByteString( sNumFmtString, RTL_TEXTENCODING_UTF8 )
- << (sal_uInt16)eSysLanguage << (sal_uInt16)eNumFmtLanguage;
+ write_lenPrefixed_uInt8s_FromOUString(rStream, sNumFmtString,
+ RTL_TEXTENCODING_UTF8);
+ rStream << (sal_uInt16)eSysLanguage << (sal_uInt16)eNumFmtLanguage;
return 0 == rStream.GetError();
}
@@ -779,7 +780,7 @@ sal_Bool SwTableAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions
sal_Bool b;
// --- from 680/dr25 on: store strings as UTF-8
CharSet eCharSet = (nVal >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
- rStream.ReadByteString( aName, eCharSet );
+ rStream.ReadUniOrByteString( aName, eCharSet );
if( AUTOFORMAT_DATA_ID_552 <= nVal )
{
rStream >> nStrResId;
@@ -829,7 +830,7 @@ sal_Bool SwTableAutoFmt::LoadOld( SvStream& rStream, sal_uInt16 aLoadVer[] )
if( bRet && ( AUTOFORMAT_OLD_DATA_ID == nVal ))
{
sal_Bool b;
- rStream.ReadByteString( aName, rStream.GetStreamCharSet() );
+ rStream.ReadUniOrByteString( aName, rStream.GetStreamCharSet() );
rStream >> b; bInclFont = b;
rStream >> b; bInclJustify = b;
rStream >> b; bInclFrame = b;
@@ -860,7 +861,8 @@ sal_Bool SwTableAutoFmt::Save( SvStream& rStream ) const
sal_Bool b;
rStream << nVal;
// --- from 680/dr25 on: store strings as UTF-8
- rStream.WriteByteString( aName, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOUString(rStream, aName,
+ RTL_TEXTENCODING_UTF8 );
rStream << nStrResId;
rStream << ( b = bInclFont );
rStream << ( b = bInclJustify );
diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx
index b521578f605b..c43a2f4ed99b 100644
--- a/sw/source/ui/config/uinums.cxx
+++ b/sw/source/ui/config/uinums.cxx
@@ -235,7 +235,7 @@ const SwNumRulesWithName& SwNumRulesWithName::operator=(const SwNumRulesWithName
SwNumRulesWithName::SwNumRulesWithName( SvStream &rStream, sal_uInt16 nVersion )
{
CharSet eEncoding = osl_getThreadTextEncoding();
- rStream.ReadByteString(aName, eEncoding);
+ rStream.ReadUniOrByteString(aName, eEncoding);
char c;
for(sal_uInt16 n = 0; n < MAXLEVEL; ++n )
@@ -274,7 +274,7 @@ void SwNumRulesWithName::MakeNumRule( SwWrtShell& rSh, SwNumRule& rChg ) const
void SwNumRulesWithName::Store( SvStream &rStream )
{
CharSet eEncoding = osl_getThreadTextEncoding();
- rStream.WriteByteString(aName, eEncoding);
+ rStream.WriteUniOrByteString(aName, eEncoding);
for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
{
@@ -354,9 +354,9 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
long nL;
rStream >> cChar; aFmt.SetStart( (sal_uInt16)cChar );
- rStream.ReadByteString(sStr, eEncoding);
+ rStream.ReadUniOrByteString(sStr, eEncoding);
aFmt.SetPrefix( sStr );
- rStream.ReadByteString(sStr, eEncoding);
+ rStream.ReadUniOrByteString(sStr, eEncoding);
aFmt.SetSuffix( sStr );
rStream >> nUS; aFmt.SetNumAdjust( SvxAdjust( nUS ) );
rStream >> nL; aFmt.SetLSpace( lNumIndent );
@@ -366,9 +366,9 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
{
short nShort;
rStream >> nUS; aFmt.SetStart( nUS );
- rStream.ReadByteString(sStr, eEncoding);
+ rStream.ReadUniOrByteString(sStr, eEncoding);
aFmt.SetPrefix( sStr );
- rStream.ReadByteString(sStr, eEncoding);
+ rStream.ReadUniOrByteString(sStr, eEncoding);
aFmt.SetSuffix( sStr );
rStream >> nUS; aFmt.SetNumAdjust( SvxAdjust( nUS ) );
rStream >> nUS; aFmt.SetAbsLSpace( nUS );
@@ -385,7 +385,7 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
sal_uInt16 nPitch;
String aName;
- rStream.ReadByteString(aName, eEncoding);
+ rStream.ReadUniOrByteString(aName, eEncoding);
rStream >> nFamily >> nCharSet >> nWidth >> nHeight >> nPitch;
if( aName.Len() )
@@ -411,7 +411,7 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
{
sal_uInt16 nItemCount;
rStream >> nCharPoolId;
- rStream.ReadByteString(sCharFmtName, eEncoding);
+ rStream.ReadUniOrByteString(sCharFmtName, eEncoding);
rStream >> nItemCount;
while( nItemCount-- )
@@ -485,15 +485,15 @@ void SwNumRulesWithName::_SwNumFmtGlobal::Store( SvStream& rStream )
<< aFmt.GetBulletChar()
<< static_cast<sal_Bool>(aFmt.GetIncludeUpperLevels() > 0)
<< aFmt.GetStart();
- rStream.WriteByteString( aFmt.GetPrefix(), eEncoding );
- rStream.WriteByteString( aFmt.GetSuffix(), eEncoding );
+ rStream.WriteUniOrByteString( aFmt.GetPrefix(), eEncoding );
+ rStream.WriteUniOrByteString( aFmt.GetSuffix(), eEncoding );
rStream << sal_uInt16( aFmt.GetNumAdjust() )
<< aFmt.GetAbsLSpace()
<< aFmt.GetFirstLineOffset()
<< aFmt.GetCharTextDistance()
<< aFmt.GetLSpace()
<< sal_False;//aFmt.IsRelLSpace();
- rStream.WriteByteString( aName, eEncoding );
+ rStream.WriteUniOrByteString( aName, eEncoding );
rStream << nFamily
<< nCharSet
<< nWidth
@@ -501,7 +501,7 @@ void SwNumRulesWithName::_SwNumFmtGlobal::Store( SvStream& rStream )
<< nPitch;
}
rStream << nCharPoolId;
- rStream.WriteByteString( sCharFmtName, eEncoding );
+ rStream.WriteUniOrByteString( sCharFmtName, eEncoding );
rStream << aItems.Count();
for( sal_uInt16 n = aItems.Count(); n; )
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index e6e939bbbd1b..4d316708b152 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -363,11 +363,6 @@ public:
SvStream& operator<<( const unsigned char* pBuf );
SvStream& operator<<( SvStream& rStream );
- SvStream& ReadByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet );
- SvStream& ReadByteString( UniString& rStr ) { return ReadByteString( rStr, GetStreamCharSet() ); }
- SvStream& WriteByteString( const UniString& rStr, rtl_TextEncoding eDestCharSet );
- SvStream& WriteByteString( const UniString& rStr ) { return WriteByteString( rStr, GetStreamCharSet() ); }
-
SvStream& WriteNumber( sal_uInt32 nUInt32 );
SvStream& WriteNumber( sal_Int32 nInt32 );
@@ -412,6 +407,12 @@ public:
/// Read a line of Unicode
sal_Bool ReadUniStringLine( String& rStr );
+ /// Read a 32bit length prefixed sequence of utf-16 if eSrcCharSet==RTL_TEXTENCODING_UNICODE,
+ /// otherwise read a 16bit length prefixed sequence of bytes and convert from eSrcCharSet
+ SvStream& ReadUniOrByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet );
+ /// Write a 32bit length prefixed sequence of utf-16 if eSrcCharSet==RTL_TEXTENCODING_UNICODE,
+ /// otherwise convert to eSrcCharSet and write a 16bit length prefixed sequence of bytes
+ SvStream& WriteUniOrByteString( const UniString& rStr, rtl_TextEncoding eDestCharSet );
/// Read a line of Unicode if eSrcCharSet==RTL_TEXTENCODING_UNICODE,
/// otherwise read a line of Bytecode and convert from eSrcCharSet
sal_Bool ReadUniOrByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSet );
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index f626dcccd508..a49d382ef158 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -137,7 +137,7 @@ sal_uIntPtr INetMessage::SetHeaderField (
SvStream& INetMessage::operator<< (SvStream& rStrm) const
{
rStrm << static_cast<sal_uInt32>(m_nDocSize);
- rStrm.WriteByteString (m_aDocName, RTL_TEXTENCODING_UTF8);
+ write_lenPrefixed_uInt8s_FromOUString(rStrm, m_aDocName, RTL_TEXTENCODING_UTF8);
sal_uIntPtr i, n = m_aHeaderList.size();
rStrm << static_cast<sal_uInt32>(n);
@@ -163,7 +163,7 @@ SvStream& INetMessage::operator>> (SvStream& rStrm)
// Copy.
rStrm >> nTemp;
m_nDocSize = nTemp;
- rStrm.ReadByteString (m_aDocName, RTL_TEXTENCODING_UTF8);
+ m_aDocName = read_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_UTF8);
sal_uIntPtr i, n = 0;
rStrm >> nTemp;
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index b70195978008..aab11a6ffc51 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1489,7 +1489,7 @@ SvStream& SvStream::operator<< ( SvStream& rStream )
// -----------------------------------------------------------------------
-SvStream& SvStream::ReadByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet )
+SvStream& SvStream::ReadUniOrByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet )
{
// read UTF-16 string directly from stream ?
if (eSrcCharSet == RTL_TEXTENCODING_UNICODE)
@@ -1523,7 +1523,7 @@ SvStream& SvStream::ReadByteString( UniString& rStr, rtl_TextEncoding eSrcCharSe
// -----------------------------------------------------------------------
-SvStream& SvStream::WriteByteString( const UniString& rStr, rtl_TextEncoding eDestCharSet )
+SvStream& SvStream::WriteUniOrByteString( const UniString& rStr, rtl_TextEncoding eDestCharSet )
{
// write UTF-16 string directly into stream ?
if (eDestCharSet == RTL_TEXTENCODING_UNICODE)
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 017042692225..059b1fe85320 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -780,8 +780,8 @@ SvStream& operator>>( SvStream& rIStm, Impl_Font& rImpl_Font )
sal_Bool bTmp;
sal_uInt8 nTmp8;
- rIStm.ReadByteString( rImpl_Font.maFamilyName, rIStm.GetStreamCharSet() );
- rIStm.ReadByteString( rImpl_Font.maStyleName, rIStm.GetStreamCharSet() );
+ rIStm.ReadUniOrByteString( rImpl_Font.maFamilyName, rIStm.GetStreamCharSet() );
+ rIStm.ReadUniOrByteString( rImpl_Font.maStyleName, rIStm.GetStreamCharSet() );
rIStm >> rImpl_Font.maSize;
rIStm >> nTmp16; rImpl_Font.meCharSet = (rtl_TextEncoding) nTmp16;
@@ -823,8 +823,8 @@ SvStream& operator>>( SvStream& rIStm, Impl_Font& rImpl_Font )
SvStream& operator<<( SvStream& rOStm, const Impl_Font& rImpl_Font )
{
VersionCompat aCompat( rOStm, STREAM_WRITE, 3 );
- rOStm.WriteByteString( rImpl_Font.maFamilyName, rOStm.GetStreamCharSet() );
- rOStm.WriteByteString( rImpl_Font.maStyleName, rOStm.GetStreamCharSet() );
+ rOStm.WriteUniOrByteString( rImpl_Font.maFamilyName, rOStm.GetStreamCharSet() );
+ rOStm.WriteUniOrByteString( rImpl_Font.maStyleName, rOStm.GetStreamCharSet() );
rOStm << rImpl_Font.maSize;
rOStm << (sal_uInt16) GetStoreCharSet( rImpl_Font.meCharSet );
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index 796659cfdaa5..8d3ef576690e 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -334,9 +334,8 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
rIStream.Seek( nFirstPos + sizeof( ImplOldJobSetupData ) + 4 + sizeof( Impl364JobSetupData ) + pJobData->mnDriverDataLen );
while( rIStream.Tell() < nFirstPos + nLen )
{
- String aKey, aValue;
- rIStream.ReadByteString( aKey, RTL_TEXTENCODING_UTF8 );
- rIStream.ReadByteString( aValue, RTL_TEXTENCODING_UTF8 );
+ String aKey = read_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8);
+ String aValue = read_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8);
if( aKey.EqualsAscii( "COMPAT_DUPLEX_MODE" ) )
{
if( aValue.EqualsAscii( "DUPLEX_UNKNOWN" ) )
@@ -407,8 +406,8 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
for( it = pJobData->maValueMap.begin(); it != pJobData->maValueMap.end(); ++it )
{
- rOStream.WriteByteString( it->first, RTL_TEXTENCODING_UTF8 );
- rOStream.WriteByteString( it->second, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOUString(rOStream, it->first, RTL_TEXTENCODING_UTF8);
+ write_lenPrefixed_uInt8s_FromOUString(rOStream, it->second, RTL_TEXTENCODING_UTF8);
}
write_lenPrefixed_uInt8s_FromOString(rOStream, "COMPAT_DUPLEX_MODE");
switch( pJobData->meDuplexMode )
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 9961705cbb6c..2fd96e835910 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1259,7 +1259,7 @@ void MetaTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 2, pData );
rOStm << maPt;
- rOStm.WriteByteString( maStr, pData->meActualCharSet );
+ rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
rOStm << mnIndex;
rOStm << mnLen;
@@ -1278,7 +1278,7 @@ void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
rIStm >> maPt;
- rIStm.ReadByteString( maStr, pData->meActualCharSet );
+ rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
rIStm >> mnIndex;
rIStm >> mnLen;
@@ -1408,7 +1408,7 @@ void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
WRITE_BASE_COMPAT( rOStm, 2, pData );
rOStm << maStartPt;
- rOStm.WriteByteString( maStr, pData->meActualCharSet );
+ rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
rOStm << mnIndex;
rOStm << mnLen;
rOStm << nAryLen;
@@ -1435,7 +1435,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
COMPAT( rIStm );
rIStm >> maStartPt;
- rIStm.ReadByteString( maStr, pData->meActualCharSet );
+ rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
rIStm >> mnIndex;
rIStm >> mnLen;
rIStm >> nAryLen;
@@ -1555,7 +1555,7 @@ void MetaStretchTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 2, pData );
rOStm << maPt;
- rOStm.WriteByteString( maStr, pData->meActualCharSet );
+ rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
rOStm << mnWidth;
rOStm << mnIndex;
rOStm << mnLen;
@@ -1575,7 +1575,7 @@ void MetaStretchTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
rIStm >> maPt;
- rIStm.ReadByteString( maStr, pData->meActualCharSet );
+ rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
rIStm >> mnWidth;
rIStm >> mnIndex;
rIStm >> mnLen;
@@ -1650,7 +1650,7 @@ void MetaTextRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 2, pData );
rOStm << maRect;
- rOStm.WriteByteString( maStr, pData->meActualCharSet );
+ rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
rOStm << mnStyle;
sal_uInt16 i, nLen = maStr.Len(); // version 2
@@ -1668,7 +1668,7 @@ void MetaTextRectAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
rIStm >> maRect;
- rIStm.ReadByteString( maStr, pData->meActualCharSet );
+ rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
rIStm >> mnStyle;
if ( aCompat.GetVersion() >= 2 ) // Version 2
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 6a4cabaecbfe..9cede2527aaa 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -280,10 +280,10 @@ SvStream& operator<<( SvStream& rOStream, const QueueInfo& rInfo )
{
VersionCompat aCompat( rOStream, STREAM_WRITE, 1 );
- rOStream.WriteByteString( rInfo.maPrinterName, RTL_TEXTENCODING_UTF8 );
- rOStream.WriteByteString( rInfo.maDriver, RTL_TEXTENCODING_UTF8 );
- rOStream.WriteByteString( rInfo.maLocation, RTL_TEXTENCODING_UTF8 );
- rOStream.WriteByteString( rInfo.maComment, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOUString(rOStream, rInfo.maPrinterName, RTL_TEXTENCODING_UTF8);
+ write_lenPrefixed_uInt8s_FromOUString(rOStream, rInfo.maDriver, RTL_TEXTENCODING_UTF8);
+ write_lenPrefixed_uInt8s_FromOUString(rOStream, rInfo.maLocation, RTL_TEXTENCODING_UTF8);
+ write_lenPrefixed_uInt8s_FromOUString(rOStream, rInfo.maComment, RTL_TEXTENCODING_UTF8);
rOStream << rInfo.mnStatus;
rOStream << rInfo.mnJobs;
@@ -296,15 +296,10 @@ SvStream& operator>>( SvStream& rIStream, QueueInfo& rInfo )
{
VersionCompat aCompat( rIStream, STREAM_READ );
- String aTmp;
- rIStream.ReadByteString( aTmp, RTL_TEXTENCODING_UTF8 );
- rInfo.maPrinterName = aTmp;
- rIStream.ReadByteString( aTmp, RTL_TEXTENCODING_UTF8 );
- rInfo.maDriver = aTmp;
- rIStream.ReadByteString( aTmp, RTL_TEXTENCODING_UTF8 );
- rInfo.maLocation = aTmp;
- rIStream.ReadByteString( aTmp, RTL_TEXTENCODING_UTF8 );
- rInfo.maComment = aTmp;
+ rInfo.maPrinterName = read_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8);
+ rInfo.maDriver = read_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8);
+ rInfo.maLocation = read_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8);
+ rInfo.maComment = read_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8);
rIStream >> rInfo.mnStatus;
rIStream >> rInfo.mnJobs;
diff --git a/vcl/source/gdi/rendergraphic.cxx b/vcl/source/gdi/rendergraphic.cxx
index 2077eedc4acd..16b08c4de17a 100644
--- a/vcl/source/gdi/rendergraphic.cxx
+++ b/vcl/source/gdi/rendergraphic.cxx
@@ -192,10 +192,9 @@ void RenderGraphic::ImplGetDefaults() const
::SvStream& operator>>( ::SvStream& rIStm, RenderGraphic& rRenderGraphic )
{
::VersionCompat aVCompat( rIStm, STREAM_READ );
- String aGraphicDataMimeType;
sal_uInt32 nGraphicDataLength = 0;
- rIStm.ReadByteString( aGraphicDataMimeType, RTL_TEXTENCODING_ASCII_US );
+ rtl::OUString aGraphicDataMimeType = read_lenPrefixed_uInt8s_ToOUString(rIStm, RTL_TEXTENCODING_ASCII_US);
rIStm >> nGraphicDataLength;
rRenderGraphic = RenderGraphic( aGraphicDataMimeType, nGraphicDataLength );
@@ -215,7 +214,8 @@ void RenderGraphic::ImplGetDefaults() const
::VersionCompat aVCompat( rOStm, STREAM_WRITE, 1 );
const sal_uInt32 nGraphicDataLength = rRenderGraphic.GetGraphicDataLength();
- rOStm.WriteByteString( rRenderGraphic.GetGraphicDataMimeType(), RTL_TEXTENCODING_ASCII_US );
+ write_lenPrefixed_uInt8s_FromOUString(rOStm, rRenderGraphic.GetGraphicDataMimeType(),
+ RTL_TEXTENCODING_ASCII_US);
rOStm << nGraphicDataLength;
if( nGraphicDataLength )
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index cf7941e67805..44ca911f6987 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -160,10 +160,10 @@ ImplFontAttrCache::ImplFontAttrCache( const String& rFileNameURL, const String&
ImplDevFontAttributes aDFA;
for(;;)
{
- aCacheFile.ReadByteString( aFontFileURL, RTL_TEXTENCODING_UTF8 );
+ aFontFileURL = read_lenPrefixed_uInt8s_ToOUString(aCacheFile, RTL_TEXTENCODING_UTF8);
if( !aFontFileURL.Len() )
break;
- aCacheFile.ReadByteString( aDFA.maName, RTL_TEXTENCODING_UTF8 );
+ aDFA.maName = read_lenPrefixed_uInt8s_ToOUString(aCacheFile, RTL_TEXTENCODING_UTF8);
short n;
aCacheFile >> n; aDFA.meWeight = static_cast<FontWeight>(n);
@@ -195,8 +195,8 @@ ImplFontAttrCache::~ImplFontAttrCache()
{
const String rFontFileURL( (*aIter).first );
const ImplDevFontAttributes& rDFA( (*aIter).second );
- aCacheFile.WriteByteString( rFontFileURL, RTL_TEXTENCODING_UTF8 );
- aCacheFile.WriteByteString( rDFA.maName, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOUString(aCacheFile, rFontFileURL, RTL_TEXTENCODING_UTF8);
+ write_lenPrefixed_uInt8s_FromOUString(aCacheFile, rDFA.maName, RTL_TEXTENCODING_UTF8);
aCacheFile << static_cast<short>(rDFA.meWeight);
aCacheFile << static_cast<short>(rDFA.meItalic);
@@ -205,13 +205,12 @@ ImplFontAttrCache::~ImplFontAttrCache()
aCacheFile << static_cast<short>(rDFA.meFamily);
aCacheFile << static_cast<short>(rDFA.mbSymbolFlag != false);
- aCacheFile.WriteByteStringLine( rDFA.maStyleName, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOUString(aCacheFile, rDFA.maStyleName, RTL_TEXTENCODING_UTF8);
++aIter;
}
// EOF Marker
- String aEmptyStr;
- aCacheFile.WriteByteString( aEmptyStr, RTL_TEXTENCODING_UTF8 );
+ write_lenPrefixed_uInt8s_FromOString(aCacheFile, rtl::OString(), RTL_TEXTENCODING_UTF8);
}
}
}