diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-12-19 22:19:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-12-21 10:10:58 +0000 |
commit | d00fc0e293852cfc019ffaffa65bee327397677b (patch) | |
tree | 3b28b98fb451bee33eff7c06a93dbb4063f07554 /vcl/source/gdi/jobset.cxx | |
parent | 92f396733ebc518bcb7a9eae2dd3169d333b82b9 (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 'vcl/source/gdi/jobset.cxx')
-rw-r--r-- | vcl/source/gdi/jobset.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx index 796659cfdaa5..8d3ef576690e 100644 --- a/vcl/source/gdi/jobset.cxx +++ b/vcl/source/gdi/jobset.cxx @@ -334,9 +334,8 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup ) rIStream.Seek( nFirstPos + sizeof( ImplOldJobSetupData ) + 4 + sizeof( Impl364JobSetupData ) + pJobData->mnDriverDataLen ); while( rIStream.Tell() < nFirstPos + nLen ) { - String aKey, aValue; - rIStream.ReadByteString( aKey, RTL_TEXTENCODING_UTF8 ); - rIStream.ReadByteString( aValue, RTL_TEXTENCODING_UTF8 ); + String aKey = read_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); + String aValue = read_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); if( aKey.EqualsAscii( "COMPAT_DUPLEX_MODE" ) ) { if( aValue.EqualsAscii( "DUPLEX_UNKNOWN" ) ) @@ -407,8 +406,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 ) { - rOStream.WriteByteString( it->first, RTL_TEXTENCODING_UTF8 ); - rOStream.WriteByteString( it->second, RTL_TEXTENCODING_UTF8 ); + write_lenPrefixed_uInt8s_FromOUString(rOStream, it->first, RTL_TEXTENCODING_UTF8); + write_lenPrefixed_uInt8s_FromOUString(rOStream, it->second, RTL_TEXTENCODING_UTF8); } write_lenPrefixed_uInt8s_FromOString(rOStream, "COMPAT_DUPLEX_MODE"); switch( pJobData->meDuplexMode ) |