rework WW8ReadPString in terms of read_uInt8s_AsOString

This commit is contained in:
Caolán McNamara 2011-09-04 21:34:30 +01:00
parent 22154753ed
commit 06e1f8ad6b

View file

@ -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)