summaryrefslogtreecommitdiff
path: root/oox/source/helper
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2011-09-23 17:31:46 +0100
committerNoel Power <noel.power@novell.com>2011-09-26 12:06:04 +0100
commit5609c512cd4d2899300b432d88d93cff05a05c87 (patch)
tree9d312ec779374bdc17934926fd612a09b06081c4 /oox/source/helper
parentf8f54cbb5d6a34ea74c4e92a3bdb8e34b7b101d6 (diff)
move OCX_Control ( and subclasses ) and OCX control export to oox
Diffstat (limited to 'oox/source/helper')
-rw-r--r--oox/source/helper/binaryoutputstream.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx
index 76f08ed67ff8..c96eeb95997f 100644
--- a/oox/source/helper/binaryoutputstream.cxx
+++ b/oox/source/helper/binaryoutputstream.cxx
@@ -40,6 +40,10 @@ namespace oox {
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::uno;
+using ::rtl::OString;
+using ::rtl::OUString;
+using ::rtl::OUStringToOString;
+
namespace {
const sal_Int32 OUTPUTSTREAM_BUFFERSIZE = 0x8000;
@@ -110,6 +114,34 @@ void BinaryXOutputStream::writeMemory( const void* pMem, sal_Int32 nBytes, size_
}
}
+void
+BinaryOutputStream::writeCharArrayUC( const OUString& rString, rtl_TextEncoding eTextEnc, bool bAllowNulChars )
+{
+ OString sBuf( OUStringToOString( rString, eTextEnc ) );
+ if( !bAllowNulChars )
+ sBuf.replace( '\0', '?' );
+ writeMemory( static_cast< const void* >( sBuf.getStr() ), sBuf.getLength() );
+}
+
+void
+BinaryOutputStream::writeUnicodeArray( const ::rtl::OUString& rString, bool bAllowNulChars )
+{
+ OUString sBuf( rString );
+ if( !bAllowNulChars )
+ sBuf.replace( '\0', '?' );
+ writeArray( sBuf.getStr(), sBuf.getLength() );
+}
+
+void
+BinaryOutputStream::writeCompressedUnicodeArray( const rtl::OUString& rString, bool bCompressed, bool bAllowNulChars )
+{
+ if ( bCompressed )
+ // ISO-8859-1 maps all byte values 0xHH to the same Unicode code point U+00HH
+ writeCharArrayUC( rString, RTL_TEXTENCODING_ISO_8859_1, bAllowNulChars );
+ else
+ writeUnicodeArray( rString, bAllowNulChars );
+}
+
// ============================================================================
SequenceOutputStream::SequenceOutputStream( StreamDataSequence& rData ) :