[Libreoffice-commits] .: 2 commits - starmath/inc starmath/source sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Aug 5 02:04:44 PDT 2011
starmath/inc/parse.hxx | 2 +-
starmath/source/parse.cxx | 2 +-
sw/source/filter/rtf/rtffld.cxx | 22 +++++++++++-----------
3 files changed, 13 insertions(+), 13 deletions(-)
New commits:
commit 877533dbae1ea84f32760a3d56e698c27ed8d0f4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 4 22:37:27 2011 +0100
convert deprecated ConvertToUnicode to rtl::OUString
diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx
index f5d9058..f346a06 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<sal_Unicode>(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<const sal_Char*>(&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<sal_Unicode>('\x0a'));
break;
default:
SvxRTFParser::NextToken( nToken );
commit 403784edfedcaf57fea131be04f66cd0f2277f24
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Aug 4 21:18:00 2011 +0100
definition and use inside same debug level
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index 8f6c612..1d9c4b8 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -217,7 +217,7 @@ class SmParser
SmParser & operator = (const SmParser &);
protected:
-#if OSL_DEBUG_LEVEL
+#if OSL_DEBUG_LEVEL > 1
bool IsDelimiter( const String &rTxt, xub_StrLen nPos );
#endif
void NextToken();
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 2a678d0..9a7dc66 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -333,7 +333,7 @@ const SmTokenTableEntry * SmParser::GetTokenTableEntry( const String &rName )
///////////////////////////////////////////////////////////////////////////
-#if OSL_DEBUG_LEVEL
+#if OSL_DEBUG_LEVEL > 1
bool SmParser::IsDelimiter( const String &rTxt, xub_StrLen nPos )
// returns 'true' iff cChar is '\0' or a delimeter
More information about the Libreoffice-commits
mailing list