Kaydet (Commit) eb90c628 authored tarafından Caolán McNamara's avatar Caolán McNamara

ByteString::ConvertToUnicode->rtl::OUString::ctor::toChar

üst dd853ad6
...@@ -495,17 +495,22 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) ...@@ -495,17 +495,22 @@ int HTMLParser::ScanText( const sal_Unicode cBreak )
if( RTL_TEXTENCODING_DONTKNOW != eSrcEnc && if( RTL_TEXTENCODING_DONTKNOW != eSrcEnc &&
RTL_TEXTENCODING_UCS2 != eSrcEnc && RTL_TEXTENCODING_UCS2 != eSrcEnc &&
RTL_TEXTENCODING_UTF8 != eSrcEnc && RTL_TEXTENCODING_UTF8 != eSrcEnc &&
cChar < 256 ) cChar < 256 )
{ {
sal_Unicode cOrig = cChar; const sal_uInt32 convertFlags =
cChar = ByteString::ConvertToUnicode( RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_DEFAULT |
(sal_Char)cChar, eSrcEnc ); 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( 0U == cChar )
{ {
// If the character could not be // If the character could not be
// converted, because a conversion is not // converted, because a conversion is not
// available, do no conversion at all. // available, do no conversion at all.
cChar = cOrig; cChar = cEncodedChar;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment