diff options
Diffstat (limited to 'basic/source/sbx/sbxvalue.cxx')
-rw-r--r-- | basic/source/sbx/sbxvalue.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index 0d6aa84e19c7..692959aa9c18 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -1479,8 +1479,8 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) case SbxSINGLE: { // Floats as ASCII - XubString aVal; - r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + XubString aVal = read_lenPrefixed_uInt8s_ToOUString(r, + RTL_TEXTENCODING_ASCII_US); double d; SbxDataType t; if( ImpScan( aVal, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE ) @@ -1495,8 +1495,8 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) case SbxDOUBLE: { // Floats as ASCII - XubString aVal; - r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + XubString aVal = read_lenPrefixed_uInt8s_ToOUString(r, + RTL_TEXTENCODING_ASCII_US); SbxDataType t; if( ImpScan( aVal, aData.nDouble, t, NULL ) != SbxERR_OK ) { @@ -1524,9 +1524,9 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) } case SbxSTRING: { - XubString aVal; - r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); - if( aVal.Len() ) + rtl::OUString aVal = read_lenPrefixed_uInt8s_ToOUString(r, + RTL_TEXTENCODING_ASCII_US); + if( aVal.getLength() ) aData.pOUString = new ::rtl::OUString( aVal ); else aData.pOUString = NULL; // JSM 1995-09-22 @@ -1621,12 +1621,12 @@ sal_Bool SbxValue::StoreData( SvStream& r ) const case SbxDATE: // #49935: Save as double, elsewise an error during the read in ((SbxValue*)this)->aData.eType = (SbxDataType)( ( nType & 0xF000 ) | SbxDOUBLE ); - r.WriteByteString( GetCoreString(), RTL_TEXTENCODING_ASCII_US ); + write_lenPrefixed_uInt8s_FromOUString(r, GetCoreString(), RTL_TEXTENCODING_ASCII_US); ((SbxValue*)this)->aData.eType = (SbxDataType)nType; break; case SbxSINGLE: case SbxDOUBLE: - r.WriteByteString( GetCoreString(), RTL_TEXTENCODING_ASCII_US ); + write_lenPrefixed_uInt8s_FromOUString(r, GetCoreString(), RTL_TEXTENCODING_ASCII_US); break; case SbxSALUINT64: case SbxSALINT64: @@ -1643,12 +1643,11 @@ sal_Bool SbxValue::StoreData( SvStream& r ) const case SbxSTRING: if( aData.pOUString ) { - r.WriteByteString( *aData.pOUString, RTL_TEXTENCODING_ASCII_US ); + write_lenPrefixed_uInt8s_FromOUString(r, *aData.pOUString, RTL_TEXTENCODING_ASCII_US); } else { - String aEmpty; - r.WriteByteString( aEmpty, RTL_TEXTENCODING_ASCII_US ); + write_lenPrefixed_uInt8s_FromOUString(r, rtl::OUString(), RTL_TEXTENCODING_ASCII_US); } break; case SbxERROR: |