[Libreoffice-commits] .: 4 commits - filter/inc filter/source oox/inc oox/Library_oox.mk oox/source sc/source sd/inc sd/source sw/inc sw/source

Noel Power noelp at kemper.freedesktop.org
Mon Sep 26 04:03:13 PDT 2011


 filter/inc/filter/msfilter/msocximex.hxx  |  787 --------
 filter/inc/filter/msfilter/svdfppt.hxx    |    6 
 filter/source/msfilter/msocximex.cxx      | 2743 ------------------------------
 filter/source/msfilter/svdfppt.cxx        |   14 
 oox/Library_oox.mk                        |    3 
 oox/inc/oox/helper/binaryoutputstream.hxx |   17 
 oox/inc/oox/ole/axbinaryreader.hxx        |   43 
 oox/inc/oox/ole/axbinarywriter.hxx        |  195 ++
 oox/inc/oox/ole/axcontrol.hxx             |  103 -
 oox/inc/oox/ole/axfontdata.hxx            |   89 
 oox/inc/oox/ole/olehelper.hxx             |   63 
 oox/source/helper/binaryoutputstream.cxx  |   32 
 oox/source/ole/axbinaryreader.cxx         |   70 
 oox/source/ole/axbinarywriter.cxx         |  244 ++
 oox/source/ole/axcontrol.cxx              |  807 ++++++++
 oox/source/ole/axfontdata.cxx             |  130 +
 oox/source/ole/olehelper.cxx              |  426 ++++
 oox/source/token/properties.txt           |    1 
 sc/source/filter/excel/xiescher.cxx       |    7 
 sc/source/filter/inc/xiescher.hxx         |    4 
 sc/source/filter/xcl97/xcl97esc.cxx       |    1 
 sd/inc/pch/precompiled_sd.hxx             |    1 
 sd/source/filter/eppt/eppt.cxx            |    5 
 sd/source/filter/eppt/eppt.hxx            |    1 
 sd/source/filter/eppt/epptso.cxx          |   17 
 sd/source/filter/ppt/pptin.cxx            |   13 
 sd/source/filter/ppt/pptin.hxx            |    4 
 sw/inc/pch/precompiled_sw.hxx             |    1 
 sw/source/filter/ww8/wrtw8esh.cxx         |   15 
 sw/source/filter/ww8/wrtww8.cxx           |    1 
 sw/source/filter/ww8/wrtww8.hxx           |    1 
 sw/source/filter/ww8/ww8par.hxx           |   13 
 sw/source/filter/ww8/ww8par3.cxx          |    1 
 sw/source/filter/ww8/ww8par4.cxx          |    1 
 34 files changed, 2100 insertions(+), 3759 deletions(-)

New commits:
commit b778d1a03c0cdf4d0ab0352e08e00ca4d27aef03
Author: Noel Power <noel.power at novell.com>
Date:   Sun Sep 25 22:35:19 2011 +0100

    fix merge foo and wae

diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx
index 1121572..19e217e 100644
--- a/filter/source/msfilter/msocximex.cxx
+++ b/filter/source/msfilter/msocximex.cxx
@@ -41,7 +41,7 @@
 using namespace ::com::sun::star;
 using namespace ::rtl;
 
-#define WW8_ASCII2STR(s) String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(s))
+#define C2U(cChar)  rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(cChar))
 
 static char sWW8_form[] = "WW-Standard";
 
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index a9e6d37..c78ffdd 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -2247,7 +2247,6 @@ void AxScrollBarModel::convertFromProperties( PropertySet& rPropSet, const Contr
     if ( rPropSet.getProperty( bRes,  PROP_Enabled ) )
         setFlag( mnFlags, AX_FLAGS_ENABLED, bRes );
     rPropSet.getProperty( mnDelay, PROP_RepeatDelay );
-    sal_Int32 nThumbLen = 0;
     mnPropThumb = AX_PROPTHUMB_ON; // default
     rConv.convertToMSColor( rPropSet, PROP_SymbolColor, mnArrowColor);
     rConv.convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
commit 590d9596c54443dc6b65a811569ec74371fa4794
Author: Noel Power <noel.power at novell.com>
Date:   Fri Sep 23 17:38:38 2011 +0100

    move OCX_Control ( and subclasses ) and OCX control export to oox
    
    add forgotten new files axbinarywriter.[ch]xx

diff --git a/oox/inc/oox/ole/axbinarywriter.hxx b/oox/inc/oox/ole/axbinarywriter.hxx
new file mode 100644
index 0000000..408abaa
--- /dev/null
+++ b/oox/inc/oox/ole/axbinarywriter.hxx
@@ -0,0 +1,195 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 Noel Power<noel.power at suse.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef OOX_OLE_AXBINARYWRITER_HXX
+#define OOX_OLE_AXBINARYWRITER_HXX
+
+#include <utility>
+#include "oox/helper/binaryoutputstream.hxx"
+#include "oox/helper/refvector.hxx"
+
+namespace oox {
+namespace ole {
+// ============================================================================
+
+/** A wrapper for a binary output stream that supports aligned write operations.
+
+    The implementation does support seeking back the wrapped stream. All
+    seeking operations (tell, seekTo, align) are performed relative to the
+    position of the wrapped stream at construction time of this wrapper.
+    Unlike it's reader class counterpart it is NOT possible to construct this
+    wrapper with an unseekable output stream.
+ */
+class AxAlignedOutputStream : public BinaryOutputStream
+{
+public:
+    explicit            AxAlignedOutputStream( BinaryOutputStream& rOutStrm );
+
+    /** Returns the size of the data this stream represents, if the wrapped
+        stream supports the size() operation. */
+    virtual sal_Int64   size() const;
+    /** Return the current relative stream position (relative to position of
+        the wrapped stream at construction time). */
+    virtual sal_Int64   tell() const;
+    /** Seeks the stream to the passed relative position, if it is behind the
+        current position. */
+    virtual void        seek( sal_Int64 nPos );
+    /** Closes the input stream but not the wrapped stream. */
+    virtual void        close();
+
+    /** Reads nBytes bytes to the passed sequence.
+        @return  Number of bytes really read. */
+    virtual void writeData( const StreamDataSequence& orData, size_t nAtomSize = 1 );
+    /** Reads nBytes bytes to the (existing) buffer opMem.
+        @return  Number of bytes really read. */
+    virtual void   writeMemory( const void* pMem, sal_Int32 nBytes, size_t nAtomSize = 1 );
+
+    /** Aligns the stream to a multiple of the passed size (relative to the
+        position of the wrapped stream at construction time). */
+    void                align( size_t nSize );
+
+    void         pad( sal_Int32 nBytes, size_t nAtomSize = 1);
+    /** Aligns the stream according to the passed type and reads an atomar value. */
+    template< typename Type >
+    inline void         writeAligned( Type nVal ) { align( sizeof( Type ) ); writeValue( nVal ); }
+    /** Aligns the stream according to the passed type and skips the size of the type. */
+    template< typename Type >
+    inline void         padAligned() { align( sizeof( Type ) ); pad( sizeof( Type ) ); }
+
+private:
+    BinaryOutputStream*  mpOutStrm;           /// The wrapped input stream.
+    sal_Int64           mnStrmPos;          /// Tracks relative position in the stream.
+    sal_Int64           mnStrmSize;         /// Size of the wrapped stream data.
+    sal_Int64           mnWrappedBeginPos;     /// starting pos or wrapped stream
+};
+
+/** A pair of integer values as a property. */
+typedef ::std::pair< sal_Int32, sal_Int32 > AxPairData;
+
+/** An array of string values as a property. */
+typedef ::std::vector< ::rtl::OUString > AxStringArray;
+
+// ============================================================================
+
+/** Export helper to write simple and complex ActiveX form control properties
+    to a binary input stream. */
+class AxBinaryPropertyWriter
+{
+public:
+    explicit            AxBinaryPropertyWriter( BinaryOutputStream& rOutStrm, bool b64BitPropFlags = false );
+
+    /** Write an integer property value to the stream, the
+        respective flag in the property mask is set. */
+    template< typename StreamType, typename DataType >
+    inline void         writeIntProperty( DataType& ornValue )
+                            { if( startNextProperty() ) maOutStrm.writeAligned< StreamType >( ornValue ); }
+    /** Write a boolean property value to the stream, the
+        respective flag in the property mask is set. */
+    void                writeBoolProperty( bool& orbValue, bool bReverse = false );
+    /** Write a pair property the stream, the respective flag in
+        the property mask is set. */
+    void                writePairProperty( AxPairData& orPairData );
+    /** Write a string property to the stream, the respective flag
+        in the property mask is set. */
+    void                writeStringProperty( ::rtl::OUString& orValue, bool bCompressed = true );
+
+    /** Skips the next property clears the respective
+        flag in the property mask. */
+    inline void         skipProperty() { startNextProperty( true ); }
+
+    /** Final processing, write contents of all complex properties, writes record size */
+    bool                finalizeExport();
+
+private:
+    bool                ensureValid( bool bCondition = true );
+    bool                startNextProperty( bool bSkip = false );
+
+private:
+    /** Base class for complex properties such as string, point, size, GUID, picture. */
+    struct ComplexProperty
+    {
+        virtual             ~ComplexProperty();
+        virtual bool        writeProperty( AxAlignedOutputStream& rOutStrm ) = 0;
+    };
+
+    /** Complex property for a 32-bit value pair, e.g. point or size. */
+    struct PairProperty : public ComplexProperty
+    {
+        AxPairData&         mrPairData;
+
+        inline explicit     PairProperty( AxPairData& rPairData ) :
+                                mrPairData( rPairData ) {}
+        virtual bool        writeProperty( AxAlignedOutputStream& rOutStrm );
+    };
+
+    /** Complex property for a string value. */
+    struct StringProperty : public ComplexProperty
+    {
+        ::rtl::OUString&    mrValue;
+        sal_uInt32          mnSize;
+
+        inline explicit     StringProperty( ::rtl::OUString& rValue, sal_uInt32 nSize ) :
+                                mrValue( rValue ), mnSize( nSize ) {}
+        virtual bool        writeProperty( AxAlignedOutputStream& rOutStrm );
+    };
+
+    /** Stream property for a picture or mouse icon. */
+    struct PictureProperty : public ComplexProperty
+    {
+        StreamDataSequence& mrPicData;
+
+        inline explicit     PictureProperty( StreamDataSequence& rPicData ) :
+                                mrPicData( rPicData ) {}
+        virtual bool        writeProperty( AxAlignedOutputStream& rOutStrm );
+    };
+
+    typedef RefVector< ComplexProperty > ComplexPropVector;
+
+private:
+    AxAlignedOutputStream maOutStrm;        /// The input stream to read from.
+    ComplexPropVector   maLargeProps;       /// Stores info for all used large properties.
+    ComplexPropVector   maStreamProps;      /// Stores info for all used stream data properties.
+    AxPairData          maDummyPairData;    /// Dummy pair for unsupported properties.
+    StreamDataSequence  maDummyPicData;     /// Dummy picture for unsupported properties.
+    ::rtl::OUString     maDummyString;      /// Dummy string for unsupported properties.
+    AxStringArray       maDummyStringArray; /// Dummy string array for unsupported properties.
+    sal_Int16           mnBlockSize;        ///
+    sal_Int64           mnPropFlagsStart;     /// pos of Prop flags
+    sal_Int64           mnPropFlags;        /// Flags specifying existing properties.
+    sal_Int64           mnNextProp;         /// Next property to read.
+    sal_Int64           mnPropsEnd;         /// End position of simple/large properties.
+    bool                mbValid;            /// True = stream still valid.
+    bool                mb64BitPropFlags;
+};
+
+// ============================================================================
+} // namespace ole
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/ole/axbinarywriter.cxx b/oox/source/ole/axbinarywriter.cxx
new file mode 100644
index 0000000..390b592
--- /dev/null
+++ b/oox/source/ole/axbinarywriter.cxx
@@ -0,0 +1,244 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 Noel Power <noel.power at suse.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include "oox/ole/axbinarywriter.hxx"
+
+#include "oox/ole/olehelper.hxx"
+
+namespace oox {
+namespace ole {
+
+// ============================================================================
+
+using ::rtl::OUString;
+
+// ============================================================================
+
+namespace {
+
+const sal_uInt32 AX_STRING_SIZEMASK         = 0x7FFFFFFF;
+const sal_uInt32 AX_STRING_COMPRESSED       = 0x80000000;
+
+} // namespace
+
+// ============================================================================
+
+AxAlignedOutputStream::AxAlignedOutputStream( BinaryOutputStream& rOutStrm ) :
+    BinaryStreamBase( false ),
+    mpOutStrm( &rOutStrm ),
+    mnStrmPos( 0 ),
+    mnStrmSize( rOutStrm.getRemaining() ),
+    mnWrappedBeginPos( rOutStrm.tell() )
+{
+    mbEof = mbEof || rOutStrm.isEof();
+}
+
+sal_Int64 AxAlignedOutputStream::size() const
+{
+    return mpOutStrm ? mnStrmSize : -1;
+}
+
+sal_Int64 AxAlignedOutputStream::tell() const
+{
+    return mpOutStrm ? mnStrmPos : -1;
+}
+
+void AxAlignedOutputStream::seek( sal_Int64 nPos )
+{
+    mbEof = (nPos < 0);
+    if( !mbEof )
+    {
+        mpOutStrm->seek( static_cast< sal_Int32 >( mnWrappedBeginPos + nPos  ) );
+        mnStrmPos = mpOutStrm->tell() - mnWrappedBeginPos;
+    }
+}
+
+void AxAlignedOutputStream::close()
+{
+    mpOutStrm = 0;
+    mbEof = true;
+}
+
+void AxAlignedOutputStream::writeData( const StreamDataSequence& orData, size_t nAtomSize )
+{
+    mpOutStrm->writeData( orData, nAtomSize );
+    mnStrmPos = mpOutStrm->tell() - mnWrappedBeginPos;
+}
+
+void AxAlignedOutputStream::writeMemory( const void* opMem, sal_Int32 nBytes, size_t nAtomSize )
+{
+    mpOutStrm->writeMemory( opMem, nBytes, nAtomSize );
+    mnStrmPos = mpOutStrm->tell() - mnWrappedBeginPos;
+}
+
+void AxAlignedOutputStream::pad( sal_Int32 nBytes, size_t nAtomSize )
+{
+   //PRESUMABELY we need to pad with 0's here as appropriate
+   com::sun::star::uno::Sequence< sal_Int8 > aData( nBytes );
+   // ok we could be padding with rubbish here, but really that shouldn't matter
+   // set to 0(s), easier to not get fooled by 0's when looking at
+   // binary content......
+   memset( static_cast<void*>( aData.getArray() ), 0, nBytes );
+   mpOutStrm->writeData( aData, nAtomSize );
+   mnStrmPos = mpOutStrm->tell() - mnWrappedBeginPos;
+}
+
+void AxAlignedOutputStream::align( size_t nSize )
+{
+    pad( static_cast< sal_Int32 >( (nSize - (mnStrmPos % nSize)) % nSize ) );
+}
+
+// ============================================================================
+
+namespace {
+
+void lclWriteString( AxAlignedOutputStream& rOutStrm, OUString& rValue, sal_uInt32 nSize, bool bArrayString )
+{
+    bool bCompressed = getFlag( nSize, AX_STRING_COMPRESSED );
+    rOutStrm.writeCompressedUnicodeArray( rValue, bCompressed || bArrayString );
+}
+
+} // namespace
+
+// ----------------------------------------------------------------------------
+
+AxBinaryPropertyWriter::ComplexProperty::~ComplexProperty()
+{
+}
+
+bool AxBinaryPropertyWriter::PairProperty::writeProperty( AxAlignedOutputStream& rOutStrm )
+{
+    rOutStrm << mrPairData.first << mrPairData.second;
+    return true;
+}
+
+bool AxBinaryPropertyWriter::StringProperty::writeProperty( AxAlignedOutputStream& rOutStrm )
+{
+    lclWriteString( rOutStrm, mrValue, mnSize, false );
+    return true;
+}
+
+// ----------------------------------------------------------------------------
+
+AxBinaryPropertyWriter::AxBinaryPropertyWriter( BinaryOutputStream& rOutStrm, bool b64BitPropFlags ) :
+    maOutStrm( rOutStrm ),
+    mnPropFlags( 0x0 ),
+    mbValid( true ),
+    mb64BitPropFlags( b64BitPropFlags )
+{
+    sal_uInt16 nId( 0x0200 );
+    maOutStrm << nId;
+    mnBlockSize = 0; // will be filled in the finalize method
+
+    maOutStrm << nId;
+    mnPropFlagsStart = maOutStrm.tell();
+
+    if( mb64BitPropFlags )
+        maOutStrm << mnPropFlags;
+    else
+        maOutStrm << sal_uInt32( mnPropFlags );
+    mnNextProp = 1;
+}
+
+void AxBinaryPropertyWriter::writeBoolProperty( bool& orbValue, bool bReverse )
+{
+    // orbValue ^ bReverse true then we want to set the bit, e.g. don't skip
+    startNextProperty(  !( ( orbValue ^ bReverse ) >= 1 ) );
+}
+
+void AxBinaryPropertyWriter::writePairProperty( AxPairData& orPairData )
+{
+    if( startNextProperty() )
+        maLargeProps.push_back( ComplexPropVector::value_type( new PairProperty( orPairData ) ) );
+}
+
+void AxBinaryPropertyWriter::writeStringProperty( OUString& orValue, bool bCompressed )
+{
+    sal_uInt32 nSize = orValue.getLength();
+    if ( bCompressed )
+        setFlag(  nSize, AX_STRING_COMPRESSED );
+    else
+        nSize *= 2;
+    maOutStrm.writeAligned< sal_uInt32 >( nSize );
+    maLargeProps.push_back( ComplexPropVector::value_type( new StringProperty( orValue, nSize ) ) );
+    startNextProperty();
+}
+
+bool AxBinaryPropertyWriter::finalizeExport()
+{
+    // write large properties
+    maOutStrm.align( 4 );
+    if( !maLargeProps.empty() )
+    {
+        for( ComplexPropVector::iterator aIt = maLargeProps.begin(), aEnd = maLargeProps.end(); ensureValid() && (aIt != aEnd); ++aIt )
+        {
+            (*aIt)->writeProperty( maOutStrm );
+            maOutStrm.align( 4 );
+        }
+    }
+
+    mnBlockSize = maOutStrm.tell() - mnPropFlagsStart;
+
+    // write stream properties (no stream alignment between properties!)
+    if( !maStreamProps.empty() )
+        for( ComplexPropVector::iterator aIt = maStreamProps.begin(), aEnd = maStreamProps.end(); ensureValid() && (aIt != aEnd); ++aIt )
+           (*aIt)->writeProperty( maOutStrm );
+
+    sal_Int64 nPos = maOutStrm.tell();
+    maOutStrm.seek( mnPropFlagsStart - sizeof( mnBlockSize ) );
+
+    maOutStrm << mnBlockSize;
+
+    if( mb64BitPropFlags )
+        maOutStrm << mnPropFlags;
+    else
+        maOutStrm << sal_uInt32( mnPropFlags );
+
+    maOutStrm.seek( nPos );
+    return true;
+}
+
+bool AxBinaryPropertyWriter::ensureValid( bool bCondition )
+{
+    mbValid = mbValid && bCondition && !maOutStrm.isEof();
+    return mbValid;
+}
+
+bool AxBinaryPropertyWriter::startNextProperty( bool bSkip )
+{
+    // if we are skipping then we clear the flag
+    setFlag( mnPropFlags, mnNextProp, !bSkip );
+    mnNextProp <<= 1;
+    return true;
+}
+
+// ============================================================================
+
+} // namespace exp
+} // namespace ole
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 5609c512cd4d2899300b432d88d93cff05a05c87
Author: Noel Power <noel.power at novell.com>
Date:   Fri Sep 23 17:31:46 2011 +0100

    move OCX_Control ( and subclasses ) and OCX control export to oox

diff --git a/filter/inc/filter/msfilter/msocximex.hxx b/filter/inc/filter/msfilter/msocximex.hxx
index 98c2f67..7fa196a 100644
--- a/filter/inc/filter/msfilter/msocximex.hxx
+++ b/filter/inc/filter/msfilter/msocximex.hxx
@@ -30,15 +30,8 @@
 
 #include <sot/storage.hxx>
 #include <tools/debug.hxx>
-#include <com/sun/star/graphic/XGraphicObject.hpp>
 
-//!! no such defines in global namespaces - it will break other existing code that uses the same define!!
-//#ifndef C2U
-//#define C2U(cChar)    rtl::OUString::createFromAscii(cChar)
-//#endif
 #include "filter/msfilter/msfilterdllapi.h"
-#include <vector>
-#include <boost/unordered_map.hpp>
 
 namespace com{namespace sun{namespace star{
         namespace drawing{
@@ -69,49 +62,20 @@ namespace com{namespace sun{namespace star{
         namespace uno{
                 class XComponentContext;
         }
+        namespace frame{
+                class XModel;
+        }
 
 }}}
 
-class OCX_Control;
 class SfxObjectShell;
-class SwPaM;
 
 class MSFILTER_DLLPUBLIC SvxMSConvertOCXControls
 {
 public:
-    SvxMSConvertOCXControls( SfxObjectShell *pDSh,SwPaM *pP );
+    SvxMSConvertOCXControls( const  ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
     virtual ~SvxMSConvertOCXControls();
 
-    //Reads a control from the given storage, constructed shape in pShapeRef
-    virtual sal_Bool ReadOCXStream( SotStorageRef& rSrc1,
-        com::sun::star::uno::Reference<
-        com::sun::star::drawing::XShape > *pShapeRef=0,
-        sal_Bool bFloatingCtrl=sal_False ) = 0;
-
-
-
-    //Writes the given Uno Control into the given storage
-
-    static sal_Bool WriteOCXStream(SotStorageRef &rSrc1,
-        const com::sun::star::uno::Reference<
-        com::sun::star::awt::XControlModel > &rControlModel,
-        const com::sun::star::awt::Size& rSize,String &rName);
-
-    //Excel has a nasty kludged mechanism for this, read
-    //the comments in the source to follow it
-    static sal_Bool WriteOCXExcelKludgeStream(SotStorageStreamRef& rContents,
-        const com::sun::star::uno::Reference<
-        com::sun::star::awt::XControlModel > &rControlModel,
-        const com::sun::star::awt::Size &rSize, String &rName);
-
-    //Generate an OCX converter based on the OLE2 name
-    static OCX_Control *OCX_Factory(const String &rId);
-
-    //Generate an OCX converter based on the StarOffice UNO id
-    static OCX_Control *OCX_Factory( const com::sun::star::uno::Reference<
-        com::sun::star::awt::XControlModel > &rControlModel,
-        String &rId,String &rName);
-
     virtual sal_Bool InsertControl(
         const com::sun::star::uno::Reference<
         com::sun::star::form::XFormComponent >& /*rFComp*/,
@@ -123,10 +87,6 @@ public:
     /*begin: Backwards compatability with office 95 import, modify later*/
     const com::sun::star::uno::Reference<
         com::sun::star::lang::XMultiServiceFactory > & GetServiceFactory();
-
-    sal_uInt16 GetEditNum() { return ++nEdit; }
-    sal_uInt16 GetCheckboxNum() { return ++nCheckbox; }
-    /*end: Backwards compatability*/
 protected:
     const com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > &
         GetShapes();
@@ -134,8 +94,7 @@ protected:
     const com::sun::star::uno::Reference<
         com::sun::star::container::XIndexContainer > &  GetFormComps();
 
-    SfxObjectShell *pDocSh;
-    SwPaM *pPaM;
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
 
     // gecachte Interfaces
     com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >
@@ -148,746 +107,10 @@ protected:
     com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >
         xFormComps;
 
-    sal_uInt16 nEdit;
-    sal_uInt16 nCheckbox;
-
     virtual const com::sun::star::uno::Reference<
         com::sun::star::drawing::XDrawPage > & GetDrawPage();
 };
 
-class OCX_FontData
-{
-public:
-    OCX_FontData() : nFontNameLen(0), fBold(0), fItalic(0), fUnderline(0),
-        fStrike(0), nFontSize(12), nJustification(1), pFontName(0),
-        bHasAlign(sal_False), bHasFont(sal_True) {}
-    ~OCX_FontData()  {
-        if (pFontName)
-        delete [] pFontName;
-    }
-
-    sal_Bool Export(SotStorageStreamRef &rContent,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet);
-
-    sal_uInt16 nIdentifier;
-    sal_uInt16 nFixedAreaLen;
-    sal_uInt8 pBlockFlags[4];
-
-    sal_uInt32 nFontNameLen;
-
-    sal_uInt8   fBold:1;
-    sal_uInt8   fItalic:1;
-    sal_uInt8   fUnderline:1;
-    sal_uInt8   fStrike:1;
-    sal_uInt8   fUnknown1:4;
-
-    sal_uInt8   nUnknown2;
-    sal_uInt8   nUnknown3;
-    sal_uInt8   nUnknown4;
-
-    sal_uInt32  nFontSize;
-    sal_uInt16 nLanguageID;
-    sal_uInt8   nJustification;
-    sal_uInt16  nFontWeight;
-
-    char *pFontName;
-    void SetHasAlign(sal_Bool bIn) {bHasAlign=bIn;}
-    void SetHasFont(sal_Bool bIn) {bHasFont=bIn;}
-protected:
-    static sal_uInt16 nStandardId;
-    sal_uInt8 ExportAlign(sal_Int16 nAlign) const;
-private:
-    sal_Bool bHasAlign;
-    sal_Bool bHasFont;
-};
-
-class MSFILTER_DLLPUBLIC OCX_Control
-{
-public:
-    OCX_Control(UniString sN, OCX_Control* parent = NULL ) : nWidth( 0 ), nHeight( 0 ), mnLeft(0), mnTop(0),
-        mnStep(0), mnBackColor(0x8000000FL), mnForeColor(0), mnTabPos(0), mbVisible(true), sName(sN), pDocSh(0),
-        bSetInDialog(sal_False), mpParent( parent ) {}
-    //Export exports a control as an OLE style storage stream tree
-    virtual sal_Bool Export(SotStorageRef& /*rObj*/,
-    const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet>& /*rPropSet*/,
-        const com::sun::star::awt::Size& /*rSize*/) {return sal_False;}
-
-    //WriteContents writes the contents of a contents stream, for
-    //the Excel export you cannot use Export, only WriteContents instead
-    virtual sal_Bool WriteContents(SotStorageStreamRef& /*rObj*/,
-    const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet>& /*rPropSet*/,
-        const com::sun::star::awt::Size& /*rSize*/) {return sal_False;}
-    void SetInDialog(bool bState) { bSetInDialog = bState; }
-    bool GetInDialog() { return bSetInDialog; }
-
-    virtual ~OCX_Control() {}
-
-    static void FillSystemColors();
-
-    sal_uInt32 nWidth;
-    sal_uInt32 nHeight;
-        sal_Int32 mnLeft;
-        sal_Int32 mnTop;
-        sal_Int32 mnStep;
-    sal_Int32 mnBackColor;
-    sal_Int32 mnForeColor;
-        sal_uInt16 mnTabPos;
-    bool mbVisible;
-    UniString sName;
-    UniString msToolTip;
-    UniString msParentName;
-    OCX_FontData aFontData;
-    rtl::OUString msCtrlSource;
-    rtl::OUString msRowSource;
-        SfxObjectShell *pDocSh;
-    ::rtl::OUString sImageUrl;
-    com::sun::star::uno::Reference< com::sun::star::graphic::XGraphicObject> mxGrfObj;
-protected:
-
-    sal_uInt32 ExportColor(sal_uInt32 nColorCode) const;
-    sal_uInt32 SwapColor(sal_uInt32 nColorCode) const;
-    sal_uInt8 ExportBorder(sal_uInt16 nBorder,sal_uInt8 &rBorderStyle) const;
-    bool bSetInDialog;
-    sal_uInt8 ExportSpecEffect( sal_Int16 nApiEffect ) const;
-    static sal_uInt16 nStandardId;
-    static sal_uInt8 const aObjInfo[4];
-    rtl::OUString msFormType;
-    rtl::OUString msDialogType;
-        OCX_Control* mpParent;
-private:
-    static sal_uInt32 pColor[25];
-};
-
-class OCX_ModernControl : public OCX_Control
-{
-public:
-    OCX_ModernControl(UniString sN) : OCX_Control(sN),
-    fEnabled(1), fLocked(0), fBackStyle(1), fColumnHeads(0), fIntegralHeight(1),
-    fMatchRequired(0), fAlignment(1), fDragBehaviour(0), fEnterKeyBehaviour(0),
-    fEnterFieldBehaviour(0), fTabKeyBehaviour(0), fWordWrap(1),
-    fSelectionMargin(1), fAutoWordSelect(1), fAutoSize(0), fHideSelection(1),
-    fAutoTab(0), fMultiLine(1), nMaxLength(0), nBorderStyle(0), nScrollBars(0),
-    nStyle(0), nMousePointer(0), nPasswordChar(0), nListWidth(0),
-    nBoundColumn(1), nTextColumn(-1), nColumnCount(1), nListRows(8),
-    nMatchEntry(2), nListStyle(0), nShowDropButtonWhen(0), nDropButtonStyle(1),
-    nMultiState(0), nValueLen(0), nCaptionLen(0), nVertPos(1), nHorzPos(7),
-    nSpecialEffect(2), nIcon(0), nPicture(0), nAccelerator(0), nGroupNameLen(0),
-    pValue(0), pCaption(0), pGroupName(0), nIconLen(0), pIcon(0),
-    nPictureLen(0) {}
-
-    ~OCX_ModernControl() {
-        if (pValue) delete[] pValue;
-        if (pCaption) delete[] pCaption;
-        if (pGroupName) delete[] pGroupName;
-        if (pIcon) delete[] pIcon;
-    }
-
-    /*sal_uInt8 for sal_uInt8 Word Struct*/
-    sal_uInt16  nIdentifier;
-    sal_uInt16  nFixedAreaLen;
-    sal_uInt8   pBlockFlags[8];
-
-    sal_uInt8   fUnknown1:1;
-    sal_uInt8   fEnabled:1;
-    sal_uInt8   fLocked:1;
-    sal_uInt8   fBackStyle:1;
-    sal_uInt8   fUnknown2:4;
-
-    sal_uInt8   fUnknown3:2;
-    sal_uInt8   fColumnHeads:1;
-    sal_uInt8   fIntegralHeight:1;
-    sal_uInt8   fMatchRequired:1;
-    sal_uInt8   fAlignment:1;
-    sal_uInt8   fUnknown4:2;
-
-    sal_uInt8   fUnknown5:3;
-    sal_uInt8   fDragBehaviour:1;
-    sal_uInt8   fEnterKeyBehaviour:1;
-    sal_uInt8   fEnterFieldBehaviour:1;
-    sal_uInt8   fTabKeyBehaviour:1;
-    sal_uInt8   fWordWrap:1;
-
-    sal_uInt8   fUnknown6:2;
-    sal_uInt8   fSelectionMargin:1;
-    sal_uInt8   fAutoWordSelect:1;
-    sal_uInt8   fAutoSize:1;
-    sal_uInt8   fHideSelection:1;
-    sal_uInt8   fAutoTab:1;
-    sal_uInt8   fMultiLine:1;
-
-    sal_uInt32  nMaxLength;
-    sal_uInt8   nBorderStyle;
-    sal_uInt8   nScrollBars;
-    sal_uInt8   nStyle;
-    sal_uInt8   nMousePointer;
-    sal_uInt8   nUnknown7;
-    sal_uInt8   nPasswordChar;
-    sal_uInt32  nListWidth;
-    sal_uInt16  nBoundColumn;
-    sal_Int16   nTextColumn;
-    sal_uInt16  nColumnCount;
-    sal_uInt16  nListRows;
-    sal_uInt16  nUnknown8;
-    sal_uInt8   nMatchEntry;
-    sal_uInt8   nListStyle;
-    sal_uInt8   nShowDropButtonWhen;
-    sal_uInt8   nDropButtonStyle;
-    sal_uInt8   nMultiState;
-    sal_uInt32  nValueLen;
-    sal_uInt32  nCaptionLen;
-
-    sal_uInt16 nVertPos;
-    sal_uInt16 nHorzPos;
-
-    sal_uInt32 nBorderColor;
-    sal_uInt8 nSpecialEffect;
-    sal_uInt16 nIcon;
-    sal_uInt16 nPicture;
-    sal_uInt8 nAccelerator;
-    sal_uInt8 nUnknown9;
-    sal_uInt32 nGroupNameLen;
-    sal_uInt32 nUnknown10;
-
-    char *pValue;
-    char *pCaption;
-    char *pGroupName;
-
-    sal_uInt8 pIconHeader[20];
-    sal_uInt32 nIconLen;
-    sal_uInt8 *pIcon;
-
-    sal_uInt8 pPictureHeader[20];
-    sal_uInt32 nPictureLen;
-
-};
-
-class OCX_Image : public OCX_Control
-{
-public:
-    OCX_Image() : OCX_Control(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Image" ))), fEnabled(1), fBackStyle(0), bPictureTiling(false), bAutoSize(false) {
-                msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.DatabaseImageControl" ));
-        msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlImageControlModel" ));
-         }
-
-    ~OCX_Image() { }
-    /*sal_uInt8 for sal_uInt8 Word Struct*/
-    sal_uInt16  nIdentifier;
-    sal_uInt16  nFixedAreaLen;
-    sal_uInt8   pBlockFlags[4];
-
-    sal_uInt32  nBorderColor;
-    sal_uInt8   nBorderStyle;
-    sal_uInt8   nMousePointer;
-        sal_uInt8       nPictureSizeMode;
-
-
-           sal_uInt8    fUnknown1:1;
-    sal_uInt8   fEnabled:1;
-    sal_uInt8   fUnknown2:2;
-    sal_uInt8   fBackStyle:1;
-    sal_uInt8   fUnknown3:3;
-
-        sal_uInt8       nPictureAlignment;
-        bool            bPictureTiling;
-    sal_uInt8   nSpecialEffect;
-
-        bool bAutoSize;
-    sal_Bool Export(SotStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SotStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-
-    static OCX_Control *Create() { return new OCX_Image;}
-};
-class OCX_OptionButton;
-
-class OCX_CheckBox : public OCX_ModernControl
-{
-public:
-    OCX_CheckBox() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CheckBox" ))){
-        msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CheckBox" ));
-        msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlCheckBoxModel" ));
-        mnBackColor = 0x80000005L;
-        mnForeColor = 0x80000008L;
-        aFontData.SetHasAlign(sal_True);
-    }
-
-    sal_Bool Export(SotStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SotStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    static OCX_Control *Create() { return new OCX_CheckBox;}
-};
-
-class OCX_OptionButton : public OCX_ModernControl
-{
-public:
-    OCX_OptionButton() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OptionButton" )))
-    {
-        msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.RadioButton" ));
-        //msDialogType = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel"));
-        msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.RadioButton" ));
-        mnBackColor = 0x80000005L;
-        mnForeColor = 0x80000008L;
-        aFontData.SetHasAlign(sal_True);
-    }
-
-    sal_Bool Export(SotStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SotStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-
-
-    static OCX_Control *Create() { return new OCX_OptionButton;}
-};
-
-class OCX_TextBox : public OCX_ModernControl
-{
-public:
-    OCX_TextBox() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextBox" ))) {
-        msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ));
-        msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlEditModel" ));
-        mnBackColor = 0x80000005L;
-        mnForeColor = 0x80000008L;
-        nBorderColor = 0x80000006L;
-        aFontData.SetHasAlign(sal_True);
-    }
-
-    sal_Bool Export(SotStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SotStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    static OCX_Control *Create() { return new OCX_TextBox;}
-};
-
-class OCX_FieldControl: public OCX_ModernControl
-{
-public:
-    OCX_FieldControl() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextBox" ))) {
-        mnBackColor = 0x80000005L;
-        mnForeColor = 0x80000008L;
-        nBorderColor = 0x80000006L;
-    }
-    sal_Bool Export(SotStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SotStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    static OCX_Control *Create() { return new OCX_FieldControl;}
-};
-
-
-class OCX_ToggleButton : public OCX_ModernControl
-{
-public:
-    OCX_ToggleButton() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ToggleButton" ))) {
-                msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CommandButton" ));
-                msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlButtonModel" ));
-
-        mnBackColor = 0x8000000F;
-        mnForeColor = 0x80000012;
-        aFontData.SetHasAlign(sal_True);
-        aFontData.nJustification = 3;   // centered by default
-    }
-    static OCX_Control *Create() { return new OCX_ToggleButton;}
-
-    sal_Bool Export(SvStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SvStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-};
-
-class OCX_ComboBox : public OCX_ModernControl
-{
-public:
-    OCX_ComboBox() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ComboBox" ))){
-        msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ComboBox" ));
-            msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ComboBox" ));
-        mnBackColor = 0x80000005;
-        mnForeColor = 0x80000008;
-        nBorderColor = 0x80000006;
-        aFontData.SetHasAlign(sal_True);
-    }
-    static OCX_Control *Create() { return new OCX_ComboBox;}
-    sal_Bool Export(SotStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SotStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-};
-
-class OCX_ListBox : public OCX_ModernControl
-{
-public:
-    OCX_ListBox() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ListBox" ))){
-        msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ListBox" ));
-        //msDialogType = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel"));
-        msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ListBox" ));
-        mnBackColor = 0x80000005;
-        mnForeColor = 0x80000008;
-        nBorderColor = 0x80000006;
-        aFontData.SetHasAlign(sal_True);
-    }
-    static OCX_Control *Create() { return new OCX_ListBox;}
-    sal_Bool Export(SotStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SotStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-
-};
-
-class OCX_CommandButton : public OCX_Control
-{
-public:
-    OCX_CommandButton() : OCX_Control(String::CreateFromAscii("CommandButton")),
-    fEnabled(1), fLocked(0), fBackStyle(1), fWordWrap(0), fAutoSize(0),
-        nCaptionLen(0), nVertPos(1), nHorzPos(7), nMousePointer(0), nPicture(0),
-        nAccelerator(0), nIcon(0), pCaption(0), nIconLen(0), pIcon(0), nPictureLen(0),
-        mbTakeFocus( true )
-    {
-            msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.CommandButton" ));
-            msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlButtonModel" ));
-            mnForeColor = 0x80000012L;
-                mnBackColor = 0x8000000FL;
-    }
-
-    ~OCX_CommandButton() {
-        if (pCaption) delete[] pCaption;
-        if (pIcon) delete[] pIcon;
-    }
-
-    /*sal_uInt8 for sal_uInt8 Word Struct*/
-    sal_uInt16  nIdentifier;
-    sal_uInt16  nFixedAreaLen;
-    sal_uInt8   pBlockFlags[4];
-
-
-    sal_uInt8   fUnknown1:1;
-    sal_uInt8   fEnabled:1;
-    sal_uInt8   fLocked:1;
-    sal_uInt8   fBackStyle:1;
-    sal_uInt8   fUnknown2:4;
-
-    sal_uInt8   fUnknown3:8;
-
-    sal_uInt8   fUnknown4:7;
-    sal_uInt8   fWordWrap:1;
-
-    sal_uInt8   fUnknown5:4;
-    sal_uInt8   fAutoSize:1;
-    sal_uInt8   fUnknown6:3;
-
-    sal_uInt32  nCaptionLen;
-
-    sal_uInt16  nVertPos;
-    sal_uInt16  nHorzPos;
-
-    sal_uInt16  nMousePointer;
-    sal_uInt16  nPicture;
-    sal_uInt16  nAccelerator;
-    sal_uInt16  nIcon;
-
-    char *pCaption;
-
-    sal_uInt8 pIconHeader[20];
-    sal_uInt32  nIconLen;
-    sal_uInt8 *pIcon;
-
-    sal_uInt8 pPictureHeader[20];
-    sal_uInt32  nPictureLen;
-
-    bool        mbTakeFocus;
-
-    static OCX_Control *Create() { return new OCX_CommandButton;}
-    sal_Bool Export(SotStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SotStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-
-};
-
-class OCX_ImageButton: public OCX_CommandButton
-{
-public:
-    OCX_ImageButton() {
-        aFontData.SetHasAlign(sal_False);
-        aFontData.SetHasFont(sal_False);
-    }
-    static OCX_Control *Create() { return new OCX_ImageButton;}
-    sal_Bool Export(SotStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SotStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-
-};
-
-class OCX_GroupBox: public OCX_Control
-{
-public:
-    OCX_GroupBox() : OCX_Control(String::CreateFromAscii("GroupBox")) {}
-    static OCX_Control *Create() { return new OCX_GroupBox;}
-    sal_Bool Export(SotStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SotStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-
-};
-
-class OCX_Label : public OCX_Control
-{
-public:
-    OCX_Label(OCX_Control* pParent = NULL ) : OCX_Control(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Label" )), pParent ), fEnabled(1),
-        fLocked(0),fBackStyle(1),fWordWrap(1),
-    fAutoSize(0),nCaptionLen(0),nVertPos(1),nHorzPos(7),nMousePointer(0),
-    nBorderColor(0x80000006),nBorderStyle(0),nSpecialEffect(0),
-    nPicture(0),nAccelerator(0),nIcon(0),pCaption(0),nIconLen(0),pIcon(0),
-    nPictureLen(0)
-    {
-        msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.FixedText" ));
-        msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlFixedTextModel" ));
-                mnForeColor = 0x80000008;
-                mnBackColor = 0x80000005;
-        aFontData.SetHasAlign(sal_True);
-    }
-
-    ~OCX_Label() {
-        if (pCaption) delete[] pCaption;
-        if (pIcon) delete[] pIcon;
-    }
-
-    /*sal_uInt8 for sal_uInt8 Word Struct*/
-    sal_uInt16 nIdentifier;
-    sal_uInt16 nFixedAreaLen;
-    sal_uInt8   pBlockFlags[4];
-
-
-    sal_uInt8   fUnknown1:1;
-    sal_uInt8   fEnabled:1;
-    sal_uInt8   fLocked:1;
-    sal_uInt8   fBackStyle:1;
-    sal_uInt8   fUnknown2:4;
-
-    sal_uInt8   fUnknown3:8;
-
-    sal_uInt8   fUnknown4:7;
-    sal_uInt8   fWordWrap:1;
-
-    sal_uInt8   fUnknown5:4;
-    sal_uInt8   fAutoSize:1;
-    sal_uInt8   fUnknown6:3;
-
-    sal_uInt32  nCaptionLen;
-    sal_uInt16  nVertPos;
-    sal_uInt16  nHorzPos;
-    sal_uInt8   nMousePointer;
-    sal_uInt32  nBorderColor;
-    sal_uInt16  nBorderStyle;
-    sal_uInt16  nSpecialEffect;
-    sal_uInt16  nPicture;
-    sal_uInt16  nAccelerator;
-    sal_uInt16  nIcon;
-
-    char *pCaption;
-
-    sal_uInt8 pIconHeader[20];
-    sal_uInt32  nIconLen;
-    sal_uInt8 *pIcon;
-
-    sal_uInt8 pPictureHeader[20];
-    sal_uInt32  nPictureLen;
-
-    static OCX_Control *Create() { return new OCX_Label;}
-
-    sal_Bool Export(SotStorageRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-    sal_Bool WriteContents(SotStorageStreamRef &rObj,
-        const com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet> &rPropSet,
-        const com::sun::star::awt::Size& rSize);
-
-};
-
-
-class OCX_ProgressBar : public OCX_Control
-{
-public:
-    explicit            OCX_ProgressBar();
-
-    static OCX_Control* Create();
-
-private:
-    sal_Int32   nMin;
-    sal_Int32   nMax;
-    bool        bFixedSingle;
-    bool        bEnabled;
-    bool        b3d;
-};
-
-class OCX_SpinButton : public OCX_Control
-{
-public:
-    explicit            OCX_SpinButton();
-
-    static OCX_Control* Create();
-
-    //Export exports a control as an OLE style storage stream tree
-    virtual sal_Bool    Export( SvStorageRef &rObj,
-                            const com::sun::star::uno::Reference<
-                                com::sun::star::beans::XPropertySet> &rPropSet,
-                                const com::sun::star::awt::Size& rSize );
-
-    //WriteContents writes the contents of a contents stream, for
-    //the Excel export you cannot use Export, only WriteContents instead
-    virtual sal_Bool    WriteContents( SvStorageStreamRef &rObj,
-                            const com::sun::star::uno::Reference<
-                                com::sun::star::beans::XPropertySet> &rPropSet,
-                                const com::sun::star::awt::Size& rSize );
-
-protected:
-    void                UpdateInt32Property(
-                            sal_Int32& rnCoreValue, sal_Int32 nNewValue,
-                            sal_Int32 nBlockFlag );
-
-    void                GetInt32Property(
-                            sal_Int32& rnCoreValue,
-                            const com::sun::star::uno::Reference<
-                                com::sun::star::beans::XPropertySet >& rxPropSet,
-                            const rtl::OUString& rPropName,
-                            sal_Int32 nBlockFlag );
-
-    void                UpdateBoolProperty(
-                            bool& rbCoreValue, bool bNewValue,
-                            sal_Int32 nBlockFlag );
-
-    void                GetBoolProperty(
-                            bool& rbCoreValue,
-                            const com::sun::star::uno::Reference<
-                                com::sun::star::beans::XPropertySet >& rxPropSet,
-                            const rtl::OUString& rPropName,
-                            sal_Int32 nBlockFlag );
-
-    /** Writes the data from own members to stream. */
-    sal_Bool            WriteData( SvStream& rStrm ) const;
-
-    sal_Int32           mnBlockFlags;
-    sal_Int32           mnValue;
-    sal_Int32           mnMin;
-    sal_Int32           mnMax;
-    sal_Int32           mnSmallStep;
-    sal_Int32           mnPageStep;
-    sal_Int32           mnOrient;
-    sal_Int32           mnDelay;
-    bool                mbEnabled;
-    bool                mbLocked;
-    bool                mbPropThumb;
-};
-
-class OCX_ScrollBar : public OCX_SpinButton
-{
-public:
-    explicit            OCX_ScrollBar();
-
-    static OCX_Control* Create();
-
-    //Export exports a control as an OLE style storage stream tree
-    virtual sal_Bool    Export( SvStorageRef &rObj,
-                            const com::sun::star::uno::Reference<
-                                com::sun::star::beans::XPropertySet> &rPropSet,
-                                const com::sun::star::awt::Size& rSize );
-
-    //WriteContents writes the contents of a contents stream, for
-    //the Excel export you cannot use Export, only WriteContents instead
-    virtual sal_Bool    WriteContents( SvStorageStreamRef &rObj,
-                            const com::sun::star::uno::Reference<
-                                com::sun::star::beans::XPropertySet> &rPropSet,
-                                const com::sun::star::awt::Size& rSize );
-};
-
-class HTML_Select : public OCX_ModernControl
-{
-public:
-    HTML_Select() : OCX_ModernControl(rtl::OUString::createFromAscii("TextBox")) {
-        msFormType = rtl::OUString::createFromAscii("com.sun.star.form.component.ListBox");
-        msDialogType = rtl::OUString::createFromAscii("com.sun.star.form.component.ListBox");
-        mnBackColor = 0x80000005L;
-        mnForeColor = 0x80000008L;
-        nBorderColor = 0x80000006L;
-        aFontData.SetHasAlign(sal_True);
-                fEnabled = true;
-                nMultiState =false;
-    }
-
-    static OCX_Control *Create() { return new HTML_Select;}
-
-        com::sun::star::uno::Sequence< rtl::OUString > msListData;
-        com::sun::star::uno::Sequence< sal_Int16 > msIndices;
-};
-
-class HTML_TextBox : public OCX_ModernControl
-{
-public:
-    HTML_TextBox() : OCX_ModernControl(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TextBox" ))) {
-        msFormType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ));
-        msDialogType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlEditModel" ));
-        mnBackColor = 0x80000005L;
-        mnForeColor = 0x80000008L;
-        nBorderColor = 0x80000006L;
-        aFontData.SetHasAlign(sal_True);
-    }
-
-    static OCX_Control *Create() { return new HTML_TextBox;}
-
-};
-
-
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/inc/filter/msfilter/svdfppt.hxx b/filter/inc/filter/msfilter/svdfppt.hxx
index 3374699..6d2b8e0 100644
--- a/filter/inc/filter/msfilter/svdfppt.hxx
+++ b/filter/inc/filter/msfilter/svdfppt.hxx
@@ -628,7 +628,7 @@ public:
                                 sal_uInt32* pTableArry,
                                 SvxMSDffSolverContainer*
                             );
-    virtual bool ReadFormControl( com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& rxInStrm, com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rFormComp ) const = 0;
+    virtual bool ReadFormControl( SotStorageRef& rSrc1, com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rFormComp ) const = 0;
 };
 
 struct PPTTextCharacterStyleAtomInterpreter
@@ -1258,8 +1258,8 @@ class PPTConvertOCXControls : public SvxMSConvertOCXControls
     com::sun::star::uno::Reference< com::sun::star::io::XInputStream > mxInStrm;
 public :
 
-    PPTConvertOCXControls( const SdrPowerPointImport* pPPTImporter, com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& rxInStrm, SfxObjectShell* pDSh, PptPageKind ePKind ) :
-        SvxMSConvertOCXControls ( pDSh, NULL ),
+    PPTConvertOCXControls( const SdrPowerPointImport* pPPTImporter, com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& rxInStrm, const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel, PptPageKind ePKind ) :
+        SvxMSConvertOCXControls ( rxModel ),
         ePageKind               ( ePKind ),
         mpPPTImporter           ( pPPTImporter ),
         mxInStrm                ( rxInStrm )
diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx
index 4e65bb9..1121572 100644
--- a/filter/source/msfilter/msocximex.cxx
+++ b/filter/source/msfilter/msocximex.cxx
@@ -28,370 +28,42 @@
 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_filter.hxx"
-
-#include <com/sun/star/uno/Any.h>
-#include <com/sun/star/text/VertOrientation.hpp>
-#include <com/sun/star/text/XText.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/text/TextContentAnchorType.hpp>
-#include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/drawing/XDrawPage.hpp>
 #include <com/sun/star/drawing/XShapes.hpp>
-#include <com/sun/star/drawing/XControlShape.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/container/XIndexContainer.hpp>
 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
 #include <com/sun/star/form/XFormsSupplier.hpp>
 #include <com/sun/star/form/XForm.hpp>
-#include <com/sun/star/form/binding/XBindableValue.hpp>
-#include <com/sun/star/form/binding/XValueBinding.hpp>
-#include <com/sun/star/form/binding/XListEntrySink.hpp>
-#include <com/sun/star/form/binding/XListEntrySource.hpp>
-#include <com/sun/star/form/FormComponentType.hpp>
-#include <com/sun/star/awt/FontWeight.hpp>
-#include <com/sun/star/awt/FontSlant.hpp>
-#include <com/sun/star/awt/FontUnderline.hpp>
-#include <com/sun/star/awt/FontStrikeout.hpp>
-#include <com/sun/star/awt/ScrollBarOrientation.hpp>
-#include <com/sun/star/style/VerticalAlignment.hpp>
-#include <comphelper/extract.hxx>
-#include <com/sun/star/awt/XControlModel.hpp>
-#include <com/sun/star/io/XInputStreamProvider.hpp>
-#include <rtl/ustrbuf.hxx>
-#include <vcl/svapp.hxx>
-#include <sfx2/objsh.hxx>
-#include <xmlscript/xmldlg_imexp.hxx>
 #include <filter/msfilter/msocximex.hxx>
-#include <osl/file.hxx>
-#include <unotools/ucbstreamhelper.hxx>
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/embed/XTransactedObject.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-#include <comphelper/processfactory.hxx> // shouldn't be needed
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
-#include <algorithm>
-#include <memory>
-#include <com/sun/star/graphic/GraphicObject.hpp>
-#include <com/sun/star/graphic/XGraphicProvider.hpp>
-#include <com/sun/star/graphic/XGraphic.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <comphelper/componentcontext.hxx>
-#include <unotools/streamwrap.hxx>
-#include <sal/macros.h>
-
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/table/XCellRange.hpp>
-#include <com/sun/star/table/CellRangeAddress.hpp>
-#include <com/sun/star/table/CellAddress.hpp>
-#include <com/sun/star/sheet/XSpreadsheetView.hpp>
-#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
-#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
-// #TODO remove this when oox is used for control/userform import
-#include <com/sun/star/util/MeasureUnit.hpp>
-#include <com/sun/star/awt/XDevice.hpp>
-#include <com/sun/star/awt/XUnitConversion.hpp>
-
-#ifndef C2U
-#define C2U(cChar)  rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(cChar))
-#endif
 
 using namespace ::com::sun::star;
 using namespace ::rtl;
-using namespace cppu;
-
-static char sWW8_form[] = "WW-Standard";
-
-sal_uInt8 const OCX_Control::aObjInfo[4] = { 0x00, 0x12, 0x03, 0x00 };
-
-long WriteAlign(SvStorageStream *pS, int nAmount)
-{
-    if (long nAlign = pS->Tell() % nAmount)
-    {
-        long nLen = nAmount - nAlign;
-        for (long i=0; i< nLen; ++i)
-            *pS << sal_uInt8(0x00);
-        return nLen;
-    }
-    return 0;
-}
-// string import/export =======================================================
-/** #117832#  import of form control names
-* control name is located in stream ("\3OCXNAME")
-* a strings in "\3OCXNAME" stream seem to be terminated by 4 trailing bytes of 0's.
-*                              ====
-* Note: If the string in the stream is overwritten by a shorter string
-* some characters from the original string may remain, the new string however
-* will still be terminated in the same way e.g. by 4 bytes with value 0.
-*/
-
-bool writeOCXNAME( const OUString& sOCXName, SvStorageStream* pStream )
-{
-    const sal_Unicode* buffer = sOCXName.getStr();
-    for ( sal_Int32 index=0; index < sOCXName.getLength(); index++ )
-    {
-        sal_uInt16 ch = static_cast< sal_uInt16 >( buffer[ index ] );
-        *pStream << ch;
-    }
-    // write
-    *pStream << sal_uInt32(0);
-    return ( SVSTREAM_OK == pStream->GetError() );
-
-}
-
-namespace {
-
-const sal_uInt32 SVX_MSOCX_SIZEMASK     = 0x7FFFFFFF;   /// Mask for character buffer size.
-const sal_uInt32 SVX_MSOCX_COMPRESSED   = 0x80000000;   /// 1 = compressed Unicode array.
-
-
-/** Returns true, if the passed length field specifies a compressed character array.
- */
-inline bool lclIsCompressed( sal_uInt32 nLenFld )
-{
-    return (nLenFld & SVX_MSOCX_COMPRESSED) != 0;
-}
-
-
-/** Extracts and returns the memory size of the character buffer.
-    @return  Character buffer size (may differ from resulting string length!).
- */
-inline sal_uInt32 lclGetBufferSize( sal_uInt32 nLenFld )
-{
-    return nLenFld & SVX_MSOCX_SIZEMASK;
-}
-
-// export ---------------------------------------------------------------------
-
-/** This class implements writing a character array from a Unicode string.
-
-    Usage:
-    1)  Construct an instance, either directly with an OUString, or with an UNO
-        Any containing an OUString.
-    2)  Check with HasData(), if there is something to write.
-    3)  Write the string length field with WriteLenField() at the right place.
-    4)  Write the encoded character array with WriteCharArray().
- */
-class SvxOcxString
-{
-public:
-    /** Constructs an empty string. String data may be set later by assignment. */
-    inline explicit             SvxOcxString() : mnLenFld( 0 ) {}
-    /** Constructs the string from the passed OUString. */
-    inline explicit             SvxOcxString( const OUString& rStr ) { Init( rStr ); }
-    /** Constructs the string from the passed UNO Any. */
-    inline explicit             SvxOcxString( const uno::Any& rAny ) { Init( rAny ); }
-
-    /** Assigns the passed string to the object. */
-    inline SvxOcxString&        operator=( const OUString& rStr ) { Init( rStr ); return *this; }
-    /** Assigns the string in the passed UNO Any to the object. */
-    inline SvxOcxString&        operator=( const uno::Any& rAny ) { Init( rAny ); return *this; }
-
-    /** Returns true, if the string contains at least one character to write. */
-    inline bool                 HasData() const { return maString.getLength() > 0; }
-
-    /** Writes the encoded 32-bit string length field. Aligns stream position to mult. of 4 before. */
-    void                        WriteLenField( SvStorageStream& rStrm ) const;
-    /** Writes the encoded character array. Aligns stream position to mult. of 4 before. */
-    void                        WriteCharArray( SvStorageStream& rStrm ) const;
-
-private:
-    inline void                 Init( const OUString& rStr ) { maString = rStr; Init(); }
-    void                        Init( const uno::Any& rAny );
-    void                        Init();
-
-    OUString                    maString;       /// The initial string data.
-    sal_uInt32                  mnLenFld;       /// The encoded string length field.
-};
-
-void SvxOcxString::Init( const uno::Any& rAny )
-{
-    if( !(rAny >>= maString) )
-        maString = OUString();
-    Init();
-}
-
-void SvxOcxString::Init()
-{
-    mnLenFld = static_cast< sal_uInt32 >( maString.getLength() );
-    bool bCompr = true;
-    // try to find a character >= 0x100 -> character array will be stored uncompressed then
-    if( const sal_Unicode* pChar = maString.getStr() )
-        for( const sal_Unicode* pEnd = pChar + maString.getLength(); bCompr && (pChar < pEnd); ++pChar )
-            bCompr = (*pChar < 0x100);
-    if( bCompr )
-        mnLenFld |= SVX_MSOCX_COMPRESSED;
-    else
-        mnLenFld *= 2;
-}
-
-void SvxOcxString::WriteLenField( SvStorageStream& rStrm ) const
-{
-    if( HasData() )
-    {
-        WriteAlign( &rStrm, 4);
-        rStrm << mnLenFld;
-    }
-}
-
-void SvxOcxString::WriteCharArray( SvStorageStream& rStrm ) const
-{
-    if( HasData() )
-    {
-        const sal_Unicode* pChar = maString.getStr();
-        const sal_Unicode* pEnd = pChar + maString.getLength();
-        bool bCompr = lclIsCompressed( mnLenFld );
-
-        WriteAlign( &rStrm, 4);
-        for( ; pChar < pEnd; ++pChar )
-        {
-            // write compressed Unicode (not encoded bytestring), or Little-Endian Unicode
-            rStrm << static_cast< sal_uInt8 >( *pChar );
-            if( !bCompr )
-                rStrm << static_cast< sal_uInt8 >( *pChar >> 8 );
-        }
-    }
-}
-
-} // namespace
-
-// ============================================================================
-
-class OCX_UserFormLabel : public OCX_Label
-{
-public:
-    OCX_UserFormLabel(OCX_Control* pParent ) : OCX_Label( pParent )
-    {
-        mnForeColor = 0x80000012L;
-        mnBackColor = 0x8000000FL;
-    }
-};
-
-
-sal_uInt16 OCX_Control::nStandardId(0x0200);
-sal_uInt16 OCX_FontData::nStandardId(0x0200);
-
-sal_uInt32 OCX_Control::pColor[25] = {
-0xC0C0C0, 0x008080, 0x000080, 0x808080, 0xC0C0C0, 0xFFFFFF, 0x000000,
-0x000000, 0x000000, 0xFFFFFF, 0xC0C0C0, 0xC0C0C0, 0x808080, 0x000080,
-0xFFFFFF, 0xC0C0C0, 0x808080, 0x808080, 0x000000, 0xC0C0C0, 0xFFFFFF,
-0x000000, 0xC0C0C0, 0x000000, 0xFFFFC0 };
-
-void OCX_Control::FillSystemColors()
-{
-    // overwrite the predefined colors with available system colors
-    const StyleSettings& rSett = Application::GetSettings().GetStyleSettings();
 
-    pColor[ 0x00 ] = rSett.GetFaceColor().GetColor();
-    pColor[ 0x01 ] = rSett.GetWorkspaceColor().GetColor();
-    pColor[ 0x02 ] = rSett.GetActiveColor().GetColor();
-    pColor[ 0x03 ] = rSett.GetDeactiveColor().GetColor();
-    pColor[ 0x04 ] = rSett.GetMenuBarColor().GetColor();
-    pColor[ 0x05 ] = rSett.GetWindowColor().GetColor();
-    pColor[ 0x07 ] = rSett.GetMenuTextColor().GetColor();
-    pColor[ 0x08 ] = rSett.GetWindowTextColor().GetColor();
-    pColor[ 0x09 ] = rSett.GetActiveTextColor().GetColor();
-    pColor[ 0x0A ] = rSett.GetActiveBorderColor().GetColor();
-    pColor[ 0x0B ] = rSett.GetDeactiveBorderColor().GetColor();
-    pColor[ 0x0C ] = rSett.GetWorkspaceColor().GetColor();
-    pColor[ 0x0D ] = rSett.GetHighlightColor().GetColor();
-    pColor[ 0x0E ] = rSett.GetHighlightTextColor().GetColor();
-    pColor[ 0x0F ] = rSett.GetFaceColor().GetColor();
-    pColor[ 0x10 ] = rSett.GetShadowColor().GetColor();
-    pColor[ 0x12 ] = rSett.GetButtonTextColor().GetColor();
-    pColor[ 0x13 ] = rSett.GetDeactiveTextColor().GetColor();
-    pColor[ 0x14 ] = rSett.GetHighlightColor().GetColor();
-    pColor[ 0x15 ] = rSett.GetDarkShadowColor().GetColor();
-    pColor[ 0x16 ] = rSett.GetShadowColor().GetColor();
-    pColor[ 0x17 ] = rSett.GetHelpTextColor().GetColor();
-    pColor[ 0x18 ] = rSett.GetHelpColor().GetColor();
-}
-
-sal_uInt8 OCX_FontData::ExportAlign(sal_Int16 nAlign) const
-{
-    sal_Int8 nRet;
-    switch (nAlign)
-    {
-    default:
-    case 0:
-        nRet = 1;
-        break;
-    case 2:
-        nRet = 2;
-        break;
-    case 1:
-        nRet = 3;
-        break;
-    }
-    return nRet;
-}
-
-sal_uInt32 OCX_Control::SwapColor(sal_uInt32 nColor) const
-{
-    sal_uInt8
-        r(static_cast<sal_uInt8>(nColor&0xFF)),
-        g(static_cast<sal_uInt8>(((nColor)>>8)&0xFF)),
-        b(static_cast<sal_uInt8>((nColor>>16)&0xFF));
-    nColor = (r<<16) + (g<<8) + b;
-    return nColor;
-}
-
-sal_uInt32 OCX_Control::ExportColor(sal_uInt32 nColor) const
-{
-    sal_uInt8 nUpper = (sal_uInt8)( nColor >> 24 );
-    if (nUpper & 0x80) //Palette color, should be switch on bottom 24 bits
-    {
-        /*Might as well use my systems ones in the absence of any other ideas*/
-        nColor = nColor&0x00FFFFFF;
-        DBG_ASSERT (nColor <= 24,"Unknown Palette Index");
-        if (nColor > 24)
-            nColor = 0xFFFFFF;
-        else
-            nColor = pColor[nColor];
-    }
+#define WW8_ASCII2STR(s) String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(s))
 
-    //Stored in bgr! rather than rgb
-    nColor = SwapColor(nColor);
-    return nColor;
-}
+static char sWW8_form[] = "WW-Standard";
 
-sal_uInt8 OCX_Control::ExportBorder(sal_uInt16 nBorder,sal_uInt8 &rBorderStyle)
-    const
+SvxMSConvertOCXControls::SvxMSConvertOCXControls( const uno::Reference< frame::XModel >& rxModel) : mxModel(rxModel)
 {
-    sal_uInt8 nRet;
-    switch(nBorder)
-    {
-        case 0:
-            nRet = rBorderStyle = 0;
-            break;
-        default:
-        case 1:
-            nRet = 2;
-            rBorderStyle = 0;
-            break;
-        case 2:
-            nRet = 0;
-            rBorderStyle = 1;
-            break;
-    }
-    return nRet;
+    OSL_ENSURE( pDocSh, "No DocShell, Cannot do Controls" );
 }
 
-sal_uInt8 OCX_Control::ExportSpecEffect( sal_Int16 nApiEffect ) const
+SvxMSConvertOCXControls::~SvxMSConvertOCXControls()
 {
-    return (nApiEffect == 2) ? 0 : 2;
 }
 
 const uno::Reference< drawing::XDrawPage >&
     SvxMSConvertOCXControls::GetDrawPage()
 {
-    if( !xDrawPage.is() && pDocSh )
+    if( !xDrawPage.is() && mxModel.is() )
     {
-        uno::Reference< drawing::XDrawPageSupplier > xTxtDoc(pDocSh->GetModel(),
+        uno::Reference< drawing::XDrawPageSupplier > xTxtDoc(mxModel,
             uno::UNO_QUERY);
-        DBG_ASSERT(xTxtDoc.is(),"XDrawPageSupplier nicht vom XModel erhalten");
+        OSL_ENSURE(xTxtDoc.is(),"no XDrawPageSupplier from XModel");
         xDrawPage = xTxtDoc->getDrawPage();
-        DBG_ASSERT( xDrawPage.is(), "XDrawPage nicht erhalten" );
+        OSL_ENSURE( xDrawPage.is(), "no XDrawPage" );
     }
 
     return xDrawPage;
@@ -401,12 +73,12 @@ const uno::Reference< drawing::XDrawPage >&
 const uno::Reference< lang::XMultiServiceFactory >&
     SvxMSConvertOCXControls::GetServiceFactory()
 {
-    if( !xServiceFactory.is() && pDocSh )
+    if( !xServiceFactory.is() && mxModel.is() )
     {
         xServiceFactory = uno::Reference< lang::XMultiServiceFactory >
-            (pDocSh->GetBaseModel(), uno::UNO_QUERY);
-        DBG_ASSERT( xServiceFactory.is(),
-                "XMultiServiceFactory nicht vom Model erhalten" );
+            (mxModel, uno::UNO_QUERY);
+        OSL_ENSURE( xServiceFactory.is(),
+                "no XMultiServiceFactory from doc Model" );
     }
 
     return xServiceFactory;
@@ -422,7 +94,7 @@ const uno::Reference< drawing::XShapes >& SvxMSConvertOCXControls::GetShapes()
 
             xShapes = uno::Reference< drawing::XShapes >(xDrawPage,
                 uno::UNO_QUERY);
-            DBG_ASSERT( xShapes.is(), "XShapes nicht vom XDrawPage erhalten" );
+            OSL_ENSURE( xShapes.is(), "UNO_QUERY failed for XShapes from XDrawPage" );
         }
     }
     return xShapes;
@@ -438,8 +110,8 @@ const uno::Reference< container::XIndexContainer >&
         {
             uno::Reference< form::XFormsSupplier > xFormsSupplier( xDrawPage,
                 uno::UNO_QUERY );
-            DBG_ASSERT( xFormsSupplier.is(),
-                    "XFormsSupplier nicht vom XDrawPage erhalten" );
+            OSL_ENSURE( xFormsSupplier.is(),
+                    "UNO_QUERY failed for XFormsSupplier from XDrawPage" );
 
             uno::Reference< container::XNameContainer >  xNameCont =
                 xFormsSupplier->getForms();
@@ -472,11 +144,11 @@ const uno::Reference< container::XIndexContainer >&
                 xFormPropSet->setPropertyValue( C2U("Name"), aTmp );
 
                 uno::Reference< form::XForm > xForm( xCreate, uno::UNO_QUERY );
-                DBG_ASSERT(xForm.is(), "keine Form?");
+                OSL_ENSURE(xForm.is(), "no Form?");
 
                 uno::Reference< container::XIndexContainer > xForms( xNameCont,
                     uno::UNO_QUERY );
-                DBG_ASSERT( xForms.is(), "XForms nicht erhalten" );
+                OSL_ENSURE( xForms.is(), "XForms not available" );
 
                 aTmp.setValue( &xForm,
                     ::getCppuType((uno::Reference < form::XForm >*)0));
@@ -491,2383 +163,4 @@ const uno::Reference< container::XIndexContainer >&
     return xFormComps;
 }
 
-sal_Bool OCX_GroupBox::Export(SvStorageRef& /* rObj */,
-    const uno::Reference< beans::XPropertySet >& /* rPropSet */,
-    const awt::Size& /* rSize */ )
-{
-    sal_Bool bRet=sal_True;
-    return bRet;
-}
-
-sal_Bool OCX_GroupBox::WriteContents(SvStorageStreamRef& /* rObj */,
-    const uno::Reference< beans::XPropertySet >& /* rPropSet */,
-    const awt::Size& /* rSize */)
-{
-    sal_Bool bRet=sal_True;
-    return bRet;
-}
-
-sal_Bool OCX_CommandButton::WriteContents(SvStorageStreamRef& rContents,
-    const uno::Reference< beans::XPropertySet >& rPropSet,
-    const awt::Size& rSize )
-{
-    sal_Bool bRet=sal_True;
-
-    sal_uInt32 nOldPos = rContents->Tell();
-    rContents->SeekRel(8);
-
-    uno::Any aTmp = rPropSet->getPropertyValue(C2U("TextColor"));
-    if (aTmp.hasValue())
-        aTmp >>= mnForeColor;
-    *rContents << ExportColor(mnForeColor);
-
-    aTmp = rPropSet->getPropertyValue(C2U("BackgroundColor"));
-    if (aTmp.hasValue())
-        aTmp >>= mnBackColor;
-    *rContents << ExportColor(mnBackColor);
-
-    aTmp = rPropSet->getPropertyValue(C2U("Enabled"));
-    fEnabled = any2bool(aTmp);
-    sal_uInt8 nTemp=0;//fEnabled;
-    if (fEnabled)
-        nTemp |= 0x02;
-    if (fBackStyle)
-        nTemp |= 0x08;
-    *rContents << nTemp;
-    *rContents << sal_uInt8(0x00);
-
-    nTemp = 0;
-    aTmp = rPropSet->getPropertyValue(C2U("MultiLine"));
-    fWordWrap = any2bool(aTmp);
-    if (fWordWrap)
-        nTemp |= 0x80;
-    *rContents << nTemp;
-    *rContents << sal_uInt8(0x00);
-
-    SvxOcxString aCaption( rPropSet->getPropertyValue(C2U("Label")) );
-    aCaption.WriteLenField( *rContents );
-    aCaption.WriteCharArray( *rContents );
-
-    WriteAlign(rContents,4);
-
-    *rContents << rSize.Width;
-    *rContents << rSize.Height;
-
-    // "take focus on click" is directly in content flags, not in option field...
-    mbTakeFocus = any2bool( rPropSet->getPropertyValue( C2U( "FocusOnClick" ) ) );
-
-    nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
-    bRet = aFontData.Export(rContents,rPropSet);
-
-    rContents->Seek(nOldPos);
-    *rContents << nStandardId;
-    *rContents << nFixedAreaLen;
-
-    sal_uInt8 nTmp = 0x27;
-    if (aCaption.HasData())
-        nTmp |= 0x08;
-    *rContents << nTmp;
-    nTmp = 0x00;
-    if( !mbTakeFocus )  // flag is set, if option is off
-        nTmp |= 0x02;
-    *rContents << nTmp;
-    *rContents << sal_uInt8(0x00);
-    *rContents << sal_uInt8(0x00);
-
-    DBG_ASSERT((rContents.Is() && (SVSTREAM_OK==rContents->GetError())),"damn");
-    return bRet;
-}
-
-
-
-sal_Bool OCX_CommandButton::Export(SvStorageRef &rObj,
-    const uno::Reference< beans::XPropertySet > &rPropSet,
-    const awt::Size &rSize)
-{
-    static sal_uInt8 const aCompObj[] = {
-            0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
-            0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x32, 0x05, 0xD7,
-            0x69, 0xCE, 0xCD, 0x11, 0xA7, 0x77, 0x00, 0xDD,
-            0x01, 0x14, 0x3C, 0x57, 0x22, 0x00, 0x00, 0x00,
-            0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
-            0x74, 0x20, 0x46, 0x6F, 0x72, 0x6d, 0x73, 0x20,
-            0x32, 0x2e, 0x30, 0x20, 0x43, 0x6F, 0x6D, 0x6D,
-            0x61, 0x6E, 0x64, 0x42, 0x75, 0x74, 0x74, 0x6F,
-            0x6E, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D,
-            0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F,
-            0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x16, 0x00,
-            0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E,
-            0x43, 0x6F, 0x6D, 0x6D, 0x61, 0x6E, 0x64, 0x42,
-            0x75, 0x74, 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00,
-            0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
-            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-        };
-
-    {
-    SvStorageStreamRef xStor( rObj->OpenSotStream( C2U("\1CompObj")));
-    xStor->Write(aCompObj,sizeof(aCompObj));
-    DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
-    }
-
-    {
-    SvStorageStreamRef xStor3( rObj->OpenSotStream( C2U("\3ObjInfo")));
-    xStor3->Write(aObjInfo,sizeof(aObjInfo));
-    DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
-    }
-
-    static sal_uInt8 const aOCXNAME[] = {
-        0x43, 0x00, 0x6F, 0x00, 0x6D, 0x00, 0x6D, 0x00,
-        0x61, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x42, 0x00,
-        0x75, 0x00, 0x74, 0x00, 0x74, 0x00, 0x6F, 0x00,
-        0x6E, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00
-    };
-
-    {
-    SvStorageStreamRef xStor2( rObj->OpenSotStream( C2U("\3OCXNAME")));
-    xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
-    DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
-    }
-
-    SvStorageStreamRef xContents( rObj->OpenSotStream( C2U("contents")));
-
-    return WriteContents(xContents,rPropSet,rSize);
-}
-
-sal_Bool OCX_ImageButton::WriteContents(SvStorageStreamRef &rContents,
-    const uno::Reference< beans::XPropertySet > &rPropSet,
-    const awt::Size &rSize)
-{
-    sal_Bool bRet=sal_True;
-
-    sal_uInt32 nOldPos = rContents->Tell();
-    rContents->SeekRel(8);
-
-    uno::Any aTmp=rPropSet->getPropertyValue(C2U("BackgroundColor"));
-    if (aTmp.hasValue())
-        aTmp >>= mnBackColor;
-    *rContents << ExportColor(mnBackColor);
-
-    aTmp = rPropSet->getPropertyValue(C2U("Enabled"));
-    fEnabled = any2bool(aTmp);
-    sal_uInt8 nTemp=0;//fEnabled;
-    if (fEnabled)
-        nTemp |= 0x02;
-    *rContents << nTemp;
-    *rContents << sal_uInt8(0x00);
-    *rContents << sal_uInt8(0x00);
-    *rContents << sal_uInt8(0x00);
-
-    WriteAlign(rContents,4);
-
-    *rContents << rSize.Width;
-    *rContents << rSize.Height;
-
-    nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
-    bRet = aFontData.Export(rContents,rPropSet);
-
-    rContents->Seek(nOldPos);
-    *rContents << nStandardId;
-    *rContents << nFixedAreaLen;
-
-    sal_uInt8 nTmp = 0x26;
-    *rContents << nTmp;
-    *rContents << sal_uInt8(0x00);
-    *rContents << sal_uInt8(0x00);
-    *rContents << sal_uInt8(0x00);
-
-    DBG_ASSERT((rContents.Is() && (SVSTREAM_OK==rContents->GetError())),"damn");
-    return bRet;
-}
-
-
-
-sal_Bool OCX_ImageButton::Export(SvStorageRef &rObj,
-    const uno::Reference< beans::XPropertySet > &rPropSet,
-    const awt::Size &rSize)
-{
-    static sal_uInt8 const aCompObj[] = {
-            0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
-            0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x32, 0x05, 0xD7,
-            0x69, 0xCE, 0xCD, 0x11, 0xA7, 0x77, 0x00, 0xDD,
-            0x01, 0x14, 0x3C, 0x57, 0x22, 0x00, 0x00, 0x00,
-            0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
-            0x74, 0x20, 0x46, 0x6F, 0x72, 0x6d, 0x73, 0x20,
-            0x32, 0x2e, 0x30, 0x20, 0x43, 0x6F, 0x6D, 0x6D,
-            0x61, 0x6E, 0x64, 0x42, 0x75, 0x74, 0x74, 0x6F,
-            0x6E, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D,
-            0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F,
-            0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x16, 0x00,
-            0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E,
-            0x43, 0x6F, 0x6D, 0x6D, 0x61, 0x6E, 0x64, 0x42,
-            0x75, 0x74, 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00,
-            0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
-            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-        };
-
-    {
-    SvStorageStreamRef xStor( rObj->OpenSotStream( C2U("\1CompObj")));
-    xStor->Write(aCompObj,sizeof(aCompObj));
-    DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
-    }
-
-    {
-    SvStorageStreamRef xStor3( rObj->OpenSotStream( C2U("\3ObjInfo")));
-    xStor3->Write(aObjInfo,sizeof(aObjInfo));
-    DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
-    }
-
-    static sal_uInt8 const aOCXNAME[] = {
-        0x43, 0x00, 0x6F, 0x00, 0x6D, 0x00, 0x6D, 0x00,
-        0x61, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x42, 0x00,
-        0x75, 0x00, 0x74, 0x00, 0x74, 0x00, 0x6F, 0x00,
-        0x6E, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00
-    };
-
-    {
-    SvStorageStreamRef xStor2( rObj->OpenSotStream( C2U("\3OCXNAME")));
-    xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
-    DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
-    }
-
-    SvStorageStreamRef xContents( rObj->OpenSotStream( C2U("contents")));
-    return WriteContents(xContents,rPropSet,rSize);
-}
-
-bool lcl_isNamedRange( const rtl::OUString& sAddress, uno::Reference< frame::XModel >& xModel, table::CellRangeAddress& aAddress )
-{
-    bool bRes = false;
-    const static rtl::OUString sNamedRanges( RTL_CONSTASCII_USTRINGPARAM("NamedRanges"));
-    uno::Reference< sheet::XCellRangeReferrer > xReferrer;
-    try
-    {
-        uno::Reference< beans::XPropertySet > xPropSet( xModel, uno::UNO_QUERY_THROW );
-        uno::Reference< container::XNameAccess > xNamed( xPropSet->getPropertyValue( sNamedRanges ), uno::UNO_QUERY_THROW );
-        xReferrer.set ( xNamed->getByName( sAddress ), uno::UNO_QUERY );
-    }
-    catch( uno::Exception& /*e*/ )
-    {
-        // do nothing
-    }
-    if ( xReferrer.is() )
-    {
-        uno::Reference< sheet::XCellRangeAddressable > xRangeAddressable( xReferrer->getReferredCells(), uno::UNO_QUERY );
-        if ( xRangeAddressable.is() )
-        {
-            aAddress = xRangeAddressable->getRangeAddress();
-            bRes = true;
-        }
-    }
-    return bRes;
-}
-
-void lcl_ApplyListSourceAndBindableStuff( uno::Reference< frame::XModel >& xModel, const uno::Reference< beans::XPropertySet >& rPropSet, const rtl::OUString& rsCtrlSource, const rtl::OUString& rsRowSource )
-{
-// XBindable etc.
-    uno::Reference< lang::XMultiServiceFactory > xFac;
-    if ( xModel.is() )
-        xFac.set( xModel, uno::UNO_QUERY );
-    uno::Reference< form::binding::XBindableValue > xBindable( rPropSet, uno::UNO_QUERY );
-    if (  xFac.is() && rsCtrlSource.getLength() && xBindable.is() )
-    {
-
-         // OOo address structures
-         // RefCell - convert from XL
-         // pretend we converted the imported string address into the
-         // appropriate address structure
-         uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( C2U( "com.sun.star.table.CellAddressConversion" )), uno::UNO_QUERY );
-         table::CellAddress aAddress;
-         if ( xConvertor.is() )
-         {
-             // we need this service to properly convert XL notation also
-             // Should be easy to extend
-             xConvertor->setPropertyValue( C2U( "XL_A1_Representation" ), uno::makeAny( rsCtrlSource ) );
-             xConvertor->getPropertyValue( C2U( "Address" ) ) >>= aAddress;
-         }
-
-         beans::NamedValue aArg1;
-         aArg1.Name = C2U("BoundCell");
-         aArg1.Value <<= aAddress;
-
-         uno::Sequence< uno::Any > aArgs(1);
-         aArgs[ 0 ]  <<= aArg1;
-
-         uno::Reference< form::binding::XValueBinding > xBinding( xFac->createInstanceWithArguments( C2U("com.sun.star.table.CellValueBinding" ), aArgs ), uno::UNO_QUERY );
-         xBindable->setValueBinding( xBinding );
-    }
-    uno::Reference< form::binding::XListEntrySink > xListEntrySink( rPropSet, uno::UNO_QUERY );
-    if (  xFac.is() && rsRowSource.getLength() && xListEntrySink.is() )
-    {
-
-         // OOo address structures
-         // RefCell - convert from XL
-         // pretend we converted the imported string address into the
-         // appropriate address structure
-         uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( C2U( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY );
-         table::CellRangeAddress aAddress;
-         if ( xConvertor.is() )
-         {
-             if ( !lcl_isNamedRange( rsRowSource, xModel, aAddress ) )
-             {
-                 // we need this service to properly convert XL notation also
-                 // Should be easy to extend
-                 xConvertor->setPropertyValue( C2U( "XL_A1_Representation" ), uno::makeAny( rsRowSource ) );
-                 xConvertor->getPropertyValue( C2U( "Address" ) ) >>= aAddress;
-             }
-         }
-
-         beans::NamedValue aArg1;
-         aArg1.Name = C2U("CellRange");
-         aArg1.Value <<= aAddress;
-
-         uno::Sequence< uno::Any > aArgs(1);
-         aArgs[ 0 ]  <<= aArg1;
-
-         uno::Reference< form::binding::XListEntrySource > xSource( xFac->createInstanceWithArguments( C2U("com.sun.star.table.CellRangeListSource" ), aArgs ), uno::UNO_QUERY );
-         xListEntrySink->setListEntrySource( xSource );
-    }
-}
-
-sal_Bool OCX_OptionButton::WriteContents(SvStorageStreamRef &rContents,
-    const uno::Reference< beans::XPropertySet > &rPropSet,
-    const awt::Size &rSize)
-{
-    sal_Bool bRet=sal_True;
-
-    sal_uInt32 nOldPos = rContents->Tell();
-    rContents->SeekRel(12);
-
-    pBlockFlags[0] = 0;
-    pBlockFlags[1] = 0x01;
-    pBlockFlags[2] = 0;
-    pBlockFlags[3] = 0x80;
-    pBlockFlags[4] = 0;
-    pBlockFlags[5] = 0;
-    pBlockFlags[6] = 0;
-    pBlockFlags[7] = 0;
-
-    uno::Any aTmp = rPropSet->getPropertyValue(C2U("Enabled"));
-    fEnabled = any2bool(aTmp);
-
-    aTmp = rPropSet->getPropertyValue(C2U("BackgroundColor"));
-    if (aTmp.hasValue())
-        aTmp >>= mnBackColor;
-    else
-        fBackStyle = 0;
-
-    sal_uInt8 nTemp=0;//=fEnabled;
-    if (fEnabled)
-        nTemp |= 0x02;
-    if (fBackStyle)
-        nTemp |= 0x08;
-    *rContents << nTemp;
-    pBlockFlags[0] |= 0x01;
-    *rContents << sal_uInt8(0x00);
-    nTemp = 0;
-    aTmp = rPropSet->getPropertyValue(C2U("MultiLine"));
-    fWordWrap = any2bool(aTmp);
-    if (fWordWrap)
-        nTemp |= 0x80;
-    *rContents << nTemp;
-    *rContents << sal_uInt8(0x00);
-
-    *rContents << ExportColor(mnBackColor);
-    pBlockFlags[0] |= 0x02;
-
-    aTmp = rPropSet->getPropertyValue(C2U("TextColor"));
-    if (aTmp.hasValue())
-        aTmp >>= mnForeColor;
-    *rContents << ExportColor(mnForeColor);
-    pBlockFlags[0] |= 0x04;
-
-    nStyle = 5;
-    *rContents << nStyle;
-    pBlockFlags[0] |= 0x40;
-
-    WriteAlign(rContents,4);
-    nValueLen = 1|SVX_MSOCX_COMPRESSED;
-    aTmp = rPropSet->getPropertyValue(C2U("DefaultState"));
-    sal_Int16 nDefault = sal_Int16();
-    aTmp >>= nDefault;
-    *rContents << nValueLen;
-    pBlockFlags[2] |= 0x40;
-
-
-    SvxOcxString aCaption( rPropSet->getPropertyValue(C2U("Label")) );
-    if (aCaption.HasData())
-        pBlockFlags[2] |= 0x80;
-    aCaption.WriteLenField( *rContents );
-
-    aTmp = rPropSet->getPropertyValue(C2U("VisualEffect"));
-    if (aTmp.hasValue())
-    {
-        sal_Int16 nApiSpecEffect = sal_Int16();
-        aTmp >>= nApiSpecEffect;
-        nSpecialEffect = ExportSpecEffect( nApiSpecEffect );
-    }
-    *rContents << nSpecialEffect;
-    pBlockFlags[3] |= 0x04;
-
-    WriteAlign(rContents,4);
-    *rContents << rSize.Width;
-    *rContents << rSize.Height;
-
-    nDefault += 0x30;
-    *rContents << sal_uInt8(nDefault);
-    *rContents << sal_uInt8(0x00);
-
-    aCaption.WriteCharArray( *rContents );
-
-    WriteAlign(rContents,4);
-    nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-    bRet = aFontData.Export(rContents,rPropSet);
-
-    rContents->Seek(nOldPos);
-    *rContents << nStandardId;
-    *rContents << nFixedAreaLen;
-
-    *rContents << pBlockFlags[0];
-    *rContents << pBlockFlags[1];
-    *rContents << pBlockFlags[2];
-    *rContents << pBlockFlags[3];
-    *rContents << pBlockFlags[4];
-    *rContents << pBlockFlags[5];
-    *rContents << pBlockFlags[6];
-    *rContents << pBlockFlags[7];
-
-    DBG_ASSERT((rContents.Is() &&
-        (SVSTREAM_OK==rContents->GetError())),"damn");
-    return bRet;
-}
-
-
-
-sal_Bool OCX_OptionButton::Export(SvStorageRef &rObj,
-    const uno::Reference< beans::XPropertySet > &rPropSet,
-    const awt::Size &rSize)
-{
-    static sal_uInt8 const aCompObj[] = {
-        0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
-        0xFF, 0xFF, 0xFF, 0xFF, 0x50, 0x1D, 0xD2, 0x8B,
-        0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
-        0x00, 0x60, 0x02, 0xF3, 0x21, 0x00, 0x00, 0x00,
-        0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
-        0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
-        0x32, 0x2E, 0x30, 0x20, 0x4F, 0x70, 0x74, 0x69,
-        0x6F, 0x6E, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E,
-        0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D, 0x62,
-        0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F, 0x62,
-        0x6A, 0x65, 0x63, 0x74, 0x00, 0x15, 0x00, 0x00,
-        0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E, 0x4F,
-        0x70, 0x74, 0x69, 0x6F, 0x6E, 0x42, 0x75, 0x74,
-        0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00, 0xF4, 0x39,
-        0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-        };
-
-    {
-    SvStorageStreamRef xStor( rObj->OpenSotStream( C2U("\1CompObj")));
-    xStor->Write(aCompObj,sizeof(aCompObj));
-    DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
-    }
-
-    {
-    SvStorageStreamRef xStor3( rObj->OpenSotStream( C2U("\3ObjInfo")));
-    xStor3->Write(aObjInfo,sizeof(aObjInfo));
-    DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
-    }
-
-    static sal_uInt8 const aOCXNAME[] = {
-            0x4F, 0x00, 0x70, 0x00, 0x74, 0x00, 0x69, 0x00,
-            0x6F, 0x00, 0x6E, 0x00, 0x42, 0x00, 0x75, 0x00,
-            0x74, 0x00, 0x74, 0x00, 0x6F, 0x00, 0x6E, 0x00,
-            0x31, 0x00, 0x00, 0x00, 0x00, 0x00
-            };
-
-    {
-    SvStorageStreamRef xStor2( rObj->OpenSotStream( C2U("\3OCXNAME")));
-    xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
-    DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
-    }
-
-    SvStorageStreamRef xContents( rObj->OpenSotStream( C2U("contents")));
-    return WriteContents(xContents, rPropSet, rSize);
-}
-
-sal_Bool OCX_TextBox::WriteContents(SvStorageStreamRef &rContents,
-    const uno::Reference< beans::XPropertySet > &rPropSet,
-    const awt::Size &rSize)
-{
-    sal_Bool bRet=sal_True;
-    sal_uInt32 nOldPos = rContents->Tell();
-    rContents->SeekRel(12);
-
-    pBlockFlags[0] = 0;
-    pBlockFlags[1] = 0x01;
-    pBlockFlags[2] = 0x00;
-    pBlockFlags[3] = 0x80;
-    pBlockFlags[4] = 0;
-    pBlockFlags[5] = 0;
-    pBlockFlags[6] = 0;
-    pBlockFlags[7] = 0;
-
-
-    sal_uInt8 nTemp=0x19;
-    uno::Any aTmp = rPropSet->getPropertyValue(C2U("Enabled"));
-    fEnabled = any2bool(aTmp);
-    if (fEnabled)
-        nTemp |= 0x02;
-
-    aTmp = rPropSet->getPropertyValue(C2U("ReadOnly"));
-    fLocked = any2bool(aTmp);
-    if (fLocked)
-        nTemp |= 0x04;
-
-    *rContents << nTemp;
-    pBlockFlags[0] |= 0x01;
-    *rContents << sal_uInt8(0x48);
-    *rContents << sal_uInt8(0x80);
-
-    fMultiLine = any2bool(rPropSet->getPropertyValue(C2U("MultiLine")));
-    fHideSelection = any2bool(rPropSet->getPropertyValue(C2U("HideInactiveSelection")));
-    nTemp = 0x0C;
-    if (fMultiLine)
-        nTemp |= 0x80;
-    if( fHideSelection )
-        nTemp |= 0x20;
-    *rContents << nTemp;
-
-    aTmp = rPropSet->getPropertyValue(C2U("BackgroundColor"));
-    if (aTmp.hasValue())
-        aTmp >>= mnBackColor;
-    *rContents << ExportColor(mnBackColor);
-    pBlockFlags[0] |= 0x02;
-
-    aTmp = rPropSet->getPropertyValue(C2U("TextColor"));
-    if (aTmp.hasValue())
-        aTmp >>= mnForeColor;
-    *rContents << ExportColor(mnForeColor);
-    pBlockFlags[0] |= 0x04;
-
-    aTmp = rPropSet->getPropertyValue( C2U("MaxTextLen"));
-    aTmp >>= nMaxLength;
-    *rContents << nMaxLength;
-    pBlockFlags[0] |= 0x08;
-
-    aTmp = rPropSet->getPropertyValue(C2U("Border"));
-    sal_Int16 nBorder = sal_Int16();
-    aTmp >>= nBorder;
-    nSpecialEffect = ExportBorder(nBorder,nBorderStyle);
-    *rContents << nBorderStyle;
-    pBlockFlags[0] |= 0x10;
-
-    aTmp = rPropSet->getPropertyValue( C2U("HScroll"));
-    sal_Bool bTemp1 = any2bool(aTmp);
-    aTmp = rPropSet->getPropertyValue( C2U("VScroll"));
-    sal_Bool bTemp2 = any2bool(aTmp);
-    if (!bTemp1 && !bTemp2)
-        nScrollBars =0;
-    else if (bTemp1 && bTemp2)
-        nScrollBars = 3;
-    else if (!bTemp1 && bTemp2)
-        nScrollBars = 2;
-    else
-        nScrollBars = 1;
-    *rContents << nScrollBars;
-    pBlockFlags[0] |= 0x20;
-
-    aTmp = rPropSet->getPropertyValue(C2U("EchoChar"));
-    sal_uInt16 nTmp = sal_uInt16();
-    aTmp >>= nTmp;
-    nPasswordChar = static_cast<sal_uInt8>(nTmp);
-    *rContents << nPasswordChar;
-    pBlockFlags[1] |= 0x02;
-
-    SvxOcxString aValue( rPropSet->getPropertyValue(C2U("DefaultText")) );
-    aValue.WriteLenField( *rContents );
-    if (aValue.HasData())
-        pBlockFlags[2] |= 0x40;
-
-    WriteAlign(rContents,4);
-    aTmp = rPropSet->getPropertyValue(C2U("BorderColor"));
-    if (aTmp.hasValue())
-        aTmp >>= nBorderColor;
-    *rContents << ExportColor(nBorderColor);
-    pBlockFlags[3] |= 0x02;
-
-    *rContents << nSpecialEffect;
-    pBlockFlags[3] |= 0x04;
-
-    WriteAlign(rContents,4);
-    *rContents << rSize.Width;
-    *rContents << rSize.Height;
-
-    aValue.WriteCharArray( *rContents );
-
-    WriteAlign(rContents,4);
-
-    nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
-    bRet = aFontData.Export(rContents,rPropSet);
-
-    rContents->Seek(nOldPos);
-    *rContents << nStandardId;
-    *rContents << nFixedAreaLen;
-
-    *rContents << pBlockFlags[0];
-    *rContents << pBlockFlags[1];
-    *rContents << pBlockFlags[2];
-    *rContents << pBlockFlags[3];
-    *rContents << pBlockFlags[4];
-    *rContents << pBlockFlags[5];
-    *rContents << pBlockFlags[6];
-    *rContents << pBlockFlags[7];
-
-    DBG_ASSERT((rContents.Is() &&
-        (SVSTREAM_OK == rContents->GetError())),"damn");
-    return bRet;
-}
-
-
-sal_Bool OCX_TextBox::Export(SvStorageRef &rObj,
-    const uno::Reference< beans::XPropertySet > &rPropSet,
-    const awt::Size &rSize)
-{
-    static sal_uInt8 const aCompObj[] = {
-        0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
-        0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x1D, 0xD2, 0x8B,
-        0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
-        0x00, 0x60, 0x02, 0xF3, 0x1C, 0x00, 0x00, 0x00,
-        0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
-        0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
-        0x32, 0x2E, 0x30, 0x20, 0x54, 0x65, 0x78, 0x74,
-        0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, 0x00,
-        0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64,
-        0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00,
-        0x10, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D,
-        0x73, 0x2E, 0x54, 0x65, 0x78, 0x74, 0x42, 0x6F,
-        0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00
-        };
-
-    {
-    SvStorageStreamRef xStor( rObj->OpenSotStream( C2U("\1CompObj")));
-    xStor->Write(aCompObj,sizeof(aCompObj));
-    DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
-    }
-
-    {
-    SvStorageStreamRef xStor3( rObj->OpenSotStream( C2U("\3ObjInfo")));
-    xStor3->Write(aObjInfo,sizeof(aObjInfo));
-    DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
-    }
-
-    static sal_uInt8 const aOCXNAME[] = {
-        0x54, 0x00, 0x65, 0x00, 0x78, 0x00, 0x74, 0x00,
-        0x42, 0x00, 0x6F, 0x00, 0x78, 0x00, 0x31, 0x00,
-        0x00, 0x00, 0x00, 0x00
-        };
-
-    {
-    SvStorageStreamRef xStor2( rObj->OpenSotStream( C2U("\3OCXNAME")));
-    xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
-    DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
-    }
-
-    SvStorageStreamRef xContents( rObj->OpenSotStream( C2U("contents")));
-    return WriteContents(xContents, rPropSet, rSize);
-}
-
-sal_Bool OCX_FieldControl::WriteContents(SvStorageStreamRef &rContents,
-    const uno::Reference< beans::XPropertySet > &rPropSet,
-    const awt::Size &rSize)
-{
-    sal_Bool bRet=sal_True;
-    sal_uInt32 nOldPos = rContents->Tell();
-    rContents->SeekRel(12);
-
-    pBlockFlags[0] = 0;
-    pBlockFlags[1] = 0x01;
-    pBlockFlags[2] = 0x00;
-    pBlockFlags[3] = 0x80;
-    pBlockFlags[4] = 0;
-    pBlockFlags[5] = 0;
-    pBlockFlags[6] = 0;
-    pBlockFlags[7] = 0;
-
-
-    sal_uInt8 nTemp=0x19;
-    uno::Any aTmp = rPropSet->getPropertyValue(C2U("Enabled"));
-    fEnabled = any2bool(aTmp);
-    if (fEnabled)
-        nTemp |= 0x02;
-
-    aTmp = rPropSet->getPropertyValue(C2U("ReadOnly"));
-    fLocked = any2bool(aTmp);
-    if (fLocked)
-        nTemp |= 0x04;
-
-    *rContents << nTemp;
-    pBlockFlags[0] |= 0x01;
-    *rContents << sal_uInt8(0x48);
-    *rContents << sal_uInt8(0x80);
-
-    nTemp = 0x2C;
-    *rContents << nTemp;
-
-    aTmp = rPropSet->getPropertyValue(C2U("BackgroundColor"));
-    if (aTmp.hasValue())
-        aTmp >>= mnBackColor;
-    *rContents << ExportColor(mnBackColor);
-    pBlockFlags[0] |= 0x02;
-
-    aTmp = rPropSet->getPropertyValue(C2U("TextColor"));
-    if (aTmp.hasValue())
-        aTmp >>= mnForeColor;
-    *rContents << ExportColor(mnForeColor);
-    pBlockFlags[0] |= 0x04;
-
-    aTmp = rPropSet->getPropertyValue(C2U("Border"));
-    sal_Int16 nBorder = sal_Int16();
-    aTmp >>= nBorder;
-    nSpecialEffect = ExportBorder(nBorder,nBorderStyle);
-    *rContents << nBorderStyle;
-    pBlockFlags[0] |= 0x10;
-
-#if 0 //Each control has a different Value format, and how to convert each to text has to be found out
-    SvxOcxString aValue( rPropSet->getPropertyValue(C2U("DefaultText")) );
-    aValue.WriteLenField( *rContents );
-    if (aValue.HasData())
-        pBlockFlags[2] |= 0x40;
-#endif
-
-    *rContents << nSpecialEffect;
-    pBlockFlags[3] |= 0x04;
-
-    WriteAlign(rContents,4);
-    *rContents << rSize.Width;
-    *rContents << rSize.Height;
-
-#if 0
-    aValue.WriteCharArray( *rContents );
-#endif
-
-    WriteAlign(rContents,4);
-
-    nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
-
-    bRet = aFontData.Export(rContents,rPropSet);
-
-    rContents->Seek(nOldPos);
-    *rContents << nStandardId;
-    *rContents << nFixedAreaLen;
-
-    *rContents << pBlockFlags[0];
-    *rContents << pBlockFlags[1];
-    *rContents << pBlockFlags[2];
-    *rContents << pBlockFlags[3];
-    *rContents << pBlockFlags[4];
-    *rContents << pBlockFlags[5];
-    *rContents << pBlockFlags[6];
-    *rContents << pBlockFlags[7];
-
-    DBG_ASSERT((rContents.Is() &&
-        (SVSTREAM_OK==rContents->GetError())),"damn");
-    return bRet;
-}
-
-sal_Bool OCX_FieldControl::Export(SvStorageRef &rObj,
-    const uno::Reference< beans::XPropertySet > &rPropSet,
-    const awt::Size &rSize)
-{
-    static sal_uInt8 const aCompObj[] = {
-        0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
-        0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x1D, 0xD2, 0x8B,
-        0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
-        0x00, 0x60, 0x02, 0xF3, 0x1C, 0x00, 0x00, 0x00,
-        0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
-        0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
-        0x32, 0x2E, 0x30, 0x20, 0x54, 0x65, 0x78, 0x74,
-        0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, 0x00,
-        0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64,
-        0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00,
-        0x10, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D,
-        0x73, 0x2E, 0x54, 0x65, 0x78, 0x74, 0x42, 0x6F,
-        0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00
-        };
-
-    {
-    SvStorageStreamRef xStor( rObj->OpenSotStream( C2U("\1CompObj")));
-    xStor->Write(aCompObj,sizeof(aCompObj));
-    DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
-    }
-
-    {
-    SvStorageStreamRef xStor3( rObj->OpenSotStream( C2U("\3ObjInfo")));
-    xStor3->Write(aObjInfo,sizeof(aObjInfo));
-    DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
-    }
-
-    static sal_uInt8 const aOCXNAME[] = {
-        0x54, 0x00, 0x65, 0x00, 0x78, 0x00, 0x74, 0x00,
-        0x42, 0x00, 0x6F, 0x00, 0x78, 0x00, 0x31, 0x00,
-        0x00, 0x00, 0x00, 0x00
-        };
-
-    {
-    SvStorageStreamRef xStor2( rObj->OpenSotStream( C2U("\3OCXNAME")));
-    xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
-    DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
-    }
-
-    SvStorageStreamRef xContents( rObj->OpenSotStream( C2U("contents")));
-    return WriteContents(xContents, rPropSet, rSize);
-}
-
-sal_Bool OCX_ToggleButton::Export(
-    SvStorageRef &rObj, const uno::Reference< beans::XPropertySet> &rPropSet,
-    const awt::Size& rSize )
-{
-    static sal_uInt8 const aCompObj[] = {
-            0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
-            0xFF, 0xFF, 0xFF, 0xFF, 0x60, 0x1D, 0xD2, 0x8B,
-            0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA,
-            0x00, 0x60, 0x02, 0xF3, 0x21, 0x00, 0x00, 0x00,
-            0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66,
-            0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20,
-            0x32, 0x2E, 0x30, 0x20, 0x54, 0x6F, 0x67, 0x67,
-            0x6C, 0x65, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E,
-            0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D, 0x62,
-            0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F, 0x62,
-            0x6A, 0x65, 0x63, 0x74, 0x00, 0x15, 0x00, 0x00,
-            0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E, 0x54,
-            0x6F, 0x67, 0x67, 0x6C, 0x65, 0x42, 0x75, 0x74,
-            0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00, 0xF4, 0x39,
-            0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-            0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-        };
-
-    {
-    SvStorageStreamRef xStor( rObj->OpenSotStream( C2U("\1CompObj")));
-    xStor->Write(aCompObj,sizeof(aCompObj));
-    DBG_ASSERT((xStor.Is() && (SVSTREAM_OK == xStor->GetError())),"damn");
-    }
-
-    {
-    SvStorageStreamRef xStor3( rObj->OpenSotStream( C2U("\3ObjInfo")));
-    xStor3->Write(aObjInfo,sizeof(aObjInfo));
-    DBG_ASSERT((xStor3.Is() && (SVSTREAM_OK == xStor3->GetError())),"damn");
-    }
-
-    static sal_uInt8 const aOCXNAME[] = {
-        0x54, 0x00, 0x6F, 0x00, 0x67, 0x00, 0x67, 0x00,
-        0x6C, 0x00, 0x65, 0x00, 0x42, 0x00, 0x75, 0x00,
-        0x74, 0x00, 0x74, 0x00, 0x6F, 0x00, 0x6E, 0x00,
-        0x31, 0x00, 0x00, 0x00, 0x00, 0x00
-    };
-
-    {
-    SvStorageStreamRef xStor2( rObj->OpenSotStream( C2U("\3OCXNAME")));
-    xStor2->Write(aOCXNAME,sizeof(aOCXNAME));
-    DBG_ASSERT((xStor2.Is() && (SVSTREAM_OK == xStor2->GetError())),"damn");
-    }
-
-    SvStorageStreamRef xContents( rObj->OpenSotStream( C2U("contents")));
-
-    return WriteContents(xContents,rPropSet,rSize);
-}
-
-sal_Bool OCX_ToggleButton::WriteContents(SvStorageStreamRef &rContents,
-    const uno::Reference< beans::XPropertySet > &rPropSet,
-    const awt::Size &rSize)
-{
-    sal_Bool bRet=sal_True;
-    sal_uInt32 nOldPos = rContents->Tell();
-    rContents->SeekRel(12);
-
-    pBlockFlags[0] = 0;
-    pBlockFlags[1] = 0x01;
-    pBlockFlags[2] = 0;
-    pBlockFlags[3] = 0x80;
-    pBlockFlags[4] = 0;
-    pBlockFlags[5] = 0;
-    pBlockFlags[6] = 0;
-    pBlockFlags[7] = 0;
-
-    uno::Any aTmp = rPropSet->getPropertyValue(C2U("Enabled"));
-    fEnabled = any2bool(aTmp);
-
-    sal_uInt8 nTemp=fEnabled;
-    if (fEnabled)
-        nTemp = nTemp << 1;
-    if (fBackStyle)
-        nTemp |= 0x08;
-    *rContents << nTemp;
-    pBlockFlags[0] |= 0x01;
-    *rContents << sal_uInt8(0x00);
-    nTemp = 0;
-    aTmp = rPropSet->getPropertyValue(C2U("MultiLine"));
-    fWordWrap = any2bool(aTmp);
-    if (fWordWrap)
-        nTemp |= 0x80;
-    *rContents << nTemp;
-    *rContents << sal_uInt8(0x00);
-
-    aTmp = rPropSet->getPropertyValue(C2U("BackgroundColor"));
-    if (aTmp.hasValue())
-        aTmp >>= mnBackColor;
-    *rContents << ExportColor(mnBackColor);
-    pBlockFlags[0] |= 0x02;
-
-    aTmp = rPropSet->getPropertyValue(C2U("TextColor"));
-    if (aTmp.hasValue())
-        aTmp >>= mnForeColor;
-    *rContents << ExportColor(mnForeColor);
-    pBlockFlags[0] |= 0x04;
-
-    nStyle = 6;
-    *rContents << nStyle;
-    pBlockFlags[0] |= 0x40;
-
-    WriteAlign(rContents,4);
-    nValueLen = 1|SVX_MSOCX_COMPRESSED;
-    bool bDefault = false;
-    rPropSet->getPropertyValue(C2U("DefaultState")) >>= bDefault;
-    sal_uInt8 nDefault = static_cast< sal_uInt8 >( bDefault ? '1' : '0' );
-    *rContents << nValueLen;
-    pBlockFlags[2] |= 0x40;
-

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list