diff options
41 files changed, 224 insertions, 257 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 9052458e84db..e6c829adbe2c 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 79b3765fa1fc..1208184b5672 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 975ecc20a0a2..07194fafc966 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 5b25252a780d..2ff6990e215d 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 7ab2d6c15b37..711efdcb5afc 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 97573876064c..7803ee013b2f 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 0c98fca20049..81574efd0fba 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 ); // 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 692959aa9c18..0d6aa84e19c7 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 = read_lenPrefixed_uInt8s_ToOUString(r, - RTL_TEXTENCODING_ASCII_US); + XubString aVal; + r.ReadByteString( aVal, 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 = read_lenPrefixed_uInt8s_ToOUString(r, - RTL_TEXTENCODING_ASCII_US); + XubString aVal; + r.ReadByteString( aVal, 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: { - rtl::OUString aVal = read_lenPrefixed_uInt8s_ToOUString(r, - RTL_TEXTENCODING_ASCII_US); - if( aVal.getLength() ) + XubString aVal; + r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + if( aVal.Len() ) 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 ); - write_lenPrefixed_uInt8s_FromOUString(r, GetCoreString(), RTL_TEXTENCODING_ASCII_US); + r.WriteByteString( GetCoreString(), RTL_TEXTENCODING_ASCII_US ); ((SbxValue*)this)->aData.eType = (SbxDataType)nType; break; case SbxSINGLE: case SbxDOUBLE: - write_lenPrefixed_uInt8s_FromOUString(r, GetCoreString(), RTL_TEXTENCODING_ASCII_US); + r.WriteByteString( GetCoreString(), RTL_TEXTENCODING_ASCII_US ); break; case SbxSALUINT64: case SbxSALINT64: @@ -1643,11 +1643,12 @@ sal_Bool SbxValue::StoreData( SvStream& r ) const case SbxSTRING: if( aData.pOUString ) { - write_lenPrefixed_uInt8s_FromOUString(r, *aData.pOUString, RTL_TEXTENCODING_ASCII_US); + r.WriteByteString( *aData.pOUString, RTL_TEXTENCODING_ASCII_US ); } else { - write_lenPrefixed_uInt8s_FromOUString(r, rtl::OUString(), RTL_TEXTENCODING_ASCII_US); + String aEmpty; + r.WriteByteString( aEmpty, RTL_TEXTENCODING_ASCII_US ); } break; case SbxERROR: diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 6ca253355603..58b3cb73f9d4 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -445,8 +445,7 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { if( !SbxValue::LoadData( rStrm, nVer ) ) return sal_False; - maName = read_lenPrefixed_uInt8s_ToOUString(rStrm, - RTL_TEXTENCODING_ASCII_US); + rStrm.ReadByteString( maName, RTL_TEXTENCODING_ASCII_US ); sal_uInt32 nTemp; rStrm >> nTemp; nUserData = nTemp; @@ -455,8 +454,7 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { rStrm.SeekRel( -1L ); rStrm >> nType; - maName = read_lenPrefixed_uInt8s_ToOUString(rStrm, - RTL_TEXTENCODING_ASCII_US); + rStrm.ReadByteString( maName, RTL_TEXTENCODING_ASCII_US ); sal_uInt32 nTemp; rStrm >> nTemp; nUserData = nTemp; @@ -479,8 +477,7 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) case SbxSINGLE: { // Floats as ASCII - aTmpString = read_lenPrefixed_uInt8s_ToOUString( - rStrm, RTL_TEXTENCODING_ASCII_US); + rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US ); double d; SbxDataType t; if( ImpScan( aTmpString, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE ) @@ -495,8 +492,7 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) case SbxDOUBLE: { // Floats as ASCII - aTmpString = read_lenPrefixed_uInt8s_ToOUString(rStrm, - RTL_TEXTENCODING_ASCII_US); + rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US ); SbxDataType t; if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != SbxERR_OK ) { @@ -506,8 +502,8 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) break; } case SbxSTRING: - aVal = read_lenPrefixed_uInt8s_ToOUString(rStrm, - RTL_TEXTENCODING_ASCII_US); + rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US ); + aVal = aTmpString; break; case SbxEMPTY: case SbxNULL: @@ -565,8 +561,7 @@ sal_Bool SbxVariable::StoreData( SvStream& rStrm ) const bValStore = SbxValue::StoreData( rStrm ); if( !bValStore ) return sal_False; - write_lenPrefixed_uInt8s_FromOUString(rStrm, maName, - RTL_TEXTENCODING_ASCII_US); + rStrm.WriteByteString( 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 35be52c28521..b4ed28a4f0f4 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.WriteUniOrByteString(pFieldDesc->GetName(), _rStr.GetStreamCharSet()); - _rStr.WriteUniOrByteString(pFieldDesc->GetDescription(), _rStr.GetStreamCharSet()); - _rStr.WriteUniOrByteString(pFieldDesc->GetHelpText(), _rStr.GetStreamCharSet()); + _rStr.WriteByteString(pFieldDesc->GetName()); + _rStr.WriteByteString(pFieldDesc->GetDescription()); + _rStr.WriteByteString(pFieldDesc->GetHelpText()); double nValue = 0.0; Any aValue = pFieldDesc->GetControlDefault(); if ( aValue >>= nValue ) @@ -141,7 +141,7 @@ namespace dbaui else { _rStr << sal_Int32(2); - _rStr.WriteUniOrByteString(::comphelper::getString(aValue), _rStr.GetStreamCharSet()); + _rStr.WriteByteString(::comphelper::getString(aValue)); } _rStr << pFieldDesc->GetType(); @@ -170,12 +170,12 @@ namespace dbaui OFieldDescription* pFieldDesc = new OFieldDescription(); _rRow.m_pActFieldDescr = pFieldDesc; String sValue; - _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet()); + _rStr.ReadByteString(sValue); pFieldDesc->SetName(sValue); - _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet()); + _rStr.ReadByteString(sValue); pFieldDesc->SetDescription(sValue); - _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet()); + _rStr.ReadByteString(sValue); pFieldDesc->SetHelpText(sValue); _rStr >> nValue; @@ -190,7 +190,7 @@ namespace dbaui break; } case 2: - _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet()); + _rStr.ReadByteString(sValue); aControlDefault <<= ::rtl::OUString(sValue); break; } diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 8435e66d923f..0fd144b42514 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.ReadUniOrByteString( pC->GetStyle(), eSrcEncoding ); + rIStream.ReadByteString( 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.ReadUniOrByteString( pC->GetText(), rIStream.GetStreamCharSet() ); + rIStream.ReadByteString( pC->GetText() ); // StyleName and Family... - rIStream.ReadUniOrByteString( pC->GetStyle(), rIStream.GetStreamCharSet() ); + rIStream.ReadByteString( pC->GetStyle() ); sal_uInt16 nStyleFamily; rIStream >> nStyleFamily; pC->GetFamily() = (SfxStyleFamily)nStyleFamily; diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index caca392a6d18..2d0e066e4091 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.WriteUniOrByteString(rFont.GetName(), rStream.GetStreamCharSet()); + rStream.WriteByteString(rFont.GetName()); 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.ReadUniOrByteString(aName, rStream.GetStreamCharSet()); + rStream.ReadByteString(aName); aFont.SetName( aName ); if( nVer == 1 ) @@ -217,10 +217,10 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) : rStrm >> nScale; // UNICODE: rStrm >> aPrevText; - rStrm.ReadUniOrByteString(aPrevText, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(aPrevText); // UNICODE: rStrm >> aFollowText; - rStrm.ReadUniOrByteString(aFollowText, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(aFollowText); nValidMask = 0xFFFF; } @@ -416,10 +416,10 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) c rStrm << nScale; // UNICODE: rStrm << aPrevText; - rStrm.WriteUniOrByteString(aPrevText, rStrm.GetStreamCharSet()); + rStrm.WriteByteString(aPrevText); // UNICODE: rStrm << aFollowText; - rStrm.WriteUniOrByteString(aFollowText, rStrm.GetStreamCharSet()); + rStrm.WriteByteString(aFollowText); return rStrm; } diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index bafb976f057b..56b2d71f68fa 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.ReadUniOrByteString(aFile, rStm.GetStreamCharSet()); + rStm.ReadByteString(aFile); rStm >> nType; rStm >> nFormat; @@ -749,7 +749,7 @@ void SvxExtFileField::Load( SvPersistStream & rStm ) void SvxExtFileField::Save( SvPersistStream & rStm ) { // UNICODE: rStm << aFile; - rStm.WriteUniOrByteString(aFile, rStm.GetStreamCharSet()); + rStm.WriteByteString(aFile); rStm << (sal_uInt16) eType; rStm << (sal_uInt16) eFormat; diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 18af4a61ec7b..addb3f630a68 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.ReadUniOrByteString(aRel, rStream.GetStreamCharSet()); + rStream.ReadByteString(aRel); // 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.ReadUniOrByteString(*pStrFilter, rStream.GetStreamCharSet()); + rStream.ReadByteString(*pStrFilter); } 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.WriteUniOrByteString(aRel, rStream.GetStreamCharSet()); + rStream.WriteByteString(aRel); } if ( pStrFilter ) { // UNICODE: rStream << *pStrFilter; - rStream.WriteUniOrByteString(*pStrFilter, rStream.GetStreamCharSet()); + rStream.WriteByteString(*pStrFilter); } rStream << (sal_Int8)eGraphicPos; return rStream; diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 01fc4630ff23..8f71ff238b11 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.WriteUniOrByteString(sPrefix, eEnc); - rStream.WriteUniOrByteString(sSuffix, eEnc); - rStream.WriteUniOrByteString(sCharStyleName, eEnc); + rStream.WriteByteString(sPrefix, eEnc); + rStream.WriteByteString(sSuffix, eEnc); + rStream.WriteByteString(sCharStyleName, eEnc); if(pGraphicBrush) { rStream << (sal_uInt16)1; diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index e3069074573a..4f5dc8dc29e6 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.WriteUniOrByteString(aStoreFamilyName, rStrm.GetStreamCharSet()); - rStrm.WriteUniOrByteString(GetStyleName(), rStrm.GetStreamCharSet()); + rStrm.WriteByteString(aStoreFamilyName); + rStrm.WriteByteString(GetStyleName()); // cach for EditEngine, only set while creating clipboard stream. if ( bEnableStoreUnicodeNames ) { sal_uInt32 nMagic = STORE_UNICODE_MAGIC_MARKER; rStrm << nMagic; - rStrm.WriteUniOrByteString( aStoreFamilyName, RTL_TEXTENCODING_UNICODE ); - rStrm.WriteUniOrByteString( GetStyleName(), RTL_TEXTENCODING_UNICODE ); + rStrm.WriteByteString( aStoreFamilyName, RTL_TEXTENCODING_UNICODE ); + rStrm.WriteByteString( GetStyleName(), RTL_TEXTENCODING_UNICODE ); } return rStrm; @@ -424,10 +424,10 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const rStrm >> eFontTextEncoding; // UNICODE: rStrm >> aName; - rStrm.ReadUniOrByteString(aName, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(aName); // UNICODE: rStrm >> aStyle; - rStrm.ReadUniOrByteString(aStyle, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(aStyle); // 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.ReadUniOrByteString( aName, RTL_TEXTENCODING_UNICODE ); - rStrm.ReadUniOrByteString( aStyle, RTL_TEXTENCODING_UNICODE ); + rStrm.ReadByteString( aName, RTL_TEXTENCODING_UNICODE ); + rStrm.ReadByteString( aStyle, RTL_TEXTENCODING_UNICODE ); } else { diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx index e8e6542eb1b0..4fd5c78f7f6f 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.ReadUniOrByteString( aIdlFileName, rStm.GetStreamCharSet() ); + rStm.ReadByteString( aIdlFileName ); 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.WriteUniOrByteString( aIdlFileName, rStm.GetStreamCharSet() ); + rStm.WriteByteString( aIdlFileName ); 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.WriteUniOrByteString( aBeginName.GetHexName(), rOutStm.GetStreamCharSet() ); + rOutStm.WriteByteString( aBeginName.GetHexName() ); rOutStm << '\"' << endl << '\"'; - rOutStm.WriteUniOrByteString( aEndName.GetHexName(), rOutStm.GetStreamCharSet() ); + rOutStm.WriteByteString( aEndName.GetHexName() ); rOutStm << '\"' << endl; SvMetaExtern::WriteSvIdl( rBase, rOutStm, nTab ); } diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 93adcfeea75e..fbd982db364a 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.ReadUniOrByteString( *pStr, rStream.GetStreamCharSet() ); + rStream.ReadByteString( *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.WriteUniOrByteString( pStyle->GetName(), rStream.GetStreamCharSet() ); + rStream.WriteByteString( pStyle->GetName(), rStream.GetStreamCharSet() ); else if ( pName ) // wenn Style geloescht ist/war - rStream.WriteUniOrByteString( *pName, rStream.GetStreamCharSet() ); + rStream.WriteByteString( *pName, rStream.GetStreamCharSet() ); else - rStream.WriteUniOrByteString( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), + rStream.WriteByteString( 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 61b8355826f8..fa7836bc604a 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -797,14 +797,8 @@ 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 - if (nVer >= AUTOFORMAT_ID_680DR25) - { - aName = read_lenPrefixed_uInt8s_ToOUString(rStream, - RTL_TEXTENCODING_UTF8); - } - else - rStream.ReadUniOrByteString( aName, rStream.GetStreamCharSet() ); - + CharSet eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet(); + rStream.ReadByteString( aName, eCharSet ); if( AUTOFORMAT_DATA_ID_552 <= nVer ) { rStream >> nStrResId; @@ -844,7 +838,7 @@ sal_Bool ScAutoFormatData::LoadOld( SvStream& rStream, const ScAfVersions& rVers bRet = (rStream.GetError() == 0); if (bRet && (nVal == AUTOFORMAT_OLD_DATA_ID)) { - rStream.ReadUniOrByteString( aName, rStream.GetStreamCharSet() ); + rStream.ReadByteString( aName, rStream.GetStreamCharSet() ); sal_Bool b; rStream >> b; bIncludeFont = b; rStream >> b; bIncludeJustify = b; @@ -869,7 +863,7 @@ sal_Bool ScAutoFormatData::Save(SvStream& rStream) sal_Bool b; rStream << nVal; // --- from 680/dr25 on: store strings as UTF-8 - write_lenPrefixed_uInt8s_FromOUString(rStream, aName, RTL_TEXTENCODING_UTF8); + rStream.WriteByteString( 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 ca956813697b..7fbb58b0ea4f 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.ReadUniOrByteString( aAppl, eCharSet ); - rStream.ReadUniOrByteString( aTopic, eCharSet ); - rStream.ReadUniOrByteString( aItem, eCharSet ); + rStream.ReadByteString( aAppl, eCharSet ); + rStream.ReadByteString( aTopic, eCharSet ); + rStream.ReadByteString( 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.WriteUniOrByteString( aAppl, eCharSet ); - rStream.WriteUniOrByteString( aTopic, eCharSet ); - rStream.WriteUniOrByteString( aItem, eCharSet ); + rStream.WriteByteString( aAppl, eCharSet ); + rStream.WriteByteString( aTopic, eCharSet ); + rStream.WriteByteString( 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 048c981df3bf..4ebbee3551c0 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.ReadUniOrByteString( sFormatstring, eByteStrSet ); + rStream.ReadByteString( 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.WriteUniOrByteString( sFormatstring, eByteStrSet ); + rStream.WriteByteString( 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 55714612b2df..6a9515d4f540 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -267,25 +267,19 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) sal_uInt16 nTemp16; - rDesign.m_aDesignName = read_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); + rIn.ReadByteString( rDesign.m_aDesignName, RTL_TEXTENCODING_UTF8 ); rIn >> nTemp16; rDesign.m_eMode = (HtmlPublishMode)nTemp16; rIn >> rDesign.m_bContentPage; rIn >> rDesign.m_bNotes; rIn >> rDesign.m_nResolution; - rDesign.m_aCompression = read_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); + rIn.ReadByteString( rDesign.m_aCompression, RTL_TEXTENCODING_UTF8 ); rIn >> nTemp16; rDesign.m_eFormat = (PublishingFormat)nTemp16; - 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.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 ); rIn >> rDesign.m_bDownload; rIn >> rDesign.m_bCreated; // not used rIn >> rDesign.m_nButtonThema; @@ -300,10 +294,8 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) rIn >> nTemp16; rDesign.m_eScript = (PublishingScript)nTemp16; - rDesign.m_aURL = read_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); - rDesign.m_aCGI = read_lenPrefixed_uInt8s_ToOUString(rIn, - RTL_TEXTENCODING_UTF8); + rIn.ReadByteString( rDesign.m_aURL, RTL_TEXTENCODING_UTF8 ); + rIn.ReadByteString( rDesign.m_aCGI, RTL_TEXTENCODING_UTF8 ); rIn >> rDesign.m_bAutoSlide; rIn >> rDesign.m_nSlideDuration; @@ -323,24 +315,18 @@ SvStream& operator << (SvStream& rOut, const SdPublishingDesign& rDesign) SdIOCompat aIO(rOut, STREAM_WRITE, 0); // Name - write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aDesignName, - RTL_TEXTENCODING_UTF8); + rOut.WriteByteString( rDesign.m_aDesignName, RTL_TEXTENCODING_UTF8 ); rOut << (sal_uInt16)rDesign.m_eMode; rOut << rDesign.m_bContentPage; rOut << rDesign.m_bNotes; rOut << rDesign.m_nResolution; - write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCompression, - RTL_TEXTENCODING_UTF8); + rOut.WriteByteString( rDesign.m_aCompression, RTL_TEXTENCODING_UTF8 ); rOut << (sal_uInt16)rDesign.m_eFormat; - 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.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 ); rOut << rDesign.m_bDownload; rOut << rDesign.m_bCreated; // not used rOut << rDesign.m_nButtonThema; @@ -354,10 +340,8 @@ SvStream& operator << (SvStream& rOut, const SdPublishingDesign& rDesign) rOut << rDesign.m_bUseColor; rOut << (sal_uInt16)rDesign.m_eScript; - write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aURL, - RTL_TEXTENCODING_UTF8); - write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCGI, - RTL_TEXTENCODING_UTF8); + rOut.WriteByteString( rDesign.m_aURL, RTL_TEXTENCODING_UTF8 ); + rOut.WriteByteString( 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 eaef4b41ce49..e323361ed09c 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->ReadUniOrByteString(aTitle, pStream->GetStreamCharSet()); + pStream->ReadByteString(aTitle); 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->ReadUniOrByteString(aTitle, pStream->GetStreamCharSet()); + pStream->ReadByteString(aTitle); 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 49c7bd3cdcc6..f1cf5c0c3127 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; - write_lenPrefixed_uInt8s_FromOUString(*pStream, aLink, RTL_TEXTENCODING_UTF8); + pStream->WriteByteString( 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 8970688be602..e6dab39b6706 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.ReadUniOrByteString(rString, rStream.GetStreamCharSet()); + rStream.ReadByteString(rString); 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.WriteUniOrByteString(rString, rStream.GetStreamCharSet()); + rStream.WriteByteString(rString); } //============================================================================ @@ -204,7 +204,7 @@ void SfxPoolItem::writeByteString(SvStream & rStream, bool SfxPoolItem::readUnicodeString(SvStream & rStream, UniString & rString, bool bUnicode) { - rStream.ReadUniOrByteString(rString, + rStream.ReadByteString(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.WriteUniOrByteString(rString, RTL_TEXTENCODING_UCS2); + rStream.WriteByteString(rString, RTL_TEXTENCODING_UCS2); } // ------------------------------------------------------------------------ diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 852e16d32487..424aaa0204ce 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.WriteUniOrByteString( sStrArray[i], rStream.GetStreamCharSet() ); + rStream.WriteByteString( 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.WriteUniOrByteString( sColorName, rStream.GetStreamCharSet() ); + rStream.WriteByteString( 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.ReadUniOrByteString( sColorName, rStream.GetStreamCharSet() ); + rStream.ReadByteString( sColorName, rStream.GetStreamCharSet() ); rLoadedColorName = sColorName; pColor = rSc.GetColor(sColorName); } @@ -1828,13 +1828,13 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr } rHdr.StartEntry(); - rStream.WriteUniOrByteString( aFormatstring, rStream.GetStreamCharSet() ); + rStream.WriteByteString( 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.WriteUniOrByteString( aComment, rStream.GetStreamCharSet() ); + rStream.WriteByteString( 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 e2a340a8291b..41f0af0839cd 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.WriteUniOrByteString( _rString, m_rStorage.GetStreamCharSet() ); + m_rStorage.WriteByteString( _rString ); } }; @@ -418,7 +418,7 @@ namespace svt while ( nChildren-- ) { String sURL; - m_rStorage.ReadUniOrByteString( sURL, m_rStorage.GetStreamCharSet() ); + m_rStorage.ReadByteString( sURL ); 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->ReadUniOrByteString( sURL, m_pCacheStream->GetStreamCharSet() ); + m_pCacheStream->ReadByteString( sURL ); // #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 c8158d19b52a..aac712644d95 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.ReadUniOrByteString( rObjDesc.maTypeName, osl_getThreadTextEncoding() ); - rIStm.ReadUniOrByteString( rObjDesc.maDisplayName, osl_getThreadTextEncoding() ); + rIStm.ReadByteString( rObjDesc.maTypeName, osl_getThreadTextEncoding() ); + rIStm.ReadByteString( 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.WriteUniOrByteString( rObjDesc.maTypeName, osl_getThreadTextEncoding() ); - rOStm.WriteUniOrByteString( rObjDesc.maDisplayName, osl_getThreadTextEncoding() ); + rOStm.WriteByteString( rObjDesc.maTypeName, osl_getThreadTextEncoding() ); + rOStm.WriteByteString( 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 1f6dfa83a794..11a26aa04d49 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.WriteUniOrByteString(sName, rStrm.GetStreamCharSet()); + rStrm.WriteByteString(sName); // UNICODE: rStrm << sURL; - rStrm.WriteUniOrByteString(sURL, rStrm.GetStreamCharSet()); + rStrm.WriteByteString(sURL); // UNICODE: rStrm << sTarget; - rStrm.WriteUniOrByteString(sTarget, rStrm.GetStreamCharSet()); + rStrm.WriteByteString(sTarget); rStrm << (sal_uInt32) eType; @@ -64,7 +64,7 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ // new data // UNICODE: rStrm << sIntName; - rStrm.WriteUniOrByteString(sIntName, rStrm.GetStreamCharSet()); + rStrm.WriteByteString(sIntName); // 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.WriteUniOrByteString(pMac->GetLibName(), rStrm.GetStreamCharSet()); + rStrm.WriteByteString(pMac->GetLibName()); // UNICODE: rStrm << pMac->GetMacName(); - rStrm.WriteUniOrByteString(pMac->GetMacName(), rStrm.GetStreamCharSet()); + rStrm.WriteByteString(pMac->GetMacName()); } } } @@ -111,10 +111,10 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ rStrm << (sal_uInt16)pMacroTable->GetCurKey(); // UNICODE: rStrm << pMac->GetLibName(); - rStrm.WriteUniOrByteString(pMac->GetLibName(), rStrm.GetStreamCharSet()); + rStrm.WriteByteString(pMac->GetLibName()); // UNICODE: rStrm << pMac->GetMacName(); - rStrm.WriteUniOrByteString(pMac->GetMacName(), rStrm.GetStreamCharSet()); + rStrm.WriteByteString(pMac->GetMacName()); 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.ReadUniOrByteString(pNew->sName, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(pNew->sName); // UNICODE: rStrm >> pNew->sURL; - rStrm.ReadUniOrByteString(pNew->sURL, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(pNew->sURL); // UNICODE: rStrm >> pNew->sTarget; - rStrm.ReadUniOrByteString(pNew->sTarget, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(pNew->sTarget); 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.ReadUniOrByteString(pNew->sIntName, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(pNew->sIntName); // macro-events rStrm >> pNew->nMacroEvents; @@ -164,10 +164,10 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer rStrm >> nCurKey; // UNICODE: rStrm >> aLibName; - rStrm.ReadUniOrByteString(aLibName, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(aLibName); // UNICODE: rStrm >> aMacName; - rStrm.ReadUniOrByteString(aMacName, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(aMacName); 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.ReadUniOrByteString(aLibName, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(aLibName); // UNICODE: rStrm >> aMacName; - rStrm.ReadUniOrByteString(aMacName, rStrm.GetStreamCharSet()); + rStrm.ReadByteString(aMacName); rStrm >> nScriptType; diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx index 7dcffd0c9dd4..0ac676debe0a 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.ReadUniOrByteString( sStr, rStream.GetStreamCharSet() ); + rStream.ReadByteString( sStr ); 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.WriteUniOrByteString(aDescName, rStrm.GetStreamCharSet()); + rStrm.WriteByteString(aDescName); 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 be2d325aef8f..d9c3a010eccd 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.ReadUniOrByteString( sNumFmtString, eCharSet ) + rStream.ReadByteString( sNumFmtString, eCharSet ) >> eSys >> eLge; eSysLanguage = (LanguageType) eSys; eNumFmtLanguage = (LanguageType) eLge; @@ -486,9 +486,8 @@ sal_Bool SwBoxAutoFmt::Save( SvStream& rStream ) const aRotateMode.Store( rStream, aRotateMode.GetVersion(SOFFICE_FILEFORMAT_40) ); // --- from 680/dr25 on: store strings as UTF-8 - write_lenPrefixed_uInt8s_FromOUString(rStream, sNumFmtString, - RTL_TEXTENCODING_UTF8); - rStream << (sal_uInt16)eSysLanguage << (sal_uInt16)eNumFmtLanguage; + rStream.WriteByteString( sNumFmtString, RTL_TEXTENCODING_UTF8 ) + << (sal_uInt16)eSysLanguage << (sal_uInt16)eNumFmtLanguage; return 0 == rStream.GetError(); } @@ -780,7 +779,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.ReadUniOrByteString( aName, eCharSet ); + rStream.ReadByteString( aName, eCharSet ); if( AUTOFORMAT_DATA_ID_552 <= nVal ) { rStream >> nStrResId; @@ -830,7 +829,7 @@ sal_Bool SwTableAutoFmt::LoadOld( SvStream& rStream, sal_uInt16 aLoadVer[] ) if( bRet && ( AUTOFORMAT_OLD_DATA_ID == nVal )) { sal_Bool b; - rStream.ReadUniOrByteString( aName, rStream.GetStreamCharSet() ); + rStream.ReadByteString( aName, rStream.GetStreamCharSet() ); rStream >> b; bInclFont = b; rStream >> b; bInclJustify = b; rStream >> b; bInclFrame = b; @@ -861,8 +860,7 @@ sal_Bool SwTableAutoFmt::Save( SvStream& rStream ) const sal_Bool b; rStream << nVal; // --- from 680/dr25 on: store strings as UTF-8 - write_lenPrefixed_uInt8s_FromOUString(rStream, aName, - RTL_TEXTENCODING_UTF8 ); + rStream.WriteByteString( 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 c43a2f4ed99b..b521578f605b 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.ReadUniOrByteString(aName, eEncoding); + rStream.ReadByteString(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.WriteUniOrByteString(aName, eEncoding); + rStream.WriteByteString(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.ReadUniOrByteString(sStr, eEncoding); + rStream.ReadByteString(sStr, eEncoding); aFmt.SetPrefix( sStr ); - rStream.ReadUniOrByteString(sStr, eEncoding); + rStream.ReadByteString(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.ReadUniOrByteString(sStr, eEncoding); + rStream.ReadByteString(sStr, eEncoding); aFmt.SetPrefix( sStr ); - rStream.ReadUniOrByteString(sStr, eEncoding); + rStream.ReadByteString(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.ReadUniOrByteString(aName, eEncoding); + rStream.ReadByteString(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.ReadUniOrByteString(sCharFmtName, eEncoding); + rStream.ReadByteString(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.WriteUniOrByteString( aFmt.GetPrefix(), eEncoding ); - rStream.WriteUniOrByteString( aFmt.GetSuffix(), eEncoding ); + rStream.WriteByteString( aFmt.GetPrefix(), eEncoding ); + rStream.WriteByteString( aFmt.GetSuffix(), eEncoding ); rStream << sal_uInt16( aFmt.GetNumAdjust() ) << aFmt.GetAbsLSpace() << aFmt.GetFirstLineOffset() << aFmt.GetCharTextDistance() << aFmt.GetLSpace() << sal_False;//aFmt.IsRelLSpace(); - rStream.WriteUniOrByteString( aName, eEncoding ); + rStream.WriteByteString( aName, eEncoding ); rStream << nFamily << nCharSet << nWidth @@ -501,7 +501,7 @@ void SwNumRulesWithName::_SwNumFmtGlobal::Store( SvStream& rStream ) << nPitch; } rStream << nCharPoolId; - rStream.WriteUniOrByteString( sCharFmtName, eEncoding ); + rStream.WriteByteString( 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 4d316708b152..e6e939bbbd1b 100644 --- a/tools/inc/tools/stream.hxx +++ b/tools/inc/tools/stream.hxx @@ -363,6 +363,11 @@ 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 ); @@ -407,12 +412,6 @@ 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 a49d382ef158..f626dcccd508 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); - write_lenPrefixed_uInt8s_FromOUString(rStrm, m_aDocName, RTL_TEXTENCODING_UTF8); + rStrm.WriteByteString (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; - m_aDocName = read_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_UTF8); + rStrm.ReadByteString (m_aDocName, 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 aab11a6ffc51..b70195978008 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -1489,7 +1489,7 @@ SvStream& SvStream::operator<< ( SvStream& rStream ) // ----------------------------------------------------------------------- -SvStream& SvStream::ReadUniOrByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet ) +SvStream& SvStream::ReadByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet ) { // read UTF-16 string directly from stream ? if (eSrcCharSet == RTL_TEXTENCODING_UNICODE) @@ -1523,7 +1523,7 @@ SvStream& SvStream::ReadUniOrByteString( UniString& rStr, rtl_TextEncoding eSrcC // ----------------------------------------------------------------------- -SvStream& SvStream::WriteUniOrByteString( const UniString& rStr, rtl_TextEncoding eDestCharSet ) +SvStream& SvStream::WriteByteString( 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 059b1fe85320..017042692225 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.ReadUniOrByteString( rImpl_Font.maFamilyName, rIStm.GetStreamCharSet() ); - rIStm.ReadUniOrByteString( rImpl_Font.maStyleName, rIStm.GetStreamCharSet() ); + rIStm.ReadByteString( rImpl_Font.maFamilyName, rIStm.GetStreamCharSet() ); + rIStm.ReadByteString( 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.WriteUniOrByteString( rImpl_Font.maFamilyName, rOStm.GetStreamCharSet() ); - rOStm.WriteUniOrByteString( rImpl_Font.maStyleName, rOStm.GetStreamCharSet() ); + rOStm.WriteByteString( rImpl_Font.maFamilyName, rOStm.GetStreamCharSet() ); + rOStm.WriteByteString( 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 8d3ef576690e..796659cfdaa5 100644 --- a/vcl/source/gdi/jobset.cxx +++ b/vcl/source/gdi/jobset.cxx @@ -334,8 +334,9 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup ) rIStream.Seek( nFirstPos + sizeof( ImplOldJobSetupData ) + 4 + sizeof( Impl364JobSetupData ) + pJobData->mnDriverDataLen ); while( rIStream.Tell() < nFirstPos + nLen ) { - String aKey = read_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); - String aValue = read_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); + String aKey, aValue; + rIStream.ReadByteString( aKey, RTL_TEXTENCODING_UTF8 ); + rIStream.ReadByteString( aValue, RTL_TEXTENCODING_UTF8 ); if( aKey.EqualsAscii( "COMPAT_DUPLEX_MODE" ) ) { if( aValue.EqualsAscii( "DUPLEX_UNKNOWN" ) ) @@ -406,8 +407,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 ) { - write_lenPrefixed_uInt8s_FromOUString(rOStream, it->first, RTL_TEXTENCODING_UTF8); - write_lenPrefixed_uInt8s_FromOUString(rOStream, it->second, RTL_TEXTENCODING_UTF8); + rOStream.WriteByteString( it->first, RTL_TEXTENCODING_UTF8 ); + rOStream.WriteByteString( 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 2fd96e835910..9961705cbb6c 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.WriteUniOrByteString( maStr, pData->meActualCharSet ); + rOStm.WriteByteString( maStr, pData->meActualCharSet ); rOStm << mnIndex; rOStm << mnLen; @@ -1278,7 +1278,7 @@ void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) { COMPAT( rIStm ); rIStm >> maPt; - rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet ); + rIStm.ReadByteString( 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.WriteUniOrByteString( maStr, pData->meActualCharSet ); + rOStm.WriteByteString( 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.ReadUniOrByteString( maStr, pData->meActualCharSet ); + rIStm.ReadByteString( 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.WriteUniOrByteString( maStr, pData->meActualCharSet ); + rOStm.WriteByteString( 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.ReadUniOrByteString( maStr, pData->meActualCharSet ); + rIStm.ReadByteString( 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.WriteUniOrByteString( maStr, pData->meActualCharSet ); + rOStm.WriteByteString( 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.ReadUniOrByteString( maStr, pData->meActualCharSet ); + rIStm.ReadByteString( 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 9cede2527aaa..6a4cabaecbfe 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 ); - 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.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 ); rOStream << rInfo.mnStatus; rOStream << rInfo.mnJobs; @@ -296,10 +296,15 @@ SvStream& operator>>( SvStream& rIStream, QueueInfo& rInfo ) { VersionCompat aCompat( rIStream, STREAM_READ ); - 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); + 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; rIStream >> rInfo.mnStatus; rIStream >> rInfo.mnJobs; diff --git a/vcl/source/gdi/rendergraphic.cxx b/vcl/source/gdi/rendergraphic.cxx index 16b08c4de17a..2077eedc4acd 100644 --- a/vcl/source/gdi/rendergraphic.cxx +++ b/vcl/source/gdi/rendergraphic.cxx @@ -192,9 +192,10 @@ void RenderGraphic::ImplGetDefaults() const ::SvStream& operator>>( ::SvStream& rIStm, RenderGraphic& rRenderGraphic ) { ::VersionCompat aVCompat( rIStm, STREAM_READ ); + String aGraphicDataMimeType; sal_uInt32 nGraphicDataLength = 0; - rtl::OUString aGraphicDataMimeType = read_lenPrefixed_uInt8s_ToOUString(rIStm, RTL_TEXTENCODING_ASCII_US); + rIStm.ReadByteString( aGraphicDataMimeType, RTL_TEXTENCODING_ASCII_US ); rIStm >> nGraphicDataLength; rRenderGraphic = RenderGraphic( aGraphicDataMimeType, nGraphicDataLength ); @@ -214,8 +215,7 @@ void RenderGraphic::ImplGetDefaults() const ::VersionCompat aVCompat( rOStm, STREAM_WRITE, 1 ); const sal_uInt32 nGraphicDataLength = rRenderGraphic.GetGraphicDataLength(); - write_lenPrefixed_uInt8s_FromOUString(rOStm, rRenderGraphic.GetGraphicDataMimeType(), - RTL_TEXTENCODING_ASCII_US); + rOStm.WriteByteString( 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 44ca911f6987..cf7941e67805 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(;;) { - aFontFileURL = read_lenPrefixed_uInt8s_ToOUString(aCacheFile, RTL_TEXTENCODING_UTF8); + aCacheFile.ReadByteString( aFontFileURL, RTL_TEXTENCODING_UTF8 ); if( !aFontFileURL.Len() ) break; - aDFA.maName = read_lenPrefixed_uInt8s_ToOUString(aCacheFile, RTL_TEXTENCODING_UTF8); + aCacheFile.ReadByteString( aDFA.maName, 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 ); - write_lenPrefixed_uInt8s_FromOUString(aCacheFile, rFontFileURL, RTL_TEXTENCODING_UTF8); - write_lenPrefixed_uInt8s_FromOUString(aCacheFile, rDFA.maName, RTL_TEXTENCODING_UTF8); + aCacheFile.WriteByteString( rFontFileURL, RTL_TEXTENCODING_UTF8 ); + aCacheFile.WriteByteString( rDFA.maName, RTL_TEXTENCODING_UTF8 ); aCacheFile << static_cast<short>(rDFA.meWeight); aCacheFile << static_cast<short>(rDFA.meItalic); @@ -205,12 +205,13 @@ ImplFontAttrCache::~ImplFontAttrCache() aCacheFile << static_cast<short>(rDFA.meFamily); aCacheFile << static_cast<short>(rDFA.mbSymbolFlag != false); - write_lenPrefixed_uInt8s_FromOUString(aCacheFile, rDFA.maStyleName, RTL_TEXTENCODING_UTF8); + aCacheFile.WriteByteStringLine( rDFA.maStyleName, RTL_TEXTENCODING_UTF8 ); ++aIter; } // EOF Marker - write_lenPrefixed_uInt8s_FromOString(aCacheFile, rtl::OString(), RTL_TEXTENCODING_UTF8); + String aEmptyStr; + aCacheFile.WriteByteString( aEmptyStr, RTL_TEXTENCODING_UTF8 ); } } } |