summaryrefslogtreecommitdiff
path: root/tools/source/stream
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-23 22:58:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-24 16:53:55 +0000
commit5f662f2540e02487396d0ef0d97325d9a1fa8960 (patch)
tree54e2d7ad0513e7fe70c2c1efa8276035d56e0e49 /tools/source/stream
parent04d58ef75a5e6fd7066fcfd257d907f52e4de5a7 (diff)
all direct OUString readers are current little endian streams
Diffstat (limited to 'tools/source/stream')
-rw-r--r--tools/source/stream/stream.cxx13
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