diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-08-07 21:39:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-08-08 13:04:47 +0100 |
commit | eb90c628840d47ab9a72a81c3e7e3faf7b6619cf (patch) | |
tree | e55f6a96d8076abb870551cbe09ec9e3a0f4ae61 /svtools | |
parent | dd853ad626ddaff20a2d418f99279aa931b90c97 (diff) |
ByteString::ConvertToUnicode->rtl::OUString::ctor::toChar
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/svhtml/parhtml.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index acb8635cb536..0a1513134e54 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -495,17 +495,22 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) if( RTL_TEXTENCODING_DONTKNOW != eSrcEnc && RTL_TEXTENCODING_UCS2 != eSrcEnc && RTL_TEXTENCODING_UTF8 != eSrcEnc && - cChar < 256 ) + cChar < 256 ) { - sal_Unicode cOrig = cChar; - cChar = ByteString::ConvertToUnicode( - (sal_Char)cChar, eSrcEnc ); + const sal_uInt32 convertFlags = + RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_DEFAULT | + RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT | + RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT | + RTL_TEXTTOUNICODE_FLAGS_FLUSH; + + sal_Char cEncodedChar = static_cast<sal_Char>(cChar); + cChar = rtl::OUString(&cEncodedChar, 1, eSrcEnc, convertFlags).toChar(); if( 0U == cChar ) { // If the character could not be // converted, because a conversion is not // available, do no conversion at all. - cChar = cOrig; + cChar = cEncodedChar; } } } |