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 /sd | |
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 'sd')
-rw-r--r-- | sd/source/filter/html/pubdlg.cxx | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 6a9515d4f540..55714612b2df 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -267,19 +267,25 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) sal_uInt16 nTemp16; - rIn.ReadByteString( rDesign.m_aDesignName, RTL_TEXTENCODING_UTF8 ); + rDesign.m_aDesignName = read_lenPrefixed_uInt8s_ToOUString(rIn, + RTL_TEXTENCODING_UTF8); rIn >> nTemp16; rDesign.m_eMode = (HtmlPublishMode)nTemp16; rIn >> rDesign.m_bContentPage; rIn >> rDesign.m_bNotes; rIn >> rDesign.m_nResolution; - rIn.ReadByteString( rDesign.m_aCompression, RTL_TEXTENCODING_UTF8 ); + rDesign.m_aCompression = read_lenPrefixed_uInt8s_ToOUString(rIn, + RTL_TEXTENCODING_UTF8); rIn >> nTemp16; rDesign.m_eFormat = (PublishingFormat)nTemp16; - rIn.ReadByteString( rDesign.m_aAuthor, RTL_TEXTENCODING_UTF8 ); - rIn.ReadByteString( rDesign.m_aEMail, RTL_TEXTENCODING_UTF8 ); - rIn.ReadByteString( rDesign.m_aWWW, RTL_TEXTENCODING_UTF8 ); - rIn.ReadByteString( rDesign.m_aMisc, RTL_TEXTENCODING_UTF8 ); + rDesign.m_aAuthor = read_lenPrefixed_uInt8s_ToOUString(rIn, + RTL_TEXTENCODING_UTF8); + rDesign.m_aEMail = read_lenPrefixed_uInt8s_ToOUString(rIn, + RTL_TEXTENCODING_UTF8); + rDesign.m_aWWW = read_lenPrefixed_uInt8s_ToOUString(rIn, + RTL_TEXTENCODING_UTF8); + rDesign.m_aMisc = read_lenPrefixed_uInt8s_ToOUString(rIn, + RTL_TEXTENCODING_UTF8); rIn >> rDesign.m_bDownload; rIn >> rDesign.m_bCreated; // not used rIn >> rDesign.m_nButtonThema; @@ -294,8 +300,10 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) rIn >> nTemp16; rDesign.m_eScript = (PublishingScript)nTemp16; - rIn.ReadByteString( rDesign.m_aURL, RTL_TEXTENCODING_UTF8 ); - rIn.ReadByteString( rDesign.m_aCGI, RTL_TEXTENCODING_UTF8 ); + rDesign.m_aURL = read_lenPrefixed_uInt8s_ToOUString(rIn, + RTL_TEXTENCODING_UTF8); + rDesign.m_aCGI = read_lenPrefixed_uInt8s_ToOUString(rIn, + RTL_TEXTENCODING_UTF8); rIn >> rDesign.m_bAutoSlide; rIn >> rDesign.m_nSlideDuration; @@ -315,18 +323,24 @@ SvStream& operator << (SvStream& rOut, const SdPublishingDesign& rDesign) SdIOCompat aIO(rOut, STREAM_WRITE, 0); // Name - rOut.WriteByteString( rDesign.m_aDesignName, RTL_TEXTENCODING_UTF8 ); + write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aDesignName, + RTL_TEXTENCODING_UTF8); rOut << (sal_uInt16)rDesign.m_eMode; rOut << rDesign.m_bContentPage; rOut << rDesign.m_bNotes; rOut << rDesign.m_nResolution; - rOut.WriteByteString( rDesign.m_aCompression, RTL_TEXTENCODING_UTF8 ); + write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCompression, + RTL_TEXTENCODING_UTF8); rOut << (sal_uInt16)rDesign.m_eFormat; - rOut.WriteByteString( rDesign.m_aAuthor, RTL_TEXTENCODING_UTF8 ); - rOut.WriteByteString( rDesign.m_aEMail, RTL_TEXTENCODING_UTF8 ); - rOut.WriteByteString( rDesign.m_aWWW, RTL_TEXTENCODING_UTF8 ); - rOut.WriteByteString( rDesign.m_aMisc, RTL_TEXTENCODING_UTF8 ); + write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aAuthor, + RTL_TEXTENCODING_UTF8); + write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aEMail, + RTL_TEXTENCODING_UTF8); + write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aWWW, + RTL_TEXTENCODING_UTF8); + write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aMisc, + RTL_TEXTENCODING_UTF8); rOut << rDesign.m_bDownload; rOut << rDesign.m_bCreated; // not used rOut << rDesign.m_nButtonThema; @@ -340,8 +354,10 @@ SvStream& operator << (SvStream& rOut, const SdPublishingDesign& rDesign) rOut << rDesign.m_bUseColor; rOut << (sal_uInt16)rDesign.m_eScript; - rOut.WriteByteString( rDesign.m_aURL, RTL_TEXTENCODING_UTF8 ); - rOut.WriteByteString( rDesign.m_aCGI, RTL_TEXTENCODING_UTF8 ); + write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aURL, + RTL_TEXTENCODING_UTF8); + write_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCGI, + RTL_TEXTENCODING_UTF8); rOut << rDesign.m_bAutoSlide; rOut << rDesign.m_nSlideDuration; |