diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-23 22:58:03 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-24 16:53:55 +0000 |
commit | 5f662f2540e02487396d0ef0d97325d9a1fa8960 (patch) | |
tree | 54e2d7ad0513e7fe70c2c1efa8276035d56e0e49 /tools/source/stream | |
parent | 04d58ef75a5e6fd7066fcfd257d907f52e4de5a7 (diff) |
all direct OUString readers are current little endian streams
Diffstat (limited to 'tools/source/stream')
-rw-r--r-- | tools/source/stream/stream.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 5e48f42b2e6b..11cfe33e766c 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -2370,8 +2370,8 @@ rtl::OString read_uInt8s_ToOString(SvStream& rStrm, sal_Size nLen) return pStr ? rtl::OString(pStr, SAL_NO_ACQUIRE) : rtl::OString(); } -//Create a OUString of nLen little endian sal_Unicodes from rStream -rtl::OUString read_LEuInt16s_ToOUString(SvStream& rStrm, sal_Size nLen) +//Create a OUString of nLen sal_Unicodes from rStream +rtl::OUString read_uInt16s_ToOUString(SvStream& rStrm, sal_Size nLen) { using comphelper::string::rtl_uString_alloc; @@ -2391,10 +2391,11 @@ rtl::OUString read_LEuInt16s_ToOUString(SvStream& rStrm, sal_Size nLen) pStr->length = sal::static_int_cast<sal_Int32>(nWasRead); pStr->buffer[pStr->length] = 0; } -#ifdef OSL_BIGENDIAN - for (sal_Int32 i = 0; i < pStr->length; ++i) - pStr->buffer[i] = SWAPSHORT(pStr->buffer[i]); -#endif + if (rStrm.IsEndianSwap()) + { + for (sal_Int32 i = 0; i < pStr->length; ++i) + pStr->buffer[i] = SWAPSHORT(pStr->buffer[i]); + } } //take ownership of buffer and return, otherwise return empty string |