use non-const buffer to enable byte-order swapping on BigEndian system
This commit is contained in:
@@ -129,7 +129,14 @@ BinaryOutputStream::writeUnicodeArray( const ::rtl::OUString& rString, bool bAll
|
|||||||
OUString sBuf( rString );
|
OUString sBuf( rString );
|
||||||
if( !bAllowNulChars )
|
if( !bAllowNulChars )
|
||||||
sBuf.replace( '\0', '?' );
|
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() );
|
writeArray( sBuf.getStr(), sBuf.getLength() );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user