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

convert (ugly) WriteUniOrByteString to rtl::OUString

üst 5daa649c
...@@ -410,7 +410,7 @@ public: ...@@ -410,7 +410,7 @@ public:
rtl::OUString ReadUniOrByteString(rtl_TextEncoding eSrcCharSet); rtl::OUString ReadUniOrByteString(rtl_TextEncoding eSrcCharSet);
/// Write a 32bit length prefixed sequence of utf-16 if eSrcCharSet==RTL_TEXTENCODING_UNICODE, /// Write a 32bit length prefixed sequence of utf-16 if eSrcCharSet==RTL_TEXTENCODING_UNICODE,
/// otherwise convert to eSrcCharSet and write a 16bit length prefixed sequence of bytes /// otherwise convert to eSrcCharSet and write a 16bit length prefixed sequence of bytes
SvStream& WriteUniOrByteString( const UniString& rStr, rtl_TextEncoding eDestCharSet ); SvStream& WriteUniOrByteString( const rtl::OUString& rStr, rtl_TextEncoding eDestCharSet );
/// Read a line of Unicode if eSrcCharSet==RTL_TEXTENCODING_UNICODE, /// Read a line of Unicode if eSrcCharSet==RTL_TEXTENCODING_UNICODE,
/// otherwise read a line of Bytecode and convert from eSrcCharSet /// otherwise read a line of Bytecode and convert from eSrcCharSet
sal_Bool ReadUniOrByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSet ); sal_Bool ReadUniOrByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSet );
......
...@@ -1414,18 +1414,18 @@ rtl::OUString SvStream::ReadUniOrByteString( rtl_TextEncoding eSrcCharSet ) ...@@ -1414,18 +1414,18 @@ rtl::OUString SvStream::ReadUniOrByteString( rtl_TextEncoding eSrcCharSet )
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
SvStream& SvStream::WriteUniOrByteString( const UniString& rStr, rtl_TextEncoding eDestCharSet ) SvStream& SvStream::WriteUniOrByteString( const rtl::OUString& rStr, rtl_TextEncoding eDestCharSet )
{ {
// write UTF-16 string directly into stream ? // write UTF-16 string directly into stream ?
if (eDestCharSet == RTL_TEXTENCODING_UNICODE) if (eDestCharSet == RTL_TEXTENCODING_UNICODE)
{ {
sal_uInt32 nLen = rStr.Len(); sal_Int32 nLen = rStr.getLength();
operator<< (nLen); operator<< (nLen);
if (nLen) if (nLen)
{ {
if (bSwap) if (bSwap)
{ {
const sal_Unicode *pStr = rStr.GetBuffer(); const sal_Unicode *pStr = rStr.getStr();
const sal_Unicode *pEnd = pStr + nLen; const sal_Unicode *pEnd = pStr + nLen;
for (; pStr < pEnd; pStr++) for (; pStr < pEnd; pStr++)
...@@ -1436,7 +1436,7 @@ SvStream& SvStream::WriteUniOrByteString( const UniString& rStr, rtl_TextEncodin ...@@ -1436,7 +1436,7 @@ SvStream& SvStream::WriteUniOrByteString( const UniString& rStr, rtl_TextEncodin
} }
} }
else else
Write( rStr.GetBuffer(), nLen << 1 ); Write( rStr.getStr(), nLen << 1 );
} }
return *this; return *this;
......
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