From 877533dbae1ea84f32760a3d56e698c27ed8d0f4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 4 Aug 2011 22:37:27 +0100 Subject: convert deprecated ConvertToUnicode to rtl::OUString --- sw/source/filter/rtf/rtffld.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx index f5d90588ec..f346a06cb9 100644 --- a/sw/source/filter/rtf/rtffld.cxx +++ b/sw/source/filter/rtf/rtffld.cxx @@ -891,7 +891,7 @@ void SwRTFParser::ReadXEField() { bReadSwFly = false; //#it may be that any uses of this need to be removed and replaced int nNumOpenBrakets = 1; - String sFieldStr; + rtl::OUStringBuffer sFieldStr; sal_uInt8 cCh; int nToken; @@ -903,9 +903,9 @@ void SwRTFParser::ReadXEField() { --nNumOpenBrakets; - if( sFieldStr.Len()) + if (sFieldStr.getLength()) { - String sXE(sFieldStr); + String sXE(sFieldStr.makeStringAndClear()); sXE.Insert('\"', 0); sXE.Append('\"'); @@ -921,8 +921,6 @@ void SwRTFParser::ReadXEField() } sw::ms::ImportXE(*pDoc, *pPam, sXE); - - sFieldStr.Erase(); } } break; @@ -948,9 +946,9 @@ void SwRTFParser::ReadXEField() case RTF_U: { if( nTokenValue ) - sFieldStr += (sal_Unicode)nTokenValue; + sFieldStr.append(static_cast(nTokenValue)); else - sFieldStr += aToken; + sFieldStr.append(aToken); } break; @@ -965,13 +963,15 @@ void SwRTFParser::ReadXEField() case RTF_LDBLQUOTE: cCh = 147; goto INSINGLECHAR; case RTF_RDBLQUOTE: cCh = 148; goto INSINGLECHAR; INSINGLECHAR: - sFieldStr += ByteString::ConvertToUnicode( cCh, - RTL_TEXTENCODING_MS_1252 ); + //convert single byte from MS1252 to unicode and append + sFieldStr.append(rtl::OUString( + reinterpret_cast(&cCh), 1, + RTL_TEXTENCODING_MS_1252)); break; // kein Break, aToken wird als Text gesetzt case RTF_TEXTTOKEN: - sFieldStr += aToken; + sFieldStr.append(aToken); break; case RTF_BKMK_KEY: @@ -983,7 +983,7 @@ INSINGLECHAR: break; case RTF_PAR: - sFieldStr.Append('\x0a'); + sFieldStr.append(static_cast('\x0a')); break; default: SvxRTFParser::NextToken( nToken ); -- cgit v1.2.3