summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-12-14 22:52:07 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-12-15 12:22:49 +0000
commit66c3655a07e109d88183002192410bcc9866c0f2 (patch)
tree019188e9165edc40641dd5a6836e94a64529c5d7 /sw
parentdrop unused ReadCString with hidden StreamCharSet monstrosity (diff)
downloadcore-66c3655a07e109d88183002192410bcc9866c0f2.tar.gz
core-66c3655a07e109d88183002192410bcc9866c0f2.zip
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 'sw')
-rwxr-xr-xsw/source/ui/dochdl/swdtflvr.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index e5fdd55a98fc..f9bb431670f0 100755
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -1993,9 +1993,9 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
} // report useful error!!
rtl_TextEncoding eEncoding = DDE_TXT_ENCODING;
- xStrm->ReadCString( aApp, eEncoding );
- xStrm->ReadCString( aTopic, eEncoding );
- xStrm->ReadCString( aItem, eEncoding );
+ aApp = read_zeroTerminated_uInt8s_AsOUString(*xStrm, eEncoding);
+ aTopic = read_zeroTerminated_uInt8s_AsOUString(*xStrm, eEncoding);
+ aItem = read_zeroTerminated_uInt8s_AsOUString(*xStrm, eEncoding);
}
String aCmd;