diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-12-21 10:45:54 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-12-21 13:44:52 +0000 |
commit | 5c24789ca33d7b2b0c39626208cf0708fb470d95 (patch) | |
tree | a58015a4f6cafb9d567ca24831a442a4e976d972 /editeng | |
parent | c4f0efc2378cebc3b581bc949da70a2b2f149961 (diff) |
disentangle Read/WriteByteString OUString variants
The ones which use a definite 8-bit encoding read/write pascal-style
strings with a 16bit length prefix.
The ones which use a definite 16-bit encoding read/write pascal-style
UTF-16 strings with a 32bit length prefix, i.e. not ByteStrings at all
The "I dunno" ones might be UTF-16 strings or 8-bit strings, depending
on the charset. Rename to ReadUniOrByteString like the other
similar horrors to flag this misery
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 6 | ||||
-rw-r--r-- | editeng/source/items/bulitem.cxx | 12 | ||||
-rw-r--r-- | editeng/source/items/flditem.cxx | 4 | ||||
-rw-r--r-- | editeng/source/items/frmitems.cxx | 8 | ||||
-rw-r--r-- | editeng/source/items/numitem.cxx | 6 | ||||
-rw-r--r-- | editeng/source/items/textitem.cxx | 16 |
6 files changed, 26 insertions, 26 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 0fd144b42514..8435e66d923f 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -1230,7 +1230,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) pC->GetText() = rtl::OStringToOUString(aByteString, eSrcEncoding); // StyleName and Family... - rIStream.ReadByteString( pC->GetStyle(), eSrcEncoding ); + rIStream.ReadUniOrByteString( pC->GetStyle(), eSrcEncoding ); sal_uInt16 nStyleFamily; rIStream >> nStyleFamily; pC->GetFamily() = (SfxStyleFamily)nStyleFamily; @@ -1522,10 +1522,10 @@ void BinTextObject::CreateData300( SvStream& rIStream ) ContentInfo* pC = CreateAndInsertContent(); // The Text... - rIStream.ReadByteString( pC->GetText() ); + rIStream.ReadUniOrByteString( pC->GetText(), rIStream.GetStreamCharSet() ); // StyleName and Family... - rIStream.ReadByteString( pC->GetStyle() ); + rIStream.ReadUniOrByteString( pC->GetStyle(), rIStream.GetStreamCharSet() ); sal_uInt16 nStyleFamily; rIStream >> nStyleFamily; pC->GetFamily() = (SfxStyleFamily)nStyleFamily; diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index 2d0e066e4091..caca392a6d18 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -64,7 +64,7 @@ void SvxBulletItem::StoreFont( SvStream& rStream, const Font& rFont ) nTemp = (sal_uInt16)rFont.GetItalic(); rStream << nTemp; // UNICODE: rStream << rFont.GetName(); - rStream.WriteByteString(rFont.GetName()); + rStream.WriteUniOrByteString(rFont.GetName(), rStream.GetStreamCharSet()); rStream << rFont.IsOutline(); rStream << rFont.IsShadow(); @@ -94,7 +94,7 @@ Font SvxBulletItem::CreateFont( SvStream& rStream, sal_uInt16 nVer ) // UNICODE: rStream >> aName; aFont.SetName( aName ); String aName; - rStream.ReadByteString(aName); + rStream.ReadUniOrByteString(aName, rStream.GetStreamCharSet()); aFont.SetName( aName ); if( nVer == 1 ) @@ -217,10 +217,10 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) : rStrm >> nScale; // UNICODE: rStrm >> aPrevText; - rStrm.ReadByteString(aPrevText); + rStrm.ReadUniOrByteString(aPrevText, rStrm.GetStreamCharSet()); // UNICODE: rStrm >> aFollowText; - rStrm.ReadByteString(aFollowText); + rStrm.ReadUniOrByteString(aFollowText, rStrm.GetStreamCharSet()); nValidMask = 0xFFFF; } @@ -416,10 +416,10 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) c rStrm << nScale; // UNICODE: rStrm << aPrevText; - rStrm.WriteByteString(aPrevText); + rStrm.WriteUniOrByteString(aPrevText, rStrm.GetStreamCharSet()); // UNICODE: rStrm << aFollowText; - rStrm.WriteByteString(aFollowText); + rStrm.WriteUniOrByteString(aFollowText, rStrm.GetStreamCharSet()); return rStrm; } diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index 56b2d71f68fa..bafb976f057b 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -735,7 +735,7 @@ void SvxExtFileField::Load( SvPersistStream & rStm ) sal_uInt16 nType, nFormat; // UNICODE: rStm >> aFile; - rStm.ReadByteString(aFile); + rStm.ReadUniOrByteString(aFile, rStm.GetStreamCharSet()); rStm >> nType; rStm >> nFormat; @@ -749,7 +749,7 @@ void SvxExtFileField::Load( SvPersistStream & rStm ) void SvxExtFileField::Save( SvPersistStream & rStm ) { // UNICODE: rStm << aFile; - rStm.WriteByteString(aFile); + rStm.WriteUniOrByteString(aFile, rStm.GetStreamCharSet()); rStm << (sal_uInt16) eType; rStm << (sal_uInt16) eFormat; diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index addb3f630a68..18af4a61ec7b 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -3443,7 +3443,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion, { String aRel; // UNICODE: rStream >> aRel; - rStream.ReadByteString(aRel); + rStream.ReadUniOrByteString(aRel, rStream.GetStreamCharSet()); // TODO/MBA: how can we get a BaseURL here?! OSL_FAIL("No BaseURL!"); @@ -3456,7 +3456,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion, { pStrFilter = new String; // UNICODE: rStream >> *pStrFilter; - rStream.ReadByteString(*pStrFilter); + rStream.ReadUniOrByteString(*pStrFilter, rStream.GetStreamCharSet()); } rStream >> nPos; @@ -3834,12 +3834,12 @@ SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ ) // TODO/MBA: how to get a BaseURL?! String aRel = INetURLObject::GetRelURL( String(), *pStrLink ); // UNICODE: rStream << aRel; - rStream.WriteByteString(aRel); + rStream.WriteUniOrByteString(aRel, rStream.GetStreamCharSet()); } if ( pStrFilter ) { // UNICODE: rStream << *pStrFilter; - rStream.WriteByteString(*pStrFilter); + rStream.WriteUniOrByteString(*pStrFilter, rStream.GetStreamCharSet()); } rStream << (sal_Int8)eGraphicPos; return rStream; diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 8f71ff238b11..01fc4630ff23 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -219,9 +219,9 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC rStream << nCharTextDistance; rtl_TextEncoding eEnc = osl_getThreadTextEncoding(); - rStream.WriteByteString(sPrefix, eEnc); - rStream.WriteByteString(sSuffix, eEnc); - rStream.WriteByteString(sCharStyleName, eEnc); + rStream.WriteUniOrByteString(sPrefix, eEnc); + rStream.WriteUniOrByteString(sSuffix, eEnc); + rStream.WriteUniOrByteString(sCharStyleName, eEnc); if(pGraphicBrush) { rStream << (sal_uInt16)1; diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 4f5dc8dc29e6..e3069074573a 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -398,16 +398,16 @@ SvStream& SvxFontItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) co String aStoreFamilyName( GetFamilyName() ); if( bToBats ) aStoreFamilyName = String( "StarBats", sizeof("StarBats")-1, RTL_TEXTENCODING_ASCII_US ); - rStrm.WriteByteString(aStoreFamilyName); - rStrm.WriteByteString(GetStyleName()); + rStrm.WriteUniOrByteString(aStoreFamilyName, rStrm.GetStreamCharSet()); + rStrm.WriteUniOrByteString(GetStyleName(), rStrm.GetStreamCharSet()); // cach for EditEngine, only set while creating clipboard stream. if ( bEnableStoreUnicodeNames ) { sal_uInt32 nMagic = STORE_UNICODE_MAGIC_MARKER; rStrm << nMagic; - rStrm.WriteByteString( aStoreFamilyName, RTL_TEXTENCODING_UNICODE ); - rStrm.WriteByteString( GetStyleName(), RTL_TEXTENCODING_UNICODE ); + rStrm.WriteUniOrByteString( aStoreFamilyName, RTL_TEXTENCODING_UNICODE ); + rStrm.WriteUniOrByteString( GetStyleName(), RTL_TEXTENCODING_UNICODE ); } return rStrm; @@ -424,10 +424,10 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const rStrm >> eFontTextEncoding; // UNICODE: rStrm >> aName; - rStrm.ReadByteString(aName); + rStrm.ReadUniOrByteString(aName, rStrm.GetStreamCharSet()); // UNICODE: rStrm >> aStyle; - rStrm.ReadByteString(aStyle); + rStrm.ReadUniOrByteString(aStyle, rStrm.GetStreamCharSet()); // Set the "correct" textencoding eFontTextEncoding = (sal_uInt8)GetSOLoadTextEncoding( eFontTextEncoding, (sal_uInt16)rStrm.GetVersion() ); @@ -442,8 +442,8 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const rStrm >> nMagic; if ( nMagic == STORE_UNICODE_MAGIC_MARKER ) { - rStrm.ReadByteString( aName, RTL_TEXTENCODING_UNICODE ); - rStrm.ReadByteString( aStyle, RTL_TEXTENCODING_UNICODE ); + rStrm.ReadUniOrByteString( aName, RTL_TEXTENCODING_UNICODE ); + rStrm.ReadUniOrByteString( aStyle, RTL_TEXTENCODING_UNICODE ); } else { |