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 /vcl/win | |
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 'vcl/win')
-rw-r--r-- | vcl/win/source/gdi/salgdi3.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index cf7941e67805..44ca911f6987 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -160,10 +160,10 @@ ImplFontAttrCache::ImplFontAttrCache( const String& rFileNameURL, const String& ImplDevFontAttributes aDFA; for(;;) { - aCacheFile.ReadByteString( aFontFileURL, RTL_TEXTENCODING_UTF8 ); + aFontFileURL = read_lenPrefixed_uInt8s_ToOUString(aCacheFile, RTL_TEXTENCODING_UTF8); if( !aFontFileURL.Len() ) break; - aCacheFile.ReadByteString( aDFA.maName, RTL_TEXTENCODING_UTF8 ); + aDFA.maName = read_lenPrefixed_uInt8s_ToOUString(aCacheFile, RTL_TEXTENCODING_UTF8); short n; aCacheFile >> n; aDFA.meWeight = static_cast<FontWeight>(n); @@ -195,8 +195,8 @@ ImplFontAttrCache::~ImplFontAttrCache() { const String rFontFileURL( (*aIter).first ); const ImplDevFontAttributes& rDFA( (*aIter).second ); - aCacheFile.WriteByteString( rFontFileURL, RTL_TEXTENCODING_UTF8 ); - aCacheFile.WriteByteString( rDFA.maName, RTL_TEXTENCODING_UTF8 ); + write_lenPrefixed_uInt8s_FromOUString(aCacheFile, rFontFileURL, RTL_TEXTENCODING_UTF8); + write_lenPrefixed_uInt8s_FromOUString(aCacheFile, rDFA.maName, RTL_TEXTENCODING_UTF8); aCacheFile << static_cast<short>(rDFA.meWeight); aCacheFile << static_cast<short>(rDFA.meItalic); @@ -205,13 +205,12 @@ ImplFontAttrCache::~ImplFontAttrCache() aCacheFile << static_cast<short>(rDFA.meFamily); aCacheFile << static_cast<short>(rDFA.mbSymbolFlag != false); - aCacheFile.WriteByteStringLine( rDFA.maStyleName, RTL_TEXTENCODING_UTF8 ); + write_lenPrefixed_uInt8s_FromOUString(aCacheFile, rDFA.maStyleName, RTL_TEXTENCODING_UTF8); ++aIter; } // EOF Marker - String aEmptyStr; - aCacheFile.WriteByteString( aEmptyStr, RTL_TEXTENCODING_UTF8 ); + write_lenPrefixed_uInt8s_FromOString(aCacheFile, rtl::OString(), RTL_TEXTENCODING_UTF8); } } } |