summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-09-04 21:34:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-09-05 10:54:20 +0100
commit06e1f8ad6b35f93c478679e624301cd2c09159cf (patch)
tree7e6e018cb57a341c3d25d60fdb109c209d162fff /sw
parent22154753edb1eaa7199d9dc7d630dd4e409bbdb7 (diff)
rework WW8ReadPString in terms of read_uInt8s_AsOString
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx16
1 files changed, 3 insertions, 13 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index fb3a8f9027ad..d93a3c2aa0c8 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1914,25 +1914,15 @@ Err:
String WW8ReadPString(SvStream& rStrm, rtl_TextEncoding eEnc,
bool bAtEndSeekRel1)
{
- ByteString aByteStr;
- sal_uInt8 b;
+ sal_uInt8 b(0);
rStrm >> b;
- if (b)
- {
- // Alloc methode automatically sets Zero at the end
- sal_Char* pByteData = aByteStr.AllocBuffer( b );
-
- sal_uLong nWasRead = rStrm.Read( pByteData, b );
- if( nWasRead != b )
- aByteStr.ReleaseBufferAccess(static_cast<xub_StrLen>(nWasRead));
- }
+ rtl::OString aByteStr = read_uInt8s_AsOString(rStrm, b);
if( bAtEndSeekRel1 )
rStrm.SeekRel( 1 ); // ueberspringe das Null-Byte am Ende.
-
- return String( aByteStr, eEnc );
+ return rtl::OStringToOUString(aByteStr, eEnc);
}
String WW8Read_xstz(SvStream& rStrm, sal_uInt16 nChars, bool bAtEndSeekRel1)