diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-12-14 22:52:07 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-12-15 12:22:49 +0000 |
commit | 66c3655a07e109d88183002192410bcc9866c0f2 (patch) | |
tree | 019188e9165edc40641dd5a6836e94a64529c5d7 /sc | |
parent | ace8398c5782caf6c5d9066b8e67afa652448954 (diff) |
convert ReadCString from ByteString to OString
Nobody ever checked the return value anyway, so just return the string
and use the stream state bits if necessary to find failures.
Doesn't need to be a member, make a standalone function
Rename it to read_zeroTerminated_uInt8s_AsO[U]String, stupid perhaps,
but *shrug*, unambiguous.
Drop misleading overloaded String variants use:
read_zeroTerminated_uInt8s_AsOString or
read_zeroTerminated_uInt8s_AsOUString
added a unit test, valgrinded it, found and fixed invalid read
in original implementation.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/ftools/ftools.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx index 52f848e457c4..b346295455e0 100644 --- a/sc/source/filter/ftools/ftools.cxx +++ b/sc/source/filter/ftools/ftools.cxx @@ -311,9 +311,7 @@ ByteString ScfTools::ReadCString( SvStream& rStrm, sal_Int32& rnBytesLeft ) void ScfTools::AppendCString( SvStream& rStrm, String& rString, rtl_TextEncoding eTextEnc ) { - ByteString aByteString; - rStrm.ReadCString(aByteString); - rString += String( aByteString, eTextEnc ); + rString += read_zeroTerminated_uInt8s_AsOUString(rStrm, eTextEnc); } // *** HTML table names <-> named range names *** ----------------------------- |