[Libreoffice-commits] .: oox/source

Christian Lohmaier cloph at kemper.freedesktop.org
Tue Nov 8 10:35:34 PST 2011


 oox/source/helper/binaryoutputstream.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit f0dff0d9d152d3b96403a6f5df25e307392cbe06
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Tue Nov 8 19:32:48 2011 +0100

    use non-const buffer to enable byte-order swapping on BigEndian system

diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx
index c96eeb9..97269f2 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


More information about the Libreoffice-commits mailing list