summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/basmgr/basmgr.cxx15
-rw-r--r--basic/source/classes/image.cxx11
-rw-r--r--basic/source/classes/sbxmod.cxx4
-rw-r--r--basic/source/runtime/methods1.cxx3
-rw-r--r--dbaccess/source/ui/tabledesign/TableRow.cxx9
-rw-r--r--editeng/source/editeng/editobj.cxx6
-rw-r--r--editeng/source/items/bulitem.cxx7
-rw-r--r--editeng/source/items/flditem.cxx2
-rw-r--r--editeng/source/items/frmitems.cxx5
-rw-r--r--editeng/source/items/textitem.cxx8
-rw-r--r--idl/source/objects/module.cxx2
-rw-r--r--sc/source/core/data/patattr.cxx2
-rw-r--r--sc/source/core/tool/autoform.cxx4
-rw-r--r--sc/source/core/tool/ddelink.cxx6
-rw-r--r--sc/source/core/tool/zforauto.cxx2
-rw-r--r--sfx2/source/appl/appmisc.cxx5
-rw-r--r--svl/source/items/poolitem.cxx5
-rw-r--r--svl/source/numbers/zformat.cxx2
-rw-r--r--svtools/source/misc/templatefoldercache.cxx6
-rw-r--r--svtools/source/misc/transfer.cxx4
-rw-r--r--svx/source/items/hlnkitem.cxx16
-rw-r--r--svx/source/items/pageitem.cxx3
-rw-r--r--sw/source/core/doc/tblafmt.cxx8
-rw-r--r--sw/source/ui/config/uinums.cxx14
-rw-r--r--tools/inc/tools/stream.hxx2
-rw-r--r--tools/source/stream/stream.cxx21
-rw-r--r--vcl/source/gdi/font.cxx4
-rw-r--r--vcl/source/gdi/metaact.cxx8
28 files changed, 83 insertions, 101 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index f452adc54d7c..3e5a0dd698b7 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -643,18 +643,15 @@ BasicLibInfo* BasicLibInfo::Create( SotStorageStream& rSStream )
pInfo->bDoLoad = bDoLoad;
// The name of the lib...
- String aName;
- rSStream.ReadUniOrByteString(aName, rSStream.GetStreamCharSet());
+ String aName = rSStream.ReadUniOrByteString(rSStream.GetStreamCharSet());
pInfo->SetLibName( aName );
// Absolute path...
- String aStorageName;
- rSStream.ReadUniOrByteString(aStorageName, rSStream.GetStreamCharSet());
+ String aStorageName = rSStream.ReadUniOrByteString(rSStream.GetStreamCharSet());
pInfo->SetStorageName( aStorageName );
// Relative path...
- String aRelStorageName;
- rSStream.ReadUniOrByteString(aRelStorageName, rSStream.GetStreamCharSet());
+ String aRelStorageName = rSStream.ReadUniOrByteString(rSStream.GetStreamCharSet());
pInfo->SetRelStorageName( aRelStorageName );
if ( nVer >= 2 )
@@ -1041,8 +1038,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
// and it proceeds ...
}
xManagerStream->Seek( nBasicEndOff+1 ); // +1: 0x00 as separator
- String aLibs;
- xManagerStream->ReadUniOrByteString(aLibs, xManagerStream->GetStreamCharSet());
+ String aLibs = xManagerStream->ReadUniOrByteString(xManagerStream->GetStreamCharSet());
xManagerStream->SetBufferSize( 0 );
xManagerStream.Clear(); // Close stream
@@ -1235,8 +1231,7 @@ sal_Bool BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurSt
*xBasicStream >> nPasswordMarker;
if ( ( nPasswordMarker == PASSWORD_MARKER ) && !xBasicStream->IsEof() )
{
- String aPassword;
- xBasicStream->ReadUniOrByteString(aPassword,
+ String aPassword = xBasicStream->ReadUniOrByteString(
xBasicStream->GetStreamCharSet());
pLibInfo->SetPassword( aPassword );
}
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 79b3765fa1fc..af93adee99af 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -147,24 +147,21 @@ sal_Bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
switch( nSign )
{
case B_NAME:
- r.ReadUniOrByteString( aName, eCharSet );
+ aName = r.ReadUniOrByteString(eCharSet);
break;
case B_COMMENT:
- r.ReadUniOrByteString( aComment, eCharSet );
+ aComment = r.ReadUniOrByteString(eCharSet );
break;
case B_SOURCE:
{
- String aTmp;
- r.ReadUniOrByteString( aTmp, eCharSet );
- aOUSource = aTmp;
+ aOUSource = r.ReadUniOrByteString(eCharSet);
break;
}
case B_EXTSOURCE:
{
for( sal_uInt16 j = 0 ; j < nCount ; j++ )
{
- String aTmp;
- r.ReadUniOrByteString( aTmp, eCharSet );
+ String aTmp = r.ReadUniOrByteString(eCharSet);
aOUSource += aTmp;
}
break;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 975ecc20a0a2..ddb47c3885df 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -2001,9 +2001,7 @@ sal_Bool SbJScriptModule::LoadData( SvStream& rStrm, sal_uInt16 nVer )
return sal_False;
// Get the source string
- String aTmp;
- rStrm.ReadUniOrByteString( aTmp, osl_getThreadTextEncoding() );
- aOUSource = aTmp;
+ aOUSource = rStrm.ReadUniOrByteString( osl_getThreadTextEncoding() );
return sal_True;
}
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 5b25252a780d..0c863ef0e0c5 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -1106,8 +1106,7 @@ sal_Bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm,
case SbxSTRING:
case SbxLPSTR:
{
- String aStr;
- pStrm->ReadUniOrByteString( aStr, osl_getThreadTextEncoding() );
+ String aStr = pStrm->ReadUniOrByteString(osl_getThreadTextEncoding());
rVar.PutString( aStr );
}
break;
diff --git a/dbaccess/source/ui/tabledesign/TableRow.cxx b/dbaccess/source/ui/tabledesign/TableRow.cxx
index 35be52c28521..2ed54512ebe4 100644
--- a/dbaccess/source/ui/tabledesign/TableRow.cxx
+++ b/dbaccess/source/ui/tabledesign/TableRow.cxx
@@ -169,13 +169,12 @@ namespace dbaui
{
OFieldDescription* pFieldDesc = new OFieldDescription();
_rRow.m_pActFieldDescr = pFieldDesc;
- String sValue;
- _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
+ String sValue = _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
pFieldDesc->SetName(sValue);
- _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
+ sValue = _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
pFieldDesc->SetDescription(sValue);
- _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
+ sValue = _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
pFieldDesc->SetHelpText(sValue);
_rStr >> nValue;
@@ -190,7 +189,7 @@ namespace dbaui
break;
}
case 2:
- _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
+ sValue = _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
aControlDefault <<= ::rtl::OUString(sValue);
break;
}
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index f039b1245b02..b4555d8123f0 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 );
+ pC->GetStyle() = rIStream.ReadUniOrByteString(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() );
+ pC->GetText() = rIStream.ReadUniOrByteString(rIStream.GetStreamCharSet());
// StyleName and Family...
- rIStream.ReadUniOrByteString( pC->GetStyle(), rIStream.GetStreamCharSet() );
+ pC->GetStyle() = rIStream.ReadUniOrByteString(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 106a5abd6238..b47a8e1ba372 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -93,8 +93,7 @@ Font SvxBulletItem::CreateFont( SvStream& rStream, sal_uInt16 nVer )
rStream >> nTemp; aFont.SetItalic((FontItalic)nTemp);
// UNICODE: rStream >> aName; aFont.SetName( aName );
- String aName;
- rStream.ReadUniOrByteString(aName, rStream.GetStreamCharSet());
+ String aName = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
aFont.SetName( aName );
if( nVer == 1 )
@@ -166,10 +165,10 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) :
rStrm >> nScale;
// UNICODE: rStrm >> aPrevText;
- rStrm.ReadUniOrByteString(aPrevText, rStrm.GetStreamCharSet());
+ aPrevText = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aFollowText;
- rStrm.ReadUniOrByteString(aFollowText, rStrm.GetStreamCharSet());
+ aFollowText = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
nValidMask = 0xFFFF;
}
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index bafb976f057b..f1bfbd2baead 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());
+ aFile = rStm.ReadUniOrByteString(rStm.GetStreamCharSet());
rStm >> nType;
rStm >> nFormat;
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index ee8b297d6f76..a196a1e53a54 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3441,9 +3441,8 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
if ( nDoLoad & LOAD_LINK )
{
- String aRel;
// UNICODE: rStream >> aRel;
- rStream.ReadUniOrByteString(aRel, rStream.GetStreamCharSet());
+ String aRel = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
// TODO/MBA: how can we get a BaseURL here?!
OSL_FAIL("No BaseURL!");
@@ -3456,7 +3455,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
{
pStrFilter = new String;
// UNICODE: rStream >> *pStrFilter;
- rStream.ReadUniOrByteString(*pStrFilter, rStream.GetStreamCharSet());
+ *pStrFilter = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
}
rStream >> nPos;
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 374655db38ad..e0117a59e908 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -424,10 +424,10 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const
rStrm >> eFontTextEncoding;
// UNICODE: rStrm >> aName;
- rStrm.ReadUniOrByteString(aName, rStrm.GetStreamCharSet());
+ aName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aStyle;
- rStrm.ReadUniOrByteString(aStyle, rStrm.GetStreamCharSet());
+ aStyle = rStrm.ReadUniOrByteString(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.ReadUniOrByteString( aName, RTL_TEXTENCODING_UNICODE );
- rStrm.ReadUniOrByteString( aStyle, RTL_TEXTENCODING_UNICODE );
+ aName = rStrm.ReadUniOrByteString( RTL_TEXTENCODING_UNICODE );
+ aStyle = rStrm.ReadUniOrByteString( RTL_TEXTENCODING_UNICODE );
}
else
{
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index c91531613506..7a8a943f806d 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() );
+ aIdlFileName = rStm.ReadUniOrByteString( rStm.GetStreamCharSet() );
aHelpFileName.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm));
aSlotIdFile.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm));
aModulePrefix.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm));
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 93adcfeea75e..6de3e0a26741 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() );
+ *pStr = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
rStream >> eFamDummy; // wg. altem Dateiformat
}
else
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index c938a1796c6b..d6c3a682b033 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -803,7 +803,7 @@ sal_Bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersion
RTL_TEXTENCODING_UTF8);
}
else
- rStream.ReadUniOrByteString( aName, rStream.GetStreamCharSet() );
+ aName = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
if( AUTOFORMAT_DATA_ID_552 <= nVer )
{
@@ -844,7 +844,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() );
+ aName = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
sal_Bool b;
rStream >> b; bIncludeFont = b;
rStream >> b; bIncludeJustify = b;
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index ce67bb7cda4b..c53e739821e2 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -93,9 +93,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 );
+ aAppl = rStream.ReadUniOrByteString( eCharSet );
+ aTopic = rStream.ReadUniOrByteString( eCharSet );
+ aItem = rStream.ReadUniOrByteString( eCharSet );
sal_Bool bHasValue;
rStream >> bHasValue;
diff --git a/sc/source/core/tool/zforauto.cxx b/sc/source/core/tool/zforauto.cxx
index 048c981df3bf..d3ddf047857f 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 );
+ sFormatstring = rStream.ReadUniOrByteString( eByteStrSet );
rStream >> nSysLang >> nLang;
eLnge = (LanguageType) nLang;
eSysLnge = (LanguageType) nSysLang;
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index 0ec2e702bf00..1e62b634e6b5 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -190,8 +190,7 @@ std::vector<sal_uInt16>* SfxApplication::GetDisabledSlotList_Impl()
if( bSlots && bSlotsEnabled )
{
// Read Slot file
- String aTitle;
- pStream->ReadUniOrByteString(aTitle, pStream->GetStreamCharSet());
+ String aTitle = pStream->ReadUniOrByteString(pStream->GetStreamCharSet());
if ( aTitle.CompareToAscii("SfxSlotFile" ) == COMPARE_EQUAL )
{
sal_uInt16 nCount;
@@ -206,7 +205,7 @@ std::vector<sal_uInt16>* SfxApplication::GetDisabledSlotList_Impl()
pList->push_back( nSlot );
}
- pStream->ReadUniOrByteString(aTitle, pStream->GetStreamCharSet());
+ aTitle = pStream->ReadUniOrByteString(pStream->GetStreamCharSet());
if ( aTitle.CompareToAscii("END" ) != COMPARE_EQUAL || pStream->GetError() )
{
// Read failed
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index 8970688be602..05ed277832b4 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());
+ rString = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
return rStream.GetError() == ERRCODE_NONE;
}
@@ -204,8 +204,7 @@ void SfxPoolItem::writeByteString(SvStream & rStream,
bool SfxPoolItem::readUnicodeString(SvStream & rStream, UniString & rString,
bool bUnicode)
{
- rStream.ReadUniOrByteString(rString,
- bUnicode ? RTL_TEXTENCODING_UCS2 :
+ rString = rStream.ReadUniOrByteString(bUnicode ? RTL_TEXTENCODING_UCS2 :
rStream.GetStreamCharSet());
return rStream.GetError() == ERRCODE_NONE;
}
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 8457f5b58c27..13c4ab901eff 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -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() );
+ sColorName = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
rLoadedColorName = sColorName;
pColor = rSc.GetColor(sColorName);
}
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index ccf74ec2dafa..c4deeecfd763 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -417,8 +417,7 @@ namespace svt
// initialize them with their (local) names
while ( nChildren-- )
{
- String sURL;
- m_rStorage.ReadUniOrByteString( sURL, m_rStorage.GetStreamCharSet() );
+ String sURL = m_rStorage.ReadUniOrByteString(m_rStorage.GetStreamCharSet());
sURL = m_xOfficeInstDirs->makeAbsoluteURL( sURL );
INetURLObject aChildURL( sURL );
rChildren.push_back( new TemplateContent( aChildURL ) );
@@ -735,8 +734,7 @@ namespace svt
m_aPreviousState.reserve( nRootDirectories );
while ( nRootDirectories-- )
{
- String sURL;
- m_pCacheStream->ReadUniOrByteString( sURL, m_pCacheStream->GetStreamCharSet() );
+ String sURL = m_pCacheStream->ReadUniOrByteString(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 c8158d19b52a..6faa7e55dfe4 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() );
+ rObjDesc.maTypeName = rIStm.ReadUniOrByteString(osl_getThreadTextEncoding());
+ rObjDesc.maDisplayName = rIStm.ReadUniOrByteString(osl_getThreadTextEncoding());
rIStm >> nSig1 >> nSig2;
rObjDesc.mnViewAspect = static_cast< sal_uInt16 >( nViewAspect );
diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx
index 1f6dfa83a794..bc663b26a6aa 100644
--- a/svx/source/items/hlnkitem.cxx
+++ b/svx/source/items/hlnkitem.cxx
@@ -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());
+ pNew->sName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> pNew->sURL;
- rStrm.ReadUniOrByteString(pNew->sURL, rStrm.GetStreamCharSet());
+ pNew->sURL = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> pNew->sTarget;
- rStrm.ReadUniOrByteString(pNew->sTarget, rStrm.GetStreamCharSet());
+ pNew->sTarget = rStrm.ReadUniOrByteString(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.ReadUniOrByteString(pNew->sIntName, rStrm.GetStreamCharSet());
+ pNew->sIntName = rStrm.ReadUniOrByteString(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.ReadUniOrByteString(aLibName, rStrm.GetStreamCharSet());
+ aLibName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aMacName;
- rStrm.ReadUniOrByteString(aMacName, rStrm.GetStreamCharSet());
+ aMacName = rStrm.ReadUniOrByteString(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.ReadUniOrByteString(aLibName, rStrm.GetStreamCharSet());
+ aLibName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aMacName;
- rStrm.ReadUniOrByteString(aMacName, rStrm.GetStreamCharSet());
+ aMacName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
rStrm >> nScriptType;
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index 7dcffd0c9dd4..b67d01fe99dd 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -245,13 +245,12 @@ bool SvxPageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
SfxPoolItem* SvxPageItem::Create( SvStream& rStream, sal_uInt16 ) const
{
- XubString sStr;
sal_uInt8 eType;
sal_Bool bLand;
sal_uInt16 nUse;
// UNICODE: rStream >> sStr;
- rStream.ReadUniOrByteString( sStr, rStream.GetStreamCharSet() );
+ XubString sStr = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
rStream >> eType;
rStream >> bLand;
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 4ecbd2abe185..1fdb6426b8e6 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -401,8 +401,8 @@ 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 )
- >> eSys >> eLge;
+ sNumFmtString = rStream.ReadUniOrByteString( eCharSet );
+ rStream >> eSys >> eLge;
eSysLanguage = (LanguageType) eSys;
eNumFmtLanguage = (LanguageType) eLge;
if ( eSysLanguage == LANGUAGE_SYSTEM ) // von alten Versionen (Calc)
@@ -780,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.ReadUniOrByteString( aName, eCharSet );
+ aName = rStream.ReadUniOrByteString( eCharSet );
if( AUTOFORMAT_DATA_ID_552 <= nVal )
{
rStream >> nStrResId;
@@ -830,7 +830,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() );
+ aName = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
rStream >> b; bInclFont = b;
rStream >> b; bInclJustify = b;
rStream >> b; bInclFrame = b;
diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx
index c43a2f4ed99b..0079b1f2c2bb 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);
+ aName = rStream.ReadUniOrByteString(eEncoding);
char c;
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);
+ sStr = rStream.ReadUniOrByteString(eEncoding);
aFmt.SetPrefix( sStr );
- rStream.ReadUniOrByteString(sStr, eEncoding);
+ sStr = rStream.ReadUniOrByteString(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);
+ sStr = rStream.ReadUniOrByteString(eEncoding);
aFmt.SetPrefix( sStr );
- rStream.ReadUniOrByteString(sStr, eEncoding);
+ sStr = rStream.ReadUniOrByteString(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);
+ aName = rStream.ReadUniOrByteString(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);
+ sCharFmtName = rStream.ReadUniOrByteString(eEncoding);
rStream >> nItemCount;
while( nItemCount-- )
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 0ef6140007d1..52ae39498154 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -409,7 +409,7 @@ public:
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 );
+ String ReadUniOrByteString(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 );
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 8e2cbb0646e2..1b31103b0e03 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1489,36 +1489,37 @@ SvStream& SvStream::operator<< ( SvStream& rStream )
// -----------------------------------------------------------------------
-SvStream& SvStream::ReadUniOrByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet )
+String SvStream::ReadUniOrByteString( rtl_TextEncoding eSrcCharSet )
{
// read UTF-16 string directly from stream ?
if (eSrcCharSet == RTL_TEXTENCODING_UNICODE)
{
- sal_uInt32 nLen;
+ String aStr;
+ sal_uInt32 nLen(0);
operator>> (nLen);
if (nLen)
{
- if (nLen > STRING_MAXLEN) {
+ if (nLen > STRING_MAXLEN)
+ {
SetError(SVSTREAM_GENERALERROR);
- return *this;
+ return aStr;
}
- sal_Unicode *pStr = rStr.AllocBuffer(
+ sal_Unicode *pStr = aStr.AllocBuffer(
static_cast< xub_StrLen >(nLen));
BOOST_STATIC_ASSERT(STRING_MAXLEN <= SAL_MAX_SIZE / 2);
Read( pStr, nLen << 1 );
if (bSwap)
+ {
for (sal_Unicode *pEnd = pStr + nLen; pStr < pEnd; pStr++)
SwapUShort(*pStr);
+ }
}
- else
- rStr.Erase();
- return *this;
+ return aStr;
}
- rStr = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(*this, eSrcCharSet);
- return *this;
+ return read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(*this, eSrcCharSet);
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 059b1fe85320..a80c4c7e3bdc 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() );
+ rImpl_Font.maFamilyName = rIStm.ReadUniOrByteString(rIStm.GetStreamCharSet());
+ rImpl_Font.maStyleName = rIStm.ReadUniOrByteString(rIStm.GetStreamCharSet());
rIStm >> rImpl_Font.maSize;
rIStm >> nTmp16; rImpl_Font.meCharSet = (rtl_TextEncoding) nTmp16;
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 74881f6fdc58..6589f504e5df 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1278,7 +1278,7 @@ void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
rIStm >> maPt;
- rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
+ maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
rIStm >> mnIndex;
rIStm >> mnLen;
@@ -1435,7 +1435,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
COMPAT( rIStm );
rIStm >> maStartPt;
- rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
+ maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
rIStm >> mnIndex;
rIStm >> mnLen;
rIStm >> nAryLen;
@@ -1575,7 +1575,7 @@ void MetaStretchTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
rIStm >> maPt;
- rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
+ maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
rIStm >> mnWidth;
rIStm >> mnIndex;
rIStm >> mnLen;
@@ -1668,7 +1668,7 @@ void MetaTextRectAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
rIStm >> maRect;
- rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
+ maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
rIStm >> mnStyle;
if ( aCompat.GetVersion() >= 2 ) // Version 2