diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2011-11-08 19:32:48 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2011-11-08 19:35:58 +0100 |
commit | f0dff0d9d152d3b96403a6f5df25e307392cbe06 (patch) | |
tree | b3922513cded16eb55201189abd85dea2825f607 /oox | |
parent | cb9dad87e7ee82d7ad1f93e1ab46e2f1ef509ce8 (diff) |
use non-const buffer to enable byte-order swapping on BigEndian system
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/helper/binaryoutputstream.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx index c96eeb95997f..97269f2c6dff 100644 --- a/oox/source/helper/binaryoutputstream.cxx +++ b/oox/source/helper/binaryoutputstream.cxx @@ -129,7 +129,14 @@ BinaryOutputStream::writeUnicodeArray( const ::rtl::OUString& rString, bool bAll OUString sBuf( rString ); if( !bAllowNulChars ) sBuf.replace( '\0', '?' ); +#ifdef OSL_BIGENDIAN + // need a non-const buffer for swapping byte order + sal_Unicode notConst[sBuf.getLength()]; + memcpy( notConst, sBuf.getStr(), sizeof(sal_Unicode)*sBuf.getLength() ); + writeArray( notConst, sBuf.getLength() ); +#else writeArray( sBuf.getStr(), sBuf.getLength() ); +#endif } void |