From 5c24789ca33d7b2b0c39626208cf0708fb470d95 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 21 Dec 2011 10:45:54 +0000 Subject: 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 --- svx/source/items/hlnkitem.cxx | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'svx/source/items/hlnkitem.cxx') diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx index 11a26aa04d49..1f6dfa83a794 100644 --- a/svx/source/items/hlnkitem.cxx +++ b/svx/source/items/hlnkitem.cxx @@ -49,13 +49,13 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ { // store 'simple' data // UNICODE: rStrm << sName; - rStrm.WriteByteString(sName); + rStrm.WriteUniOrByteString(sName, rStrm.GetStreamCharSet()); // UNICODE: rStrm << sURL; - rStrm.WriteByteString(sURL); + rStrm.WriteUniOrByteString(sURL, rStrm.GetStreamCharSet()); // UNICODE: rStrm << sTarget; - rStrm.WriteByteString(sTarget); + rStrm.WriteUniOrByteString(sTarget, rStrm.GetStreamCharSet()); rStrm << (sal_uInt32) eType; @@ -64,7 +64,7 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ // new data // UNICODE: rStrm << sIntName; - rStrm.WriteByteString(sIntName); + rStrm.WriteUniOrByteString(sIntName, rStrm.GetStreamCharSet()); // macro-events rStrm << nMacroEvents; @@ -91,10 +91,10 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ rStrm << (sal_uInt16)pMacroTable->GetCurKey(); // UNICODE: rStrm << pMac->GetLibName(); - rStrm.WriteByteString(pMac->GetLibName()); + rStrm.WriteUniOrByteString(pMac->GetLibName(), rStrm.GetStreamCharSet()); // UNICODE: rStrm << pMac->GetMacName(); - rStrm.WriteByteString(pMac->GetMacName()); + rStrm.WriteUniOrByteString(pMac->GetMacName(), rStrm.GetStreamCharSet()); } } } @@ -111,10 +111,10 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ rStrm << (sal_uInt16)pMacroTable->GetCurKey(); // UNICODE: rStrm << pMac->GetLibName(); - rStrm.WriteByteString(pMac->GetLibName()); + rStrm.WriteUniOrByteString(pMac->GetLibName(), rStrm.GetStreamCharSet()); // UNICODE: rStrm << pMac->GetMacName(); - rStrm.WriteByteString(pMac->GetMacName()); + rStrm.WriteUniOrByteString(pMac->GetMacName(), rStrm.GetStreamCharSet()); rStrm << (sal_uInt16)pMac->GetScriptType(); } @@ -131,13 +131,13 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer // simple data-types // UNICODE: rStrm >> pNew->sName; - rStrm.ReadByteString(pNew->sName); + rStrm.ReadUniOrByteString(pNew->sName, rStrm.GetStreamCharSet()); // UNICODE: rStrm >> pNew->sURL; - rStrm.ReadByteString(pNew->sURL); + rStrm.ReadUniOrByteString(pNew->sURL, rStrm.GetStreamCharSet()); // UNICODE: rStrm >> pNew->sTarget; - rStrm.ReadByteString(pNew->sTarget); + rStrm.ReadUniOrByteString(pNew->sTarget, rStrm.GetStreamCharSet()); rStrm >> nType; pNew->eType = (SvxLinkInsertMode) nType; @@ -149,7 +149,7 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer { // new data // UNICODE: rStrm >> pNew->sIntName; - rStrm.ReadByteString(pNew->sIntName); + rStrm.ReadUniOrByteString(pNew->sIntName, rStrm.GetStreamCharSet()); // macro-events rStrm >> pNew->nMacroEvents; @@ -164,10 +164,10 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer rStrm >> nCurKey; // UNICODE: rStrm >> aLibName; - rStrm.ReadByteString(aLibName); + rStrm.ReadUniOrByteString(aLibName, rStrm.GetStreamCharSet()); // UNICODE: rStrm >> aMacName; - rStrm.ReadByteString(aMacName); + rStrm.ReadUniOrByteString(aMacName, rStrm.GetStreamCharSet()); pNew->SetMacro( nCurKey, SvxMacro( aMacName, aLibName, STARBASIC ) ); } @@ -181,10 +181,10 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer rStrm >> nCurKey; // UNICODE: rStrm >> aLibName; - rStrm.ReadByteString(aLibName); + rStrm.ReadUniOrByteString(aLibName, rStrm.GetStreamCharSet()); // UNICODE: rStrm >> aMacName; - rStrm.ReadByteString(aMacName); + rStrm.ReadUniOrByteString(aMacName, rStrm.GetStreamCharSet()); rStrm >> nScriptType; -- cgit