[ooo-build-commit] .: patches/dev300 patches/vba

Noel Power noelp at kemper.freedesktop.org
Mon Jul 5 13:25:47 PDT 2010


 patches/dev300/apply                        |    3 
 patches/vba/vba-container-controls.diff     | 8366 +++++++++++++---------------
 patches/vba/vba-containercontrol-extra.diff |  434 +
 3 files changed, 4393 insertions(+), 4410 deletions(-)

New commits:
commit 7c4a910c4f8ac2fd22fe277e386e995098df3f1e
Author: Noel Power <noel.power at novell.com>
Date:   Mon Jul 5 21:25:51 2010 +0100

    container control cws stuff ( and additional bits to adapt for ooobuild )
    
    * patches/dev300/apply:
    * patches/vba/vba-container-controls.diff:
    * patches/vba/vba-containercontrol-extra.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 57e1874..d4d5172 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1583,6 +1583,9 @@ cws-vbasupportdev300_m83.diff, noelpwer
 # FIXME noelp: can you check that one?
 cws-vbasupportdev300_m83-fix.diff, cbosdo
 vba-enable-fieldrelatedbits.diff
+vba-container-controls.diff
+# need to adapt ooo-build wrt the changes intorduced into container_controls
+oox-projectname-oobuild-specifix.diff
 # container controls
 # Note: the fixme's below should be already integrated into the 
 # next generated diff for the cws ( e.g. container_controls )
diff --git a/patches/vba/vba-container-controls.diff b/patches/vba/vba-container-controls.diff
index a5daff2..860bb7a 100644
--- a/patches/vba/vba-container-controls.diff
+++ b/patches/vba/vba-container-controls.diff
@@ -1,61 +1,78 @@
-From f0936c5417ba19a28eaf6cb1b8055fdab3783df8 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 17:00:13 +0200
-Subject: [PATCH 400/878] vba-container-controls.diff
-
----
- basic/source/uno/dlgcont.cxx                       |   80 +
- .../source/propctrlr/formcomponenthandler.cxx      |    5 +-
- scripting/source/dlgprov/dlgevtatt.cxx             |   74 +-
- scripting/source/dlgprov/dlgevtatt.hxx             |    1 +
- scripting/source/vbaevents/eventhelper.cxx         |   18 +-
- svx/inc/svx/msocximex.hxx                          |  368 +---
- svx/source/msfilter/msocximex.cxx                  | 2258 ++++++++++----------
- toolkit/inc/toolkit/awt/vclxwindows.hxx            |   89 +
- toolkit/inc/toolkit/controls/dialogcontrol.hxx     |  251 ++-
- .../inc/toolkit/controls/unocontrolcontainer.hxx   |   18 +-
- toolkit/inc/toolkit/controls/unocontrols.hxx       |   49 +-
- toolkit/inc/toolkit/helper/listenermultiplexer.hxx |   12 +
- toolkit/inc/toolkit/helper/macros.hxx              |   51 +
- toolkit/inc/toolkit/helper/property.hxx            |    3 +
- toolkit/inc/toolkit/helper/servicenames.hxx        |    6 +
- toolkit/source/awt/vclxtabcontrol.cxx              |    2 +-
- toolkit/source/awt/vclxtabcontrol.hxx              |    3 +-
- toolkit/source/awt/vclxtabpage.cxx                 |    3 +-
- toolkit/source/awt/vclxtoolkit.cxx                 |   26 +-
- toolkit/source/awt/vclxwindows.cxx                 |  410 ++++
- toolkit/source/controls/dialogcontrol.cxx          | 1493 ++++++++++---
- toolkit/source/controls/unocontrolcontainer.cxx    |    4 +-
- toolkit/source/controls/unocontrols.cxx            |   84 +-
- toolkit/source/helper/listenermultiplexer.cxx      |   15 +
- toolkit/source/helper/property.cxx                 |    5 +-
- toolkit/source/helper/registerservices.cxx         |   13 +-
- toolkit/source/helper/servicenames.cxx             |    4 +
- toolkit/source/helper/unowrapper.cxx               |    4 +
- vbahelper/source/msforms/vbacontrol.cxx            |   36 +-
- vbahelper/source/msforms/vbacontrol.hxx            |    1 -
- vbahelper/source/msforms/vbacontrols.cxx           |   24 +-
- vbahelper/source/msforms/vbamultipage.cxx          |   22 +-
- vbahelper/source/msforms/vbauserform.cxx           |   43 +-
- vbahelper/source/msforms/vbauserform.hxx           |    2 +
- vcl/inc/vcl/tabctrl.hxx                            |    1 +
- vcl/source/control/group.cxx                       |    1 +
- vcl/source/control/tabctrl.cxx                     |   34 +-
- xmlscript/inc/xmlscript/xmldlg_imexp.hxx           |    1 +
- xmlscript/source/xmldlg_imexp/common.hxx           |    1 +
- xmlscript/source/xmldlg_imexp/exp_share.hxx        |   26 +-
- xmlscript/source/xmldlg_imexp/imp_share.hxx        |   95 +-
- xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx |  421 ++++-
- xmlscript/source/xmldlg_imexp/xmldlg_export.cxx    |  303 +---
- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |  241 ++-
- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx    |   58 +-
- xmlscript/util/makefile.mk                         |    2 +-
- 46 files changed, 4269 insertions(+), 2392 deletions(-)
-
-diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
-index 07d02fd..ea7673e 100644
---- a/basic/source/uno/dlgcont.cxx
-+++ b/basic/source/uno/dlgcont.cxx
+diff --git basctl/source/basicide/baside3.cxx basctl/source/basicide/baside3.cxx
+index fbd83c8..8d6c3d8 100644
+--- basctl/source/basicide/baside3.cxx
++++ basctl/source/basicide/baside3.cxx
+@@ -82,7 +82,6 @@
+ #include <com/sun/star/resource/XStringResourceResolver.hpp>
+ #include <com/sun/star/resource/StringResourceWithLocation.hpp>
+ #include <com/sun/star/task/XInteractionHandler.hpp>
+-#include <com/sun/star/script/XVBACompat.hpp>
+ 
+ using namespace comphelper;
+ using namespace	::com::sun::star;
+@@ -115,14 +114,6 @@ DialogWindow::DialogWindow( Window* pParent, const ScriptDocument& rDocument, St
+ 
+ 	pEditor = new DlgEditor( rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
+     pEditor->SetWindow( this );
+-	// set vba mode on DialogModel ( allows it to work in 100thmm instead of MAP_APPFONT )
+-	if ( rDocument.isDocument() && rDocument.getDocument().is() )
+-	{
+-		uno::Reference< script::XVBACompat > xDocVBAMode( rDocument.getLibraryContainer( E_SCRIPTS ), uno::UNO_QUERY );
+-		uno::Reference< script::XVBACompat > xDialogModelVBAMode( xDialogModel, uno::UNO_QUERY );
+-		if ( xDocVBAMode.is()  &&  xDialogModelVBAMode.is() )
+-			xDialogModelVBAMode->setVBACompatModeOn( xDocVBAMode->getVBACompatModeOn() );
+-	}
+     pEditor->SetDialog( xDialogModel );
+ 
+     // Undo einrichten
+diff --git basic/source/classes/sbxmod.cxx basic/source/classes/sbxmod.cxx
+index df3838b..35d08bc 100644
+--- basic/source/classes/sbxmod.cxx
++++ basic/source/classes/sbxmod.cxx
+@@ -2399,8 +2399,15 @@ void SbUserFormModule::InitObject()
+             aArgs[ 0 ] <<= m_xModel;
+             rtl::OUString sDialogUrl( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.script:" ) );
+             rtl::OUString sProjectName( RTL_CONSTASCII_USTRINGPARAM("Standard") );
+-            if ( this->GetParent()->GetName().Len() )
+-                sProjectName = this->GetParent()->GetName(); 
++
++            try
++            {
++                Reference< beans::XPropertySet > xProps( m_xModel, UNO_QUERY_THROW );
++                uno::Reference< script::XVBACompat > xVBAMode( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicLibraries") ) ), uno::UNO_QUERY_THROW );
++                sProjectName = xVBAMode->getProjectName();
++            }
++            catch( Exception& /*e*/) {}
++
+             sDialogUrl = sDialogUrl.concat( sProjectName ).concat( rtl::OUString( '.') ).concat( GetName() ).concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("?location=document") ) ); 
+ 
+             uno::Reference< awt::XDialogProvider > xProvider( xFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.DialogProvider")), aArgs  ), uno::UNO_QUERY_THROW );
+diff --git basic/source/inc/namecont.hxx basic/source/inc/namecont.hxx
+index 4cd5ce1..f0c3734 100644
+--- basic/source/inc/namecont.hxx
++++ basic/source/inc/namecont.hxx
+@@ -223,6 +223,7 @@ class SfxLibraryContainer   :public LibraryContainerHelper
+                             ,public ::utl::OEventListenerAdapter
+ {
+     sal_Bool mbVBACompat;
++    rtl::OUString msProjectName;
+ protected:
+     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >   mxMSF;
+     ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >       mxSFI;
+@@ -503,6 +504,9 @@ public:
+     // Methods XVBACompat
+     virtual ::sal_Bool SAL_CALL getVBACompatModeOn() throw (::com::sun::star::uno::RuntimeException);
+     virtual void SAL_CALL setVBACompatModeOn( ::sal_Bool _vbacompatmodeon ) throw (::com::sun::star::uno::RuntimeException);
++        virtual ::rtl::OUString SAL_CALL getProjectName() throw (::com::sun::star::uno::RuntimeException) { return msProjectName; }
++        virtual void SAL_CALL setProjectName( const ::rtl::OUString& _projectname ) throw (::com::sun::star::uno::RuntimeException);
++        
+ };
+ 
+ class LibraryContainerMethodGuard
+diff --git basic/source/uno/dlgcont.cxx basic/source/uno/dlgcont.cxx
+index 4985e35..b644f61 100644
+--- basic/source/uno/dlgcont.cxx
++++ basic/source/uno/dlgcont.cxx
 @@ -40,6 +40,7 @@
  #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
  #include "com/sun/star/resource/XStringResourceWithStorage.hpp"
@@ -89,7 +106,7 @@ index 07d02fd..ea7673e 100644
 +            rtl::OUString sURL;
 +            xProps->getPropertyValue( sImageURL ) >>= sURL;
 +            if ( sURL.getLength() && sURL.compareToAscii( GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( GRAPHOBJ_URLPREFIX ) ) == 0 )
-+                rvEmbedImgUrls.push_back( sURL );
++                rvEmbedImgUrls.push_back( sURL ); 
 +        }
 +    }
 +    Reference< XNameContainer > xContainer( xIf, UNO_QUERY );
@@ -114,7 +131,7 @@ index 07d02fd..ea7673e 100644
      SfxLibraryContainer::storeLibrariesToStorage( xStorage );
  
 +    // we need to export out any embedded image object(s)
-+    // associated with any Dialogs. First, we need to actually gather any such urls
++    // associated with any Dialogs. First, we need to actually gather any such urls 
 +    // for each dialog in this container
 +    Sequence< OUString > sLibraries = getElementNames();
 +    for ( sal_Int32 i=0; i < sLibraries.getLength(); ++i )
@@ -127,7 +144,7 @@ index 07d02fd..ea7673e 100644
 +            Sequence< OUString > sDialogs = xLib->getElementNames();
 +            sal_Int32 nDialogs( sDialogs.getLength() );
 +            for ( sal_Int32 j=0; j < nDialogs; ++j )
-+            {
++            { 
 +                // Each Dialog has an associated xISP
 +                Reference< io::XInputStreamProvider > xISP;
 +                xLib->getByName( sDialogs[ j ] ) >>= xISP;
@@ -164,3343 +181,1973 @@ index 07d02fd..ea7673e 100644
      mbOasis2OOoFormat = sal_False;
  }
  
-diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
-index c84b33f..0daf9c0 100644
---- a/extensions/source/propctrlr/formcomponenthandler.cxx
-+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
-@@ -2761,8 +2761,9 @@ namespace pcr
+diff --git basic/source/uno/namecont.cxx basic/source/uno/namecont.cxx
+index 06f4ecf..0705fee 100644
+--- basic/source/uno/namecont.cxx
++++ basic/source/uno/namecont.cxx
+@@ -2807,6 +2807,18 @@ void SAL_CALL SfxLibraryContainer::setVBACompatModeOn( ::sal_Bool _vbacompatmode
+         mbVBACompat = _vbacompatmodeon;
+ }
+ 
++void SAL_CALL SfxLibraryContainer::setProjectName( const ::rtl::OUString& _projectname ) throw (RuntimeException) 
++{ 
++	msProjectName = _projectname;
++	BasicManager* pBasMgr = getBasicManager();
++	// Temporary HACK
++	// Some parts of the VBA handling ( e.g. in core basic )
++	// code expect the name of the VBA project to be set as the name of 
++	// the basic manager. Provide fail back here.
++	if( pBasMgr )
++		pBasMgr->SetName( msProjectName );	
++}
++
+ // Methods XServiceInfo
+ ::sal_Bool SAL_CALL SfxLibraryContainer::supportsService( const ::rtl::OUString& _rServiceName )
+     throw (RuntimeException)
+diff --git extensions/source/propctrlr/formcomponenthandler.cxx extensions/source/propctrlr/formcomponenthandler.cxx
+index 97d72da..f813bc6 100644
+--- extensions/source/propctrlr/formcomponenthandler.cxx
++++ extensions/source/propctrlr/formcomponenthandler.cxx
+@@ -2783,8 +2783,9 @@ namespace pcr
  
          aFileDlg.SetTitle(aStrTrans);
-         // non-linked images ( e.g. those located in the document 
--        // stream ) cannot *currently* be handled by openoffice basic dialogs. 
+         // non-linked images ( e.g. those located in the document
+-        // stream ) cannot *currently* be handled by openoffice basic dialogs.
 -        bool bHandleNonLink = ( m_eComponentClass == eFormControl );
 +        // stream ) only if document is available
 +        Reference< XModel > xModel( impl_getContextDocument_nothrow() );
 +        bool bHandleNonLink = xModel.is();
-         
+ 
          Reference< XFilePickerControlAccess > xController(aFileDlg.GetFilePicker(), UNO_QUERY);
          DBG_ASSERT(xController.is(), "FormComponentPropertyHandler::impl_browseForImage_nothrow: missing the controller interface on the file picker!");
-diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
-index 4785563..9e2da8d 100644
---- a/scripting/source/dlgprov/dlgevtatt.cxx
-+++ b/scripting/source/dlgprov/dlgevtatt.cxx
-@@ -38,6 +38,7 @@
- #include <vcl/msgbox.hxx>
- #endif 
- #include <com/sun/star/awt/XControl.hpp>
-+#include <com/sun/star/awt/XControlContainer.hpp>
- #include <com/sun/star/awt/XDialogEventHandler.hpp>
- #include <com/sun/star/awt/XContainerWindowEventHandler.hpp>
+diff --git filter/source/msfilter/msvbahelper.cxx filter/source/msfilter/msvbahelper.cxx
+index ddd3528..ef8a242 100644
+--- filter/source/msfilter/msvbahelper.cxx
++++ filter/source/msfilter/msvbahelper.cxx
+@@ -36,6 +36,7 @@
+ #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+ #include <com/sun/star/document/XDocumentProperties.hpp>
+ #include <com/sun/star/document/XDocumentInfoSupplier.hpp>
++#include <com/sun/star/script/XVBACompat.hpp>
+ #include <tools/urlobj.hxx>
+ #include <osl/file.hxx>
+ #include <unotools/pathoptions.hxx>
+@@ -269,15 +270,15 @@ VBAMacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, const rtl::OUStrin
+         {
+             // Ok, if we have no Container specified then we need to search them in order, this document, template this document created from, global templates, 
+             // get the name of Project/Library for 'this' document
+-            rtl::OUString sThisProject;
+-            BasicManager* pBasicMgr = pShell-> GetBasicManager();
+-            if ( pBasicMgr )
++            rtl::OUString sThisProject = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") );
++            try
+             {
+-                if ( pBasicMgr->GetName().Len() )
+-                   sThisProject = pBasicMgr->GetName();
+-                else // cater for the case where VBA is not enabled
+-                   sThisProject = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") );
++                uno::Reference< beans::XPropertySet > xProps( pShell->GetModel(), uno::UNO_QUERY_THROW );
++                uno::Reference< script::XVBACompat > xVBAMode( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicLibraries") ) ), uno::UNO_QUERY_THROW );
++                sThisProject = xVBAMode->getProjectName();
+             }
++            catch( uno::Exception& /*e*/) {}
++
+             sSearchList.push_back( sThisProject ); // First Lib to search
+             if ( xPrjNameCache.is() )
+             {
+diff --git offapi/com/sun/star/script/XVBACompat.idl offapi/com/sun/star/script/XVBACompat.idl
+index e1b2d28..34ebb7e 100644
+--- offapi/com/sun/star/script/XVBACompat.idl
++++ offapi/com/sun/star/script/XVBACompat.idl
+@@ -43,6 +43,7 @@ interface XVBACompat: com::sun::star::uno::XInterface
+ 
+ //============================================================================= 
+     [attribute ] boolean VBACompatModeOn;
++    [attribute ] string  ProjectName;
+  
+ }; }; }; };  
+ }; 
+diff --git oox/inc/oox/helper/graphichelper.hxx oox/inc/oox/helper/graphichelper.hxx
+index 07385f8..743c53e 100644
+--- oox/inc/oox/helper/graphichelper.hxx
++++ oox/inc/oox/helper/graphichelper.hxx
+@@ -34,6 +34,7 @@
+ #include <com/sun/star/awt/DeviceInfo.hpp>
+ #include <com/sun/star/uno/Reference.hxx>
+ #include "oox/helper/binarystreambase.hxx"
++#include "oox/dllapi.h"
+ 
+ namespace com { namespace sun { namespace star {
+     namespace awt { struct Point; }
+@@ -63,7 +64,7 @@ namespace oox {
+     resolves the graphic object from the passed URL and thus prevents it from
+     being destroyed.
+  */
+-class GraphicHelper
++class OOX_DLLPUBLIC GraphicHelper
+ {
+ public:
+     explicit            GraphicHelper(
+diff --git oox/inc/oox/helper/propertyset.hxx oox/inc/oox/helper/propertyset.hxx
+index e4cb5a1..d8d51ca 100644
+--- oox/inc/oox/helper/propertyset.hxx
++++ oox/inc/oox/helper/propertyset.hxx
+@@ -30,6 +30,7 @@
+ 
  #include <com/sun/star/beans/XPropertySet.hpp>
-@@ -216,6 +217,9 @@ namespace dlgprov
-             Reference< container::XNameContainer > xEventCont = xEventsSupplier->getEvents();
+ #include <com/sun/star/beans/XMultiPropertySet.hpp>
++#include <com/sun/star/frame/XModel.hpp>
  
-             Reference< XControlModel > xControlModel = xControl->getModel();
-+            Reference< XPropertySet > xProps( xControlModel, uno::UNO_QUERY );
-+            rtl::OUString sName;
-+            xProps->getPropertyValue( rtl::OUString::createFromAscii("Name") ) >>= sName;
-             if ( xEventCont.is() )
-             {
-                 Sequence< ::rtl::OUString > aNames = xEventCont->getElementNames();
-@@ -288,6 +292,50 @@ namespace dlgprov
-         }
-     }
+ namespace oox {
  
+@@ -162,6 +163,20 @@ inline void PropertySet::setProperty( sal_Int32 nPropId, const Type& rValue )
+     setAnyProperty( nPropId, ::com::sun::star::uno::Any( rValue ) );
+ }
+ 
++class FormPropertySet : public PropertySet
++{
++public:
++    inline explicit     FormPropertySet() : PropertySet() {}
 +
-+    void DialogEventsAttacherImpl::nestedAttachEvents( const Sequence< Reference< XInterface > >& Objects, const Any& Helper, rtl::OUString& sDialogCodeName )
-+    {
-+        const Reference< XInterface >* pObjects = Objects.getConstArray();
-+        sal_Int32 nObjCount = Objects.getLength();
-+
-+        for ( sal_Int32 i = 0; i < nObjCount; ++i )
-+        {
-+            // We know that we have to do with instances of XControl.
-+            // Otherwise this is not the right implementation for
-+            // XScriptEventsAttacher and we have to give up.
-+            Reference< XControl > xControl( pObjects[ i ], UNO_QUERY );
-+            Reference< XControlContainer > xControlContainer( xControl, UNO_QUERY );
-+            Reference< XDialog > xDialog( xControl, UNO_QUERY );
-+            if ( !xControl.is() )
-+                throw IllegalArgumentException();
-+
-+            // get XEventsSupplier from control model
-+            Reference< XControlModel > xControlModel = xControl->getModel();
-+            Reference< XScriptEventsSupplier > xEventsSupplier( xControlModel, UNO_QUERY );
-+            attachEventsToControl( xControl, xEventsSupplier, Helper );
-+#ifdef FAKE_VBA_EVENT_SUPPORT
-+            xEventsSupplier.set( getFakeVbaEventsSupplier( xControl, sDialogCodeName ) );
-+            Any newHelper(xControl );
-+            attachEventsToControl( xControl, xEventsSupplier, newHelper );
-+#endif
-+            if ( xControlContainer.is() && !xDialog.is() )
-+            {
-+                Sequence< Reference< XControl > > aControls = xControlContainer->getControls();
-+                sal_Int32 nControlCount = aControls.getLength();
-+
-+                Sequence< Reference< XInterface > > aObjects( nControlCount );
-+                Reference< XInterface >* pObjects = aObjects.getArray();
-+                const Reference< XControl >* pControls = aControls.getConstArray();
++    /** Constructs a property set wrapper with the passed UNO property set. */
++    inline explicit     FormPropertySet(
++                            const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rxPropSet ) : PropertySet( rxPropSet ) {}
 +
-+                for ( sal_Int32 i = 0; i < nControlCount; ++i )
-+                {
-+                    pObjects[i] = Reference< XInterface >( pControls[i], UNO_QUERY );
-+                }
-+                nestedAttachEvents( aObjects, Helper, sDialogCodeName );
-+            }
-+        }
-+    }
-+
-     // -----------------------------------------------------------------------------
-     // XScriptEventsAttacher
-     // -----------------------------------------------------------------------------
-@@ -321,12 +369,10 @@ namespace dlgprov
-             }
-         }
- 
--        // go over all objects
--        const Reference< XInterface >* pObjects = Objects.getConstArray();
--        sal_Int32 nObjCount = Objects.getLength();
-+        rtl::OUString sDialogCodeName;
- #ifdef FAKE_VBA_EVENT_SUPPORT
-+        sal_Int32 nObjCount = Objects.getLength();
-         Reference< awt::XControl > xDlgControl( Objects[ nObjCount - 1 ], uno::UNO_QUERY ); // last object is the dialog
--        rtl::OUString sDialogCodeName;
-         if ( xDlgControl.is() )
-         {
-             Reference< XPropertySet > xProps( xDlgControl->getModel(), UNO_QUERY );
-@@ -337,25 +383,7 @@ namespace dlgprov
-             catch( Exception& ){}
-         }
- #endif
--
--        for ( sal_Int32 i = 0; i < nObjCount; ++i )
--        {
--            // We know that we have to do with instances of XControl.
--            // Otherwise this is not the right implementation for
--            // XScriptEventsAttacher and we have to give up.
--            Reference< XControl > xControl( pObjects[ i ], UNO_QUERY );
--            if ( !xControl.is() )
--                throw IllegalArgumentException();
--
--            // get XEventsSupplier from control model
--            Reference< XControlModel > xControlModel = xControl->getModel();
--            Reference< XScriptEventsSupplier > xEventsSupplier( xControlModel, UNO_QUERY );
--            attachEventsToControl( xControl, xEventsSupplier, Helper );
--#ifdef FAKE_VBA_EVENT_SUPPORT
--            xEventsSupplier.set( getFakeVbaEventsSupplier( xControl, sDialogCodeName ) );
--            attachEventsToControl( xControl, xEventsSupplier, Helper );
--#endif
--        }
-+        nestedAttachEvents( Objects, Helper, sDialogCodeName );
-     }
++    /** Constructs a property set wrapper after querying the XPropertySet interface. */
++    template< typename Type >
++    inline explicit     FormPropertySet( const Type& rObject ) : PropertySet( rObject ) {}
++    void setDataAwareProperties(  const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel, const PropertyMap& );
++};
+ // ============================================================================
  
+ } // namespace oox
+diff --git oox/inc/oox/ole/axbinaryreader.hxx oox/inc/oox/ole/axbinaryreader.hxx
+index 3688ddc..286ddc5 100755
+--- oox/inc/oox/ole/axbinaryreader.hxx
++++ oox/inc/oox/ole/axbinaryreader.hxx
+@@ -87,6 +87,9 @@ private:
+ /** A pair of integer values as a property. */
+ typedef ::std::pair< sal_Int32, sal_Int32 > AxPairData;
  
-diff --git a/scripting/source/dlgprov/dlgevtatt.hxx b/scripting/source/dlgprov/dlgevtatt.hxx
-index c39433f..31adba4 100644
---- a/scripting/source/dlgprov/dlgevtatt.hxx
-+++ b/scripting/source/dlgprov/dlgevtatt.hxx
-@@ -73,6 +73,7 @@ namespace dlgprov
- #ifdef FAKE_VBA_EVENT_SUPPORT
-         ::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptEventsSupplier > getFakeVbaEventsSupplier( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& xControl, rtl::OUString& sCodeName );
- #endif
-+        void nestedAttachEvents( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > >& Objects, const ::com::sun::star::uno::Any& Helper, rtl::OUString& sDialogCodeName );
-         void  SAL_CALL attachEventsToControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& xControl, const ::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptEventsSupplier >& events, const ::com::sun::star::uno::Any& Helper  );
-     public:
-         DialogEventsAttacherImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, 
-diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
-index b04c842..df872f2 100644
---- a/scripting/source/vbaevents/eventhelper.cxx
-+++ b/scripting/source/vbaevents/eventhelper.cxx
-@@ -36,6 +36,7 @@
- #include <com/sun/star/awt/XComboBox.hpp> //liuchen 2009-6-18
- #include <com/sun/star/awt/XRadioButton.hpp> //liuchen 2009-7-30
- #include <com/sun/star/awt/XListBox.hpp>
-+#include <com/sun/star/awt/XSimpleTabController.hpp>
- 
- #include <msforms/ReturnInteger.hpp>
++/** An array of string values as a property. */
++typedef ::std::vector< ::rtl::OUString > AxStringArray;
++
+ // ============================================================================
  
-@@ -52,6 +53,7 @@
+ const sal_uInt32 AX_FONTDATA_BOLD           = 0x00000001;
+@@ -149,6 +152,9 @@ public:
+     /** Reads the next string property from the stream, if the respective flag
+         in the property mask is set. */
+     void                readStringProperty( ::rtl::OUString& orValue );
++    /** Reads a string array property from the stream, if the respective flag
++        in the property mask is set. */
++    void                readStringArrayProperty( AxStringArray& orArray );
+     /** Reads the next GUID property from the stream, if the respective flag
+         in the property mask is set. The GUID will be enclosed in braces. */
+     void                readGuidProperty( ::rtl::OUString& orGuid );
+@@ -172,6 +178,9 @@ public:
+     /** Skips the next string property in the stream, if the respective flag in
+         the property mask is set. */
+     inline void         skipStringProperty() { readStringProperty( maDummyString ); }
++    /** Skips the next string array property in the stream, if the respective
++        flag in the property mask is set. */
++    inline void         skipStringArrayProperty() { readStringArrayProperty( maDummyStringArray ); }
+     /** Skips the next GUID property in the stream, if the respective flag in
+         the property mask is set. */
+     inline void         skipGuidProperty() { readGuidProperty( maDummyString ); }
+@@ -221,6 +230,16 @@ private:
+         virtual bool        readProperty( AxAlignedInputStream& rInStrm );
+     };
  
- #include <com/sun/star/lang/XMultiComponentFactory.hpp>
- #include <com/sun/star/script/XScriptListener.hpp>
-+#include <com/sun/star/awt/XTabListener.hpp>
- #include <cppuhelper/implbase1.hxx>
- #include <cppuhelper/implbase3.hxx>
- #include <comphelper/evtmethodhelper.hxx>
-@@ -83,6 +85,11 @@ const static sal_Int32 DELIMLEN = DELIM.getLength();
- #if 0
- void dumpListeners( const Reference< beans::XIntrospection >& xIntrospection, const Reference<XInterface>& xIfc)
- {
-+    uno::Reference<lang::XServiceInfo> xInfo( xIfc, uno::UNO_QUERY );
-+    if ( xInfo.is() )
++    /** Complex property for an array of strings. */
++    struct StringArrayProperty : public ComplexProperty
 +    {
-+        OSL_TRACE("** listener Dump for %s", rtl::OUStringToOString( xInfo->getImplementationName(), RTL_TEXTENCODING_UTF8 ).getStr() );
-+    }
-     Reference< beans::XIntrospectionAccess > xIntrospectionAccess;
-     if ( xIntrospection.is() )
++        AxStringArray&      mrArray;
++        sal_uInt32          mnSize;
++        inline explicit     StringArrayProperty( AxStringArray& rArray, sal_uInt32 nSize ) :
++                                mrArray( rArray ), mnSize( nSize ) {}
++        virtual bool        readProperty( AxAlignedInputStream& rInStrm );
++    };
++
+     /** Complex property for a GUID value. */
+     struct GuidProperty : public ComplexProperty
      {
-@@ -300,6 +307,7 @@ static TranslatePropMap aTranslatePropMap_Impl[] =
-     { MAP_CHAR_LEN("itemStateChanged"), { MAP_CHAR_LEN("_Click"), NULL, ApproveType, (void*)(&listBoxList) } },
-     // changed ooo event
-     { MAP_CHAR_LEN("changed"), { MAP_CHAR_LEN("_Change"), NULL, ApproveAll, NULL } },
-+    { MAP_CHAR_LEN("activated"), { MAP_CHAR_LEN("_Change"), NULL, ApproveAll, NULL} },
- 
-     // focusGained ooo event
-     { MAP_CHAR_LEN("focusGained"), { MAP_CHAR_LEN("_GotFocus"), NULL, ApproveAll, NULL } },
-@@ -445,6 +453,11 @@ ScriptEventHelper::getEventListeners()
-         Reference< beans::XIntrospection > xIntrospection(
-             xMFac->createInstanceWithContext( rtl::OUString(
-                 RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.Introspection"  ) ), m_xCtx ), UNO_QUERY );
-+        rtl::OUString implName;
-+        uno::Reference<lang::XServiceInfo> xInfo( m_xControl, uno::UNO_QUERY );
-+        if ( xInfo.is() )
-+            implName = xInfo->getImplementationName();
-+
- #if 0
-         dumpListeners( xIntrospection, m_xControl );
-         dumpListeners( xIntrospection, m_xControl->getModel() );
-@@ -946,8 +959,11 @@ EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet ) throw(RuntimeExce
-                 // Userform control ( fired from the api or from event manager )
-         uno::Reference< beans::XPropertySet > xProps;
-         OSL_TRACE("Getting properties");
-+                if ( !xControl.is() )
-+                    evt.Helper >>= xControl;
-             xProps.set( xControl->getModel(), uno::UNO_QUERY_THROW );
--            xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) >>= sName;
-+                if ( xProps.is() )
-+                    xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) >>= sName;
-     }
+@@ -261,6 +280,7 @@ private:
+     AxFontData          maDummyFontData;    /// Dummy font 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_Int64           mnPropFlags;        /// Flags specifying existing properties.
+     sal_Int64           mnNextProp;         /// Next property to read.
+     sal_Int64           mnPropsEnd;         /// End position of simple/large properties.
+diff --git oox/inc/oox/ole/axcontrol.hxx oox/inc/oox/ole/axcontrol.hxx
+index ea1411c..3b70361 100644
+--- oox/inc/oox/ole/axcontrol.hxx
++++ oox/inc/oox/ole/axcontrol.hxx
+@@ -111,8 +111,12 @@ enum ApiControlType
+     API_CONTROL_COMBOBOX,
+     API_CONTROL_SPINBUTTON,
+     API_CONTROL_SCROLLBAR,
++    API_CONTROL_TABSTRIP,
+     API_CONTROL_PROGRESSBAR,
+     API_CONTROL_GROUPBOX,
++    API_CONTROL_FRAME,
++    API_CONTROL_PAGE,
++    API_CONTROL_MULTIPAGE,
+     API_CONTROL_DIALOG
+ };
  
-     }
-diff --git a/svx/inc/svx/msocximex.hxx b/svx/inc/svx/msocximex.hxx
-index 34e67f0..8efd6f6 100644
---- a/svx/inc/svx/msocximex.hxx
-+++ b/svx/inc/svx/msocximex.hxx
-@@ -293,6 +293,8 @@ public:
-     rtl::OUString msCtrlSource;
-     rtl::OUString msRowSource;
-         SfxObjectShell *pDocSh;
-+        ::rtl::OUString sImageUrl;
-+    com::sun::star::uno::Reference< com::sun::star::graphic::XGraphicObject> mxGrfObj;
- protected:
+@@ -639,19 +643,50 @@ private:
  
-     sal_uInt32 ImportColor(sal_uInt32 nColorCode) const;
-@@ -415,22 +417,21 @@ public:
+ // ============================================================================
  
-     sal_uInt8 pPictureHeader[20];
-     sal_uInt32 nPictureLen;
--    ::rtl::OUString sImageUrl;
--    com::sun::star::uno::Reference< com::sun::star::graphic::XGraphicObject> mxGrfObj;
--
- };
++/** Model for a Forms 2.0 tabstrip control. */
++class AxTabStripModel : public AxFontDataModel
++{
++public:
++    explicit            AxTabStripModel();
++
++    virtual bool        importBinaryModel( BinaryInputStream& rInStrm );
++
++    virtual ApiControlType getControlType() const;
++    virtual void        convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
++
++    /** Returns the caption with the specified zero-based index. */
++    ::rtl::OUString     getCaption( sal_Int32 nIndex ) const;
++
++private:
++    AxStringArray       maCaptions;         /// Captions of all tabs.
++    sal_uInt32          mnBackColor;        /// Fill color.
++    sal_uInt32          mnTextColor;        /// Text color.
++    sal_uInt32          mnFlags;            /// Various flags.
++    sal_Int32           mnSelectedTab;      /// The index of the selected tab.
++    sal_uInt32          mnTabStyle;         /// Visual style of the tabs.
++    sal_Int32           mnTabFlagCount;     /// Number of entries in tab flag array.
++};
++
++typedef ::boost::shared_ptr< AxTabStripModel > AxTabStripModelRef;
++
++// ============================================================================
++
+ typedef ::std::vector< ::rtl::OUString > AxClassTable;
  
- class OCX_TabStrip : public OCX_Control
+ /** Base class for ActiveX container controls. */
+ class AxContainerModelBase : public AxFontDataModel
  {
  public:
--    OCX_TabStrip() : OCX_Control( rtl::OUString::createFromAscii("TabStrip")) {}
-+    OCX_TabStrip() : OCX_Control( rtl::OUString::createFromAscii("TabStrip")), nIdentifier(0), nFixedAreaLen(0), nNumTabs(0), bHasTabs(true) {}
-         virtual sal_Bool ReadFontData(SotStorageStream *pS);
-         virtual sal_Bool Read(SotStorageStream *pS);
- 
-+        std::vector< rtl::OUString > msItems;
-     sal_uInt16	nIdentifier;
-     sal_uInt16	nFixedAreaLen;
-     sal_uInt8	pBlockFlags[4];
--    sal_uInt16	nNumTabs;
-+    sal_Int32	nNumTabs;
-+    bool	        bHasTabs;
+-    explicit            AxContainerModelBase();
++    explicit            AxContainerModelBase( bool bFontSupport = false );
+ 
+     /** Allows to set single properties specified by XML token identifier. */
+     virtual void        importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
+     /** Reads the leading structure in the 'f' stream containing the model for
+         this control. */
+     virtual bool        importBinaryModel( BinaryInputStream& rInStrm );
++    /** Converts font settings if supported. */
++    virtual void        convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
++
+     /** Reads the class table structure for embedded controls following the own
+         model from the 'f' stream. */
+     bool                importClassTable( BinaryInputStream& rInStrm, AxClassTable& orClassTable );
+@@ -672,13 +707,14 @@ protected:
+     sal_Int32           mnPicAlign;         /// Anchor position of the picture.
+     sal_Int32           mnPicSizeMode;      /// Clip, stretch, zoom.
+     bool                mbPicTiling;        /// True = picture is repeated.
++    bool                mbFontSupport;      /// True = control supports the font property.
  };
  
- class OCX_Image : public OCX_Control
-@@ -464,8 +465,6 @@ public:
-     sal_uInt8	nSpecialEffect;
+ typedef ::boost::shared_ptr< AxContainerModelBase > AxContainerModelRef;
  
-         bool bAutoSize;
--        ::rtl::OUString sImageUrl;
--        com::sun::star::uno::Reference< com::sun::star::graphic::XGraphicObject> mxGrfObj;
-         sal_Bool Read(SotStorageStream *pS);
+ // ============================================================================
  
-     using OCX_Control::Import; // to not hide the other two import methods
-@@ -486,7 +485,7 @@ public:
- };
- struct ContainerRecord
+-/** Model for a Forms 2.0 frame (group box). */
++/** Model for a Forms 2.0 frame control. */
+ class AxFrameModel : public AxContainerModelBase
  {
--    ContainerRecord():nTop(0), nLeft(0), nSubStorageId(0), nSubStreamLen(0), nTabPos(0), nTypeIdent(0), bVisible( true ) {}
-+   ContainerRecord():nTop(0), nLeft(0), nSubStorageId(0), nSubStreamLen(0), nTabPos(0), nTypeIdent(0), bVisible( true ), bTabStop( true ) {}
- 
-     ::rtl::OUString cName;
-     ::rtl::OUString controlTip;
-@@ -500,6 +499,7 @@ struct ContainerRecord
-     sal_uInt16  nTabPos;
-     sal_uInt16 nTypeIdent;
-     bool bVisible;
-+    bool bTabStop;
- };
- 
- typedef std::vector<OCX_Control*>::iterator CtrlIterator;
-@@ -508,130 +508,85 @@ typedef std::vector<OCX_Control*>  CtrlList;
+ public:
+@@ -690,6 +726,38 @@ public:
  
- class OCX_OptionButton;
+ // ============================================================================
  
--class OCX_ContainerControl : public OCX_Control
-+class OCX_ParentControl : public OCX_Control
++/** Model for a Forms 2.0 formpage control (a single page in a multipage control). */
++class AxFormPageModel : public AxContainerModelBase
++{
++public:
++    explicit            AxFormPageModel();
++
++    virtual ApiControlType getControlType() const;
++    virtual void        convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
++};
++
++// ============================================================================
++
++/** Model for a Forms 2.0 multipage control. Contains the tabstrip control
++    (class AxTabStripModel) and the single pages (class AxFormPageModel). */
++class AxMultiPageModel : public AxContainerModelBase
++{
++public:
++    explicit            AxMultiPageModel();
++
++    virtual ApiControlType getControlType() const;
++    virtual void        convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const;
++
++    /** Sets the tabstrip control model related to this multipage control.
++        Contains all formatting attributes of the page tabs. */
++    void                setTabStripModel( const AxTabStripModelRef& rxTabStrip );
++
++private:
++    AxTabStripModelRef  mxTabStrip;
++};
++
++// ============================================================================
++
+ /** Model for a Forms 2.0 user form. */
+ class AxUserFormModel : public AxContainerModelBase
  {
- public:
--    virtual ~OCX_ContainerControl();
--        // sub class will process the control specific information
--        // e.g frame or userform ( maybe tab, mulipage in the future )
--        // Base (this) class will process the container specific information
--        // e.g. the controls contained by this container
--        // will
--        // a) create the controls
--        // b) read the controls
--        // c) store these controls in a list for post processing
--        //     e.g. import
--        //
-     virtual sal_Bool Read(SvStorageStream *pS);
--        // No Font record
-     virtual sal_Bool ReadFontData(SvStorageStream* /*pS*/) { return sal_True; }
- 
-     using OCX_Control::Import; // to not hide the other two import methods
-+
-     virtual sal_Bool Import(com::sun::star::uno::Reference<
-         com::sun::star::beans::XPropertySet> &rPropSet);
--
-         SotStorageStreamRef getContainerStream() { return mContainerStream; }
--
-+        SotStorageStreamRef getOStream() { return mContainedControlsStream; }
-         virtual void ProcessControl( OCX_Control* pControl, SvStorageStream* pS, ContainerRecord& rec );
--        bool createFromContainerRecord( ContainerRecord& record,
-+        bool createFromContainerRecord( const ContainerRecord& record,
-             OCX_Control*& );
--        SotStorageStreamRef getContainedControlsStream(){ return mContainedControlsStream; }
- protected:
--        // This class not meant to be instantiated
--        // needs to be subclassed
--    OCX_ContainerControl( SotStorageRef& parent,
-+    OCX_ParentControl( SotStorageRef& parent,
-             const ::rtl::OUString& storageName,
-             const ::rtl::OUString& sN,
-             const com::sun::star::uno::Reference<
--                com::sun::star::container::XNameContainer >  &rParent,
-+                com::sun::star::container::XNameContainer >  &rDialog,
-             OCX_Control* pParent = NULL );
--        rtl::OUString createSubStreamName( const sal_uInt32& subStorageID );
-+    ~OCX_ParentControl();
- 
--        com::sun::star::uno::Reference<
--                com::sun::star::container::XNameContainer > mxParent;
-+        com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxParent;
-     std::vector<OCX_Control*> mpControls;
--        std::hash_map<sal_uInt16, sal_uInt16> mActiveXIDMap;
-         SotStorageRef mContainerStorage;
-         SotStorageStreamRef mContainerStream;
-         SotStorageStreamRef mContainedControlsStream;
--    sal_uInt32 nNoRecords;
--    sal_uInt32 nTotalLen;
--        sal_uInt32 containerType;
--
--private:
--        OCX_ContainerControl(); // not implemented
--        OCX_ContainerControl(const OCX_ContainerControl&); // not implemented
--};
--
--
--class OCX_MultiPage : public OCX_ContainerControl
--{
--public:
--    OCX_MultiPage( SotStorageRef& parent,
--            const ::rtl::OUString& storageName,
--            const ::rtl::OUString& sN,
--            const com::sun::star::uno::Reference<
--                com::sun::star::container::XNameContainer >  &rDialog, OCX_Control* pParent = NULL);
--    virtual ~OCX_MultiPage()
--    {
--        delete[] pCaption;
--        delete[] pIcon;
--        delete[] pPicture;
--    }
--    virtual sal_Bool Read(SvStorageStream *pS);
--
--    using OCX_ContainerControl::Import; // to not hide the other two import methods
--    virtual sal_Bool Import(com::sun::star::uno::Reference<
--        com::sun::star::beans::XPropertySet> &rPropSet);
--    virtual sal_Bool Import(com::sun::star::uno::Reference<
--        com::sun::star::container::XNameContainer>
--        &rDialog);
--        virtual void ProcessControl( OCX_Control* pControl, SvStorageStream* pS, ContainerRecord& rec );
--    /*sal_uInt8 for sal_uInt8 Word Struct*/
--    sal_uInt16 nIdentifier;
--    sal_uInt16 nFixedAreaLen;
--    sal_uInt8	pBlockFlags[4];
-+	sal_uInt16 nIdentifier;
-+	sal_uInt16 nFixedAreaLen;
-+	sal_uInt8	pBlockFlags[4];
- 
--    sal_uInt32  fUnknown1;
-+    sal_uInt32  nNextAvailableID;
-+    sal_uInt32  nBooleanProperties;
-+    sal_uInt32  nGroupCnt;
-+    sal_uInt32  nZoom;
- 
--    sal_uInt8	fUnknown2:1;
-+    sal_uInt8	fUnknown1:1;
-     sal_uInt8	fEnabled:1;
-     sal_uInt8	fLocked:1;
-     sal_uInt8	fBackStyle:1;
--    sal_uInt8	fUnknown3:4;
-+    sal_uInt8	fUnknown2:4;
- 
--    sal_uInt8	fUnknown4:8;
-+    sal_uInt8	fUnknown3:8;
- 
--    sal_uInt8	fUnknown5:7;
-+    sal_uInt8	fUnknown4:7;
-     sal_uInt8	fWordWrap:1;
- 
--    sal_uInt8	fUnknown6:4;
-+    sal_uInt8	fUnknown5:4;
-     sal_uInt8	fAutoSize:1;
--    sal_uInt8	fUnknown7:3;
-+    sal_uInt8	fUnknown6:3;
- 
-     sal_uInt32	nCaptionLen;
-     sal_uInt16  nVertPos;
-     sal_uInt16  nHorzPos;
--    sal_uInt8 	nMousePointer;
-     sal_uInt32	nBorderColor;
--    sal_uInt32  fUnknown8;
--    sal_uInt32  fUnknown9;
-+    sal_uInt32  nDrawBuffer;
-+    sal_uInt32  nShapeCookie;
-     sal_uInt8   nKeepScrollBarsVisible;
-     sal_uInt8   nCycle;
--    sal_uInt16	nBorderStyle;
--    sal_uInt16	nSpecialEffect;
-+    sal_uInt8	nBorderStyle;
-+    sal_uInt8 	nMousePointer;
-+
-+    sal_uInt8	nSpecialEffect;
-     sal_uInt16	nPicture;
-     sal_uInt8   nPictureAlignment;
-     sal_uInt8   nPictureSizeMode;
-     bool        bPictureTiling;
-     sal_uInt16	nAccelerator;
-     sal_uInt16	nIcon;
-+    sal_uInt16	fUnknown7;
- 
-     char *pCaption;
- 
-     sal_uInt32 	nScrollWidth;
-     sal_uInt32 	nScrollHeight;
--
-+    sal_uInt32 	nScrollLeft;
-+    sal_uInt32 	nScrollTop;
+diff --git oox/inc/oox/ole/vbacontrol.hxx oox/inc/oox/ole/vbacontrol.hxx
+index 085a2f5..ddfabbf 100755
+--- oox/inc/oox/ole/vbacontrol.hxx
++++ oox/inc/oox/ole/vbacontrol.hxx
+@@ -40,8 +40,6 @@ namespace oox { class StorageBase; }
+ namespace oox {
+ namespace ole {
  
-     sal_uInt8 pIconHeader[20];
-     sal_uInt32  nIconLen;
-@@ -639,94 +594,59 @@ public:
- 
-     sal_uInt8 pPictureHeader[20];
-     sal_uInt32  nPictureLen;
--    sal_uInt8 *pPicture;
- private:
--        sal_Int32 mnCurrentPageStep;
--};
+-class VbaFormControl;
 -
-+        OCX_ParentControl(); // not implemented
-+        OCX_ParentControl(const OCX_ParentControl&); // not implemented
+ // ============================================================================
  
-+};
+ /** Common properties for all controls that are part of a VBA user form or of
+@@ -56,13 +54,13 @@ public:
+     void                importProperty( sal_Int32 nPropId, const ::rtl::OUString& rValue );
+     /** Imports the site model data from the passed input stream. */
+     bool                importBinaryModel( BinaryInputStream& rInStrm );
+-    /** Moves the control relative to its current position by the passed distance. */
+-    void                moveRelative( const AxPairData& rDistance );
+ 
+     /** Returns the programmatical name of the control. */
+     inline const ::rtl::OUString& getName() const { return maName; }
+-    /** Returns the position of the control in its parent. */
+-    inline const AxPairData& getPosition() const { return maPos; }
++    /** Returns the unique identifier of this control. */
++    inline sal_Int32    getId() const { return mnId; }
++    /** Returns true, if the control is visible. */
++    bool                isVisible() const;
+     /** Returns true, if this control is a container control. */
+     bool                isContainer() const;
+     /** Returns the length of the stream data for stream based controls. */
+@@ -81,12 +79,14 @@ public:
+                             ApiControlType eCtrlType,
+                             sal_Int32 nCtrlIndex ) const;
+ 
++    void                convertDataAwareProperties( PropertyMap& rPropMap );
++
+ protected:
+     ::rtl::OUString     maName;             /// Name of the control.
+     ::rtl::OUString     maTag;              /// User defined tag.
+     ::rtl::OUString     maToolTip;          /// Tool tip for the control.
+-    ::rtl::OUString     maLinkedCell;       /// Linked cell for the control value in a spreadsheet.
+-    ::rtl::OUString     maSourceRange;      /// Source data for the control in a spreadsheet.
++    ::rtl::OUString     maControlSource;    /// Linked cell for the control value in a spreadsheet.
++    ::rtl::OUString     maRowSource;        /// Source data for the control in a spreadsheet.
+     AxPairData          maPos;              /// Position in parent container.
+     sal_Int32           mnId;               /// Control identifier.
+     sal_Int32           mnHelpContextId;    /// Help context identifier.
+@@ -123,11 +123,14 @@ public:
+ 
+     /** Returns the programmatical name of the control. */
+     ::rtl::OUString     getControlName() const;
++    /** Returns the unique identifier of this control. */
++    sal_Int32           getControlId() const;
+ 
+     /** Creates the UNO control model, inserts it into the passed container,
+         and converts all control properties. */
+     void                createAndConvert(
+                             sal_Int32 nCtrlIndex,
++                            const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
+                             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxParentNC,
+                             const ControlConverter& rConv ) const;
+ 
+@@ -140,6 +143,7 @@ protected:
+ 
+     /** Converts all control properties, and inserts and converts embedded controls. */
+     bool                convertProperties(
++                            const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxDocModel,
+                             const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxCtrlModel,
+                             const ControlConverter& rConv,
+                             sal_Int32 nCtrlIndex ) const;
+@@ -156,13 +160,7 @@ private:
+     /** Imports the site models of all embedded controls from the 'f' stream. */
+     bool                importEmbeddedSiteModels( BinaryInputStream& rInStrm );
+     /*  Final processing of all embedded controls after import. */
+-    void                finalizeEmbeddedControls();
+-
+-    /** Moves the control relative to its current position by the passed distance. */
+-    void                moveRelative( const AxPairData& rDistance );
+-    /** Moves all embedded controls from their relative position in this
+-        control to an absolute position in the parent of this control. */
+-    void                moveEmbeddedToAbsoluteParent();
++    void                finalizeEmbeddedControls( StorageBase& rStrg );
+ 
+     /** Functor for comparing controls by their tab index. */
+     static bool         compareByTabIndex( const VbaFormControlRef& rxLeft, const VbaFormControlRef& rxRight );
+diff --git oox/inc/oox/ole/vbahelper.hxx oox/inc/oox/ole/vbahelper.hxx
+index bc32c7a..8959a57 100755
+--- oox/inc/oox/ole/vbahelper.hxx
++++ oox/inc/oox/ole/vbahelper.hxx
+@@ -57,6 +57,7 @@ const sal_uInt16 VBA_ID_MODULESTREAMNAMEUNICODE = 0x0032;
+ const sal_uInt16 VBA_ID_MODULETYPEDOCUMENT      = 0x0022;
+ const sal_uInt16 VBA_ID_MODULETYPEPROCEDURAL    = 0x0021;
+ const sal_uInt16 VBA_ID_PROJECTCODEPAGE         = 0x0003;
++const sal_uInt16 VBA_ID_PROJECTNAME             = 0x0004;
+ const sal_uInt16 VBA_ID_PROJECTEND              = 0x0010;
+ const sal_uInt16 VBA_ID_PROJECTMODULES          = 0x000F;
+ const sal_uInt16 VBA_ID_PROJECTVERSION          = 0x0009;
+diff --git oox/inc/oox/ole/vbaproject.hxx oox/inc/oox/ole/vbaproject.hxx
+index e9c4bd3..6087942 100755
+--- oox/inc/oox/ole/vbaproject.hxx
++++ oox/inc/oox/ole/vbaproject.hxx
+@@ -278,7 +278,7 @@ private:
+                         mxBasicLib;         /// The Basic library of the document used for import.
+     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
+                         mxDialogLib;        /// The dialog library of the document used for import.
+-    const ::rtl::OUString maLibName;        /// Name for Basic and dialog library used for import.
++    ::rtl::OUString     maPrjName;        /// Name of VBA project being imported
+ };
  
--class OCX_Page : public OCX_ContainerControl
-+class OCX_Page;
-+class OCX_MultiPage : public OCX_ParentControl
- {
- public:
--    OCX_Page( SotStorageRef& parentStorage,
-+    OCX_MultiPage( SotStorageRef& parent,
-             const ::rtl::OUString& storageName,
-             const ::rtl::OUString& sN,
-             const com::sun::star::uno::Reference<
--                com::sun::star::container::XNameContainer >  &rDialog, OCX_Control* parent = NULL);
--    virtual ~OCX_Page()
--    {
--        delete[] pCaption;
--        delete[] pIcon;
--        delete[] pPicture;
--    }
-+                com::sun::star::container::XNameContainer >  &rDialog, OCX_Control* pParent = NULL);
-+
-     virtual sal_Bool Read(SvStorageStream *pS);
- 
--    using OCX_ContainerControl::Import; // to not hide the other two import methods
-+    using OCX_ParentControl::Import; // to not hide the other two import methods
-     virtual sal_Bool Import(com::sun::star::uno::Reference<
--        com::sun::star::container::XNameContainer>
--        &rDialog);
--/*	virtual sal_Bool Import(com::sun::star::uno::Reference<
-         com::sun::star::beans::XPropertySet> &rPropSet);
--*/
--    /*sal_uInt8 for sal_uInt8 Word Struct*/
--    sal_uInt16 nIdentifier;
--    sal_uInt16 nFixedAreaLen;
--    sal_uInt8	pBlockFlags[4];
--
--    sal_uInt32  fUnknown1;
--
--    sal_uInt8	fUnknown2:1;
--    sal_uInt8	fEnabled:1;
--    sal_uInt8	fLocked:1;
--    sal_uInt8	fBackStyle:1;
--    sal_uInt8	fUnknown3:4;
--
--    sal_uInt8	fUnknown4:8;
--
--    sal_uInt8	fUnknown5:7;
--    sal_uInt8	fWordWrap:1;
--
--    sal_uInt8	fUnknown6:4;
--    sal_uInt8	fAutoSize:1;
--    sal_uInt8	fUnknown7:3;
--
--    sal_uInt32	nCaptionLen;
--    sal_uInt16  nVertPos;
--    sal_uInt16  nHorzPos;
--    sal_uInt8 	nMousePointer;
--    sal_uInt32	nBorderColor;
--    sal_uInt32  fUnknown8;
--    sal_uInt32  fUnknown9;
--    sal_uInt8   nKeepScrollBarsVisible;
--    sal_uInt8   nCycle;
--    sal_uInt16	nBorderStyle;
--    sal_uInt16	nSpecialEffect;
--    sal_uInt16	nPicture;
--    sal_uInt8   nPictureAlignment;
--    sal_uInt8   nPictureSizeMode;
--    bool        bPictureTiling;
--    sal_uInt16	nAccelerator;
--    sal_uInt16	nIcon;
--
--    char *pCaption;
--
--    sal_uInt32 	nScrollWidth;
--    sal_uInt32 	nScrollHeight;
-+        virtual void ProcessControl( OCX_Control* pControl, SvStorageStream* pS, ContainerRecord& rec );
+ // ============================================================================
+diff --git oox/inc/oox/xls/excelfilter.hxx oox/inc/oox/xls/excelfilter.hxx
+index 1409740..72ed636 100644
+--- oox/inc/oox/xls/excelfilter.hxx
++++ oox/inc/oox/xls/excelfilter.hxx
+@@ -30,6 +30,8 @@
+ 
+ #include "oox/core/xmlfilterbase.hxx"
+ #include "oox/core/binaryfilterbase.hxx"
++#include "oox/xls/excelvbaproject.hxx"
++#include "oox/ole/simplevbaprojectfilter.hxx"
+ 
+ namespace oox {
+ namespace xls {
+@@ -92,6 +94,18 @@ private:
+     virtual ::rtl::OUString implGetImplementationName() const;
+ };
+ 
++class SimpleExcelVBAProjFilter : public ExcelBiffFilter
++{
++public:
++    explicit            SimpleExcelVBAProjFilter(
++                            const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxGlobalFactory );
++    virtual bool        importDocument() throw();
++
 +private:
-+        sal_Int32 nActiveTab;
-+        SotStorageStreamRef mXStream;
-+        bool bHasTabs;
-+        std::vector< rtl::OUString > sCaptions;
-+        // order of Ids corrosponds to the order of captions above
-+        std::vector< sal_Int32 > mPageIds;
-+        std::hash_map< sal_Int32, OCX_Page* > idToPage;
++    virtual GraphicHelper* implCreateGraphicHelper() const;
++    virtual ::rtl::OUString implGetImplementationName() const;
 +};
++
+ // ============================================================================
  
- 
--    sal_uInt8 pIconHeader[20];
--    sal_uInt32  nIconLen;
--    sal_uInt8 *pIcon;
-+class OCX_Page : public OCX_ParentControl
+ } // namespace xls
+diff --git oox/prj/d.lst oox/prj/d.lst
+index 482a270..82dc662 100644
+--- oox/prj/d.lst
++++ oox/prj/d.lst
+@@ -25,6 +25,7 @@ mkdir: %_DEST%\inc%_EXT%\oox\xls
+ ..\inc\oox\helper\binarystreambase.hxx %_DEST%\inc%_EXT%\oox\helper\binarystreambase.hxx
+ ..\inc\oox\helper\helper.hxx %_DEST%\inc%_EXT%\oox\helper\helper.hxx
+ ..\inc\oox\helper\containerhelper.hxx %_DEST%\inc%_EXT%\oox\helper\containerhelper.hxx
++..\inc\oox\helper\graphichelper.hxx %_DEST%\inc%_EXT%\oox\helper\graphichelper.hxx
+ ..\inc\oox\helper\storagebase.hxx %_DEST%\inc%_EXT%\oox\helper\storagebase.hxx
+ ..\inc\oox\helper\zipstorage.hxx %_DEST%\inc%_EXT%\oox\helper\zipstorage.hxx
+ ..\inc\oox\core\filterbase.hxx %_DEST%\inc%_EXT%\oox\core\filterbase.hxx
+diff --git oox/source/core/facreg.cxx oox/source/core/facreg.cxx
+index 50a2a54..7be7c3c 100644
+--- oox/source/core/facreg.cxx
++++ oox/source/core/facreg.cxx
+@@ -60,6 +60,8 @@ namespace oox {
+     namespace xls { SERVICE( BiffDetector ); }
+     namespace xls { SERVICE( ExcelFilter ); }
+     namespace xls { SERVICE( ExcelBiffFilter ); }
++    namespace xls { SERVICE( SimpleExcelVBAProjFilter ); }
++    namespace ole { SERVICE( SimpleWordVBAProjFilter ); }
+     namespace shape { SERVICE( ShapeContextHandler ); }
+     namespace shape { SERVICE( FastTokenHandlerService ); }
+     namespace docprop { SERVICE2( OOXMLDocPropImportImpl ); }
+@@ -103,6 +105,8 @@ OOX_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void * , void * pRegistryKe
+             WRITEINFO( ::oox::xls::BiffDetector );
+             WRITEINFO( ::oox::xls::ExcelFilter );
+             WRITEINFO( ::oox::xls::ExcelBiffFilter );
++            WRITEINFO( ::oox::xls::SimpleExcelVBAProjFilter );
++            WRITEINFO( ::oox::ole::SimpleWordVBAProjFilter );
+             WRITEINFO( ::oox::shape::ShapeContextHandler );
+             WRITEINFO( ::oox::shape::FastTokenHandlerService );
+             WRITEINFO( ::oox::docprop::OOXMLDocPropImportImpl );
+@@ -151,6 +155,8 @@ OOX_DLLPUBLIC void * SAL_CALL component_getFactory( const sal_Char * pImplName,
+         else SINGLEFACTORY( ::oox::xls::BiffDetector )
+         else SINGLEFACTORY( ::oox::xls::ExcelFilter )
+         else SINGLEFACTORY( ::oox::xls::ExcelBiffFilter )
++        else SINGLEFACTORY( ::oox::xls::SimpleExcelVBAProjFilter )
++        else SINGLEFACTORY( ::oox::ole::SimpleWordVBAProjFilter )
+         else SINGLEFACTORY( ::oox::shape::ShapeContextHandler)
+         else SINGLEFACTORY( ::oox::shape::FastTokenHandlerService)
+         else SINGLEFACTORY2( ::oox::docprop::OOXMLDocPropImportImpl )
+diff --git oox/source/dump/oledumper.ini oox/source/dump/oledumper.ini
+index 7efe424..938efd0 100644
+--- oox/source/dump/oledumper.ini
++++ oox/source/dump/oledumper.ini
+@@ -725,11 +725,6 @@ combilist=VBA-FORMSITE-CLASSIDCACHE
+   0x8000=!predefined-class-id!class-table-index
+ end
+ 
+-constlist=VBA-FORMSITE-CLASSIDCACHEINDEX
+-  include=VBA-FORMSITE-CLASSNAMES
+-  0x7FFF=invalid
+-end
+-
+ constlist=VBA-FORMSITE-CLASSNAMES
+   7=Forms.Form.1
+   12=Forms.Image.1
+@@ -749,6 +744,11 @@ constlist=VBA-FORMSITE-CLASSNAMES
+   57=Forms.MultiPage.1
+ end
+ 
++constlist=VBA-FORMSITE-CLASSIDCACHEINDEX
++  include=VBA-FORMSITE-CLASSNAMES
++  0x7FFF=invalid
++end
++
+ # form design extender  ------------------------------------------------------
+ 
+ flagslist=VBA-FORMDESIGNEXT-PROPERTIES
+diff --git oox/source/helper/propertyset.cxx oox/source/helper/propertyset.cxx
+index b43ea12..1f1403e 100644
+--- oox/source/helper/propertyset.cxx
++++ oox/source/helper/propertyset.cxx
+@@ -30,6 +30,21 @@
+ #include <osl/diagnose.h>
+ #include "oox/helper/propertymap.hxx"
+ 
++#include <com/sun/star/lang/XMultiServiceFactory.hpp>
++#include <com/sun/star/beans/NamedValue.hpp>
++#include <com/sun/star/form/binding/XBindableValue.hpp>
++#include <com/sun/star/form/binding/XListEntrySink.hpp>
++#include <com/sun/star/form/binding/XListEntrySource.hpp>
++#include <com/sun/star/form/binding/XValueBinding.hpp>
++#include <com/sun/star/table/CellRangeAddress.hpp>
++#include <com/sun/star/table/CellAddress.hpp>
++#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
++#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
++#include <com/sun/star/container/XNameAccess.hpp>
++#include <oox/helper/helper.hxx>
++
++#include "properties.hxx"
++
+ using ::rtl::OUString;
+ using ::rtl::OStringBuffer;
+ using ::rtl::OUStringToOString;
+@@ -37,8 +52,22 @@ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Exception;
++using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::UNO_QUERY;
++using ::com::sun::star::uno::UNO_QUERY_THROW;
++using ::com::sun::star::lang::XMultiServiceFactory;
+ using ::com::sun::star::beans::XPropertySet;
++using ::com::sun::star::beans::NamedValue;
++using ::com::sun::star::frame::XModel;
++using ::com::sun::star::container::XNameAccess;
++using ::com::sun::star::form::binding::XBindableValue;
++using ::com::sun::star::form::binding::XListEntrySink;
++using ::com::sun::star::form::binding::XListEntrySource;
++using ::com::sun::star::form::binding::XValueBinding;
++using ::com::sun::star::table::CellRangeAddress;
++using ::com::sun::star::table::CellAddress;
++using ::com::sun::star::sheet::XCellRangeReferrer;
++using ::com::sun::star::sheet::XCellRangeAddressable;
+ 
+ namespace oox {
+ 
+@@ -178,6 +207,109 @@ void PropertySet::dump()
+     PropertyMap::dump( Reference< XPropertySet >( getXPropertySet(), UNO_QUERY ) );
+ }
+ #endif
++bool lcl_isNamedRange( const rtl::OUString& sAddress, const Reference< XModel >& xModel, CellRangeAddress& aAddress )
 +{
-+public:
-+    OCX_Page( SotStorageRef& parentStorage,
-+            sal_Int32 nID,
-+            const ::rtl::OUString& sN,
-+            const com::sun::star::uno::Reference<
-+                com::sun::star::container::XNameContainer >  &rDialog, OCX_Control* parent = NULL);
-+    virtual sal_Bool Read(SvStorageStream *pS);
- 
--    sal_uInt8 pPictureHeader[20];
--    sal_uInt32  nPictureLen;
--    sal_uInt8 *pPicture;
-+    using OCX_ParentControl::Import; // to not hide the other two import methods
-+    virtual sal_Bool Import(com::sun::star::uno::Reference<
-+        com::sun::star::beans::XPropertySet> &rPropSet);
-+        rtl::OUString msTitle; // #FIXME we should use the existing caption
-+        sal_Int32 mnID;
- private:
- };
++    bool bRes = false;
++    const static OUString sNamedRanges( RTL_CONSTASCII_USTRINGPARAM("NamedRanges"));
++    Reference< XCellRangeReferrer > xReferrer;
++    try
++    {
++        Reference< XPropertySet > xPropSet( xModel, UNO_QUERY_THROW );
++        Reference< XNameAccess > xNamed( xPropSet->getPropertyValue( sNamedRanges ), UNO_QUERY_THROW );
++        xReferrer.set ( xNamed->getByName( sAddress ), UNO_QUERY );
++    }
++    catch( Exception& /*e*/ )
++    {
++        // do nothing
++    }
++    if ( xReferrer.is() )
++    {
++        Reference< XCellRangeAddressable > xRangeAddressable( xReferrer->getReferredCells(), UNO_QUERY );
++        if ( xRangeAddressable.is() )
++        {
++            aAddress = xRangeAddressable->getRangeAddress();
++            bRes = true;
++        }
++    }
++    return bRes;
++}
++
++void lcl_ApplyListSourceAndBindableStuff( const Reference< XModel >& xModel, const Reference< XPropertySet >& rPropSet, const OUString& rsCtrlSource, const OUString& rsRowSource )
++{
++// XBindable etc.
++    Reference< XMultiServiceFactory > xFac;
++    if ( xModel.is() )
++        xFac.set( xModel, UNO_QUERY );
++    Reference< XBindableValue > xBindable( rPropSet, 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
++         Reference< XPropertySet > xConvertor( xFac->createInstance( CREATE_OUSTRING( "com.sun.star.table.CellAddressConversion" )), UNO_QUERY );
++         CellAddress aAddress;
++         if ( xConvertor.is() )
++         {
++             // we need this service to properly convert XL notation also
++             // Should be easy to extend
++             xConvertor->setPropertyValue( CREATE_OUSTRING( "XL_A1_Representation" ), makeAny( rsCtrlSource ) );
++             xConvertor->getPropertyValue( CREATE_OUSTRING( "Address" ) ) >>= aAddress;    
++         }
++        
++         NamedValue aArg1;
++         aArg1.Name = CREATE_OUSTRING("BoundCell");
++         aArg1.Value <<= aAddress;
++
++         Sequence< Any > aArgs(1);
++         aArgs[ 0 ]  <<= aArg1;
++
++         Reference< XValueBinding > xBinding( xFac->createInstanceWithArguments( CREATE_OUSTRING("com.sun.star.table.CellValueBinding" ), aArgs ), UNO_QUERY );
++         xBindable->setValueBinding( xBinding );
++    }
++    Reference< XListEntrySink > xListEntrySink( rPropSet, 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
++         Reference< XPropertySet > xConvertor( xFac->createInstance( CREATE_OUSTRING( "com.sun.star.table.CellRangeAddressConversion" )), UNO_QUERY );
++         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( CREATE_OUSTRING( "XL_A1_Representation" ), makeAny( rsRowSource ) );
++                 xConvertor->getPropertyValue( CREATE_OUSTRING( "Address" ) ) >>= aAddress;
++             }
++         }
++        
++         NamedValue aArg1;
++         aArg1.Name = CREATE_OUSTRING("CellRange");
++         aArg1.Value <<= aAddress;
++
++         Sequence< Any > aArgs(1);
++         aArgs[ 0 ]  <<= aArg1;
++
++         Reference< XListEntrySource > xSource( xFac->createInstanceWithArguments( CREATE_OUSTRING("com.sun.star.table.CellRangeListSource" ), aArgs ), UNO_QUERY );
++         xListEntrySink->setListEntrySource( xSource );
++    }
++}
++void FormPropertySet::setDataAwareProperties( const Reference< XModel >& rxDocModel, const PropertyMap& rMap )
++{
++    OUString sRowSource;
++    OUString sControlSource;
++    if ( rMap.hasProperty( PROP_ControlSource ) )
++        *(rMap.getProperty( PROP_ControlSource )) >>= sControlSource;
++    if ( rMap.hasProperty( PROP_RowSource ) )
++        *(rMap.getProperty( PROP_RowSource )) >>= sRowSource;
++    lcl_ApplyListSourceAndBindableStuff( rxDocModel, getXPropertySet(), sControlSource, sRowSource );
++}
  
+ // ============================================================================
  
--class OCX_Frame : public OCX_ContainerControl
-+class OCX_Frame : public OCX_ParentControl
- {
- public:
-     OCX_Frame( SotStorageRef& parent,
-@@ -734,162 +654,32 @@ public:
-             const ::rtl::OUString& sN,
-             const com::sun::star::uno::Reference<
-                 com::sun::star::container::XNameContainer >  &rDialog, OCX_Control* pParent = NULL);
--    virtual ~OCX_Frame()
--    {
--        delete[] pCaption;
--        delete[] pIcon;
--        delete[] pPicture;
--    }
-     virtual sal_Bool Read(SvStorageStream *pS);
+diff --git oox/source/ole/axbinaryreader.cxx oox/source/ole/axbinaryreader.cxx
+index 3809201..648b827 100755
+--- oox/source/ole/axbinaryreader.cxx
++++ oox/source/ole/axbinaryreader.cxx
+@@ -156,6 +156,30 @@ bool AxFontData::importGuidAndFont( BinaryInputStream& rInStrm )
  
--    using OCX_ContainerControl::Import; // to not hide the other two import methods
-+    using OCX_ParentControl::Import; // to not hide the other two import methods
-     virtual sal_Bool Import(com::sun::star::uno::Reference<
-         com::sun::star::beans::XPropertySet> &rPropSet);
--
--    /*sal_uInt8 for sal_uInt8 Word Struct*/
--    sal_uInt16 nIdentifier;
--    sal_uInt16 nFixedAreaLen;
--    sal_uInt8	pBlockFlags[4];
--
--    sal_uInt32  fUnknown1;
--
--    sal_uInt8	fUnknown2:1;
--    sal_uInt8	fEnabled:1;
--    sal_uInt8	fLocked:1;
--    sal_uInt8	fBackStyle:1;
--    sal_uInt8	fUnknown3:4;
--
--    sal_uInt8	fUnknown4:8;
--
--    sal_uInt8	fUnknown5:7;
--    sal_uInt8	fWordWrap:1;
--
--    sal_uInt8	fUnknown6:4;
--    sal_uInt8	fAutoSize:1;
--    sal_uInt8	fUnknown7:3;
--
--    sal_uInt32	nCaptionLen;
--    sal_uInt16  nVertPos;
--    sal_uInt16  nHorzPos;
--    sal_uInt8 	nMousePointer;
--    sal_uInt32	nBorderColor;
--    sal_uInt32  fUnknown8;
--    sal_uInt32  fUnknown9;
--    sal_uInt8   nKeepScrollBarsVisible;
--    sal_uInt8   nCycle;
--    sal_uInt16	nBorderStyle;
--    sal_uInt16	nSpecialEffect;
--    sal_uInt16	nPicture;
--    sal_uInt8   nPictureAlignment;
--    sal_uInt8   nPictureSizeMode;
--    bool        bPictureTiling;
--    sal_uInt16	nAccelerator;
--    sal_uInt16	nIcon;
--
--    char *pCaption;
--
--    sal_uInt32 	nScrollWidth;
--    sal_uInt32 	nScrollHeight;
--    sal_uInt32 	nScrollLeft;
--    sal_uInt32 	nScrollTop;
--
--
--    sal_uInt8 pIconHeader[20];
--    sal_uInt32  nIconLen;
--    sal_uInt8 *pIcon;
--
--    sal_uInt8 pPictureHeader[20];
--    sal_uInt32  nPictureLen;
--    sal_uInt8 *pPicture;
--private:
- };
+ // ============================================================================
  
--class OCX_UserForm : public OCX_ContainerControl
++namespace {
++
++bool lclReadString( AxAlignedInputStream& rInStrm, OUString& rValue, sal_uInt32 nSize, bool bArrayString )
++{
++    bool bCompressed = getFlag( nSize, AX_STRING_COMPRESSED );
++    sal_uInt32 nBufSize = nSize & AX_STRING_SIZEMASK;
++    // Unicode: simple strings store byte count, array strings store char count
++    sal_Int32 nChars = static_cast< sal_Int32 >( nBufSize / ((bCompressed || bArrayString) ? 1 : 2) );
++    bool bValidChars = nChars <= 65536;
++    OSL_ENSURE( bValidChars, "lclReadString - string too long" );
++    sal_Int64 nEndPos = rInStrm.tell() + nChars * (bCompressed ? 1 : 2);
++    nChars = ::std::min< sal_Int32 >( nChars, 65536 );
++    rValue = bCompressed ?
++        // ISO-8859-1 maps all byte values xx to the same Unicode code point U+00xx
++        rInStrm.readCharArrayUC( nChars, RTL_TEXTENCODING_ISO_8859_1 ) :
++        rInStrm.readUnicodeArray( nChars );
++    rInStrm.seek( nEndPos );
++    return bValidChars;
++}
 +
-+class OCX_UserForm : public OCX_ParentControl
++} // namespace
++
++// ----------------------------------------------------------------------------
++
+ AxBinaryPropertyReader::ComplexProperty::~ComplexProperty()
  {
- public:
--    OCX_UserForm( SotStorageRef& parent,
-+        OCX_UserForm( SotStorageRef& parent,
-             const ::rtl::OUString& storageName,
-             const ::rtl::OUString& sN,
-             const com::sun::star::uno::Reference<
-                 com::sun::star::container::XNameContainer >  &rDialog,
-             const com::sun::star::uno::Reference<
-                 com::sun::star::lang::XMultiServiceFactory >& rMsf);
--    ~OCX_UserForm()
--    {
--        delete[] pCaption;
--        delete[] pIcon;
--    }
--
--    virtual sal_Bool Read(SvStorageStream *pS);
--
--    using OCX_ContainerControl::Import; // to not hide the other two import methods
-     virtual sal_Bool Import( com::sun::star::uno::Reference<
-         com::sun::star::container::XNameContainer>
-         &rDialog);
--
--    /*sal_uInt8 for sal_uInt8 Word Struct*/
--    sal_uInt16 nIdentifier;
--    sal_uInt16 nFixedAreaLen;
--    sal_uInt8	pBlockFlags[4];
--
--    sal_uInt32  nChildrenA;
--
--    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_uInt32  nDrawBuffer;
--    sal_uInt32  nChildrenB;
--    sal_uInt8   nKeepScrollBarsVisible;
--    sal_uInt8   nCycle;
--    sal_uInt16	nBorderStyle;
--    sal_uInt8	nSpecialEffect;
--    sal_uInt16	nPicture;
--    sal_uInt8   nPictureAlignment;
--    sal_uInt8   nPictureSizeMode;
--    bool        bPictureTiling;
--    sal_uInt16	nAccelerator;
--    sal_uInt16	nIcon;
--    sal_uInt16	fUnknown7;
--
--    char *pCaption;
--
--    sal_uInt32 	nScrollWidth;
--    sal_uInt32 	nScrollHeight;
--    sal_uInt32 	nScrollLeft;
--    sal_uInt32 	nScrollTop;
--
--    sal_uInt8 pIconHeader[20];
--    sal_uInt32  nIconLen;
--    sal_uInt8 *pIcon;
--
--    sal_uInt8 pPictureHeader[20];
--    sal_uInt32  nPictureLen;
--    ::rtl::OUString sImageUrl;
--    com::sun::star::uno::Reference< com::sun::star::graphic::XGraphicObject> mxGrfObj;
- private:
-         com::sun::star::uno::Reference<
-                 com::sun::star::uno::XComponentContext> mxCtx;
- };
+ }
+@@ -168,19 +192,22 @@ bool AxBinaryPropertyReader::PairProperty::readProperty( AxAlignedInputStream& r
  
--
--
- class OCX_CheckBox : public OCX_ModernControl
+ bool AxBinaryPropertyReader::StringProperty::readProperty( AxAlignedInputStream& rInStrm )
  {
- public:
-@@ -1130,8 +920,6 @@ public:
- 
-     sal_uInt8 pPictureHeader[20];
-     sal_uInt32  nPictureLen;
--    ::rtl::OUString sImageUrl;
--    com::sun::star::uno::Reference< com::sun::star::graphic::XGraphicObject> mxGrfObj;
- 
-     bool        mbTakeFocus;
+-    bool bCompressed = getFlag( mnSize, AX_STRING_COMPRESSED );
+-    sal_uInt32 nBufSize = mnSize & AX_STRING_SIZEMASK;
+-    sal_Int64 nEndPos = rInStrm.tell() + nBufSize;
+-    sal_Int32 nChars = static_cast< sal_Int32 >( nBufSize / (bCompressed ? 1 : 2) );
+-    bool bValidChars = nChars <= 65536;
+-    OSL_ENSURE( bValidChars, "StringProperty::readProperty - string too long" );
+-    nChars = ::std::min< sal_Int32 >( nChars, 65536 );
+-    mrValue = bCompressed ?
+-        // ISO-8859-1 maps all byte values xx to the same Unicode code point U+00xx
+-        rInStrm.readCharArrayUC( nChars, RTL_TEXTENCODING_ISO_8859_1 ) :
+-        rInStrm.readUnicodeArray( nChars );
+-    rInStrm.seek( nEndPos );
+-    return bValidChars;
++    return lclReadString( rInStrm, mrValue, mnSize, false );
++}
++
++bool AxBinaryPropertyReader::StringArrayProperty::readProperty( AxAlignedInputStream& rInStrm )
++{
++    sal_Int64 nEndPos = rInStrm.tell() + mnSize;
++    while( rInStrm.tell() < nEndPos )
++    {
++        OUString aString;
++        if( !lclReadString( rInStrm, aString, rInStrm.readuInt32(), true ) )
++            return false;
++        mrArray.push_back( aString );
++        // every array string is aligned on 4 byte boundries
++        rInStrm.align( 4 );
++    }
++    return true;
+ }
  
-@@ -1193,7 +981,7 @@ public:
-     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),pPicture(0)
-+    nPictureLen(0)
-     {
-         msFormType = rtl::OUString::createFromAscii("com.sun.star.form.component.FixedText");
-         msDialogType = rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlFixedTextModel");
-@@ -1205,7 +993,6 @@ public:
-     ~OCX_Label() {
-         if (pCaption) delete[] pCaption;
-         if (pIcon) delete[] pIcon;
--        if (pPicture) delete[] pPicture;
+ bool AxBinaryPropertyReader::GuidProperty::readProperty( AxAlignedInputStream& rInStrm )
+@@ -238,6 +265,15 @@ void AxBinaryPropertyReader::readStringProperty( OUString& orValue )
      }
-     sal_Bool Read(SotStorageStream *pS);
- 
-@@ -1249,7 +1036,6 @@ public:
- 
-     sal_uInt8 pPictureHeader[20];
-     sal_uInt32  nPictureLen;
--	sal_uInt8 *pPicture;
- 
-     static OCX_Control *Create() { return new OCX_Label;}
- 
-diff --git a/svx/source/msfilter/msocximex.cxx b/svx/source/msfilter/msocximex.cxx
-index fa0b3f1..d132dc0 100644
---- a/svx/source/msfilter/msocximex.cxx
-+++ b/svx/source/msfilter/msocximex.cxx
-@@ -359,6 +359,39 @@ OUString lclCreateOUString( const char* pcCharArr, sal_uInt32 nLenFld )
-     return svt::BinFilterUtils::CreateOUStringFromUniStringArray( pcCharArr, nBufSize );
  }
  
-+void readArrayString( SotStorageStream *pS, std::vector< rtl::OUString >& sStringsOut, sal_Int32 nSize, long nStart )
++void AxBinaryPropertyReader::readStringArrayProperty( AxStringArray& orArray )
 +{
-+    unsigned long nFinish = pS->Tell() + nSize;
-+    while ( pS->Tell() < nFinish )
++    if( startNextProperty() )
 +    {
-+        sal_Int32 nStringLen = 0;
-+        *pS >> nStringLen;
-+        sal_uInt32 nStringSize = lclGetBufferSize( nStringLen );
-+        sal_Char* pString = new sal_Char[ nStringSize ];
-+        pS->Read( pString, nStringSize );
-+        rtl::OUString sString = lclCreateOUString( pString, nStringLen );
-+        delete[] pString;
-+        sStringsOut.push_back( sString );
-+        ReadAlign(pS, pS->Tell() - nStart, 4);
++        sal_uInt32 nSize = maInStrm.readAligned< sal_uInt32 >();
++        maLargeProps.push_back( ComplexPropVector::value_type( new StringArrayProperty( orArray, nSize ) ) );
 +    }
 +}
 +
-+OUString createSubStreamName( const sal_uInt32& subStorageId )
+ void AxBinaryPropertyReader::readGuidProperty( ::rtl::OUString& orGuid )
+ {
+     if( startNextProperty() )
+diff --git oox/source/ole/axcontrol.cxx oox/source/ole/axcontrol.cxx
+index 7f75218..b5d86e3 100644
+--- oox/source/ole/axcontrol.cxx
++++ oox/source/ole/axcontrol.cxx
+@@ -128,6 +128,7 @@ const sal_uInt32 AX_IMAGE_DEFFLAGS          = 0x0000001B;
+ const sal_uInt32 AX_MORPHDATA_DEFFLAGS      = 0x2C80081B;
+ const sal_uInt32 AX_SPINBUTTON_DEFFLAGS     = 0x0000001B;
+ const sal_uInt32 AX_SCROLLBAR_DEFFLAGS      = 0x0000001B;
++const sal_uInt32 AX_TABSTRIP_DEFFLAGS       = 0x0000001B;
+ 
+ const sal_uInt16 AX_POS_TOPLEFT             = 0;
+ const sal_uInt16 AX_POS_TOP                 = 1;
+@@ -186,6 +187,10 @@ const sal_Int32 AX_ORIENTATION_HORIZONTAL   = 1;
+ const sal_Int32 AX_PROPTHUMB_ON             = -1;
+ const sal_Int32 AX_PROPTHUMB_OFF            = 0;
+ 
++const sal_uInt32 AX_TABSTRIP_TABS           = 0;
++const sal_uInt32 AX_TABSTRIP_BUTTONS        = 1;
++const sal_uInt32 AX_TABSTRIP_NONE           = 2;
++
+ const sal_uInt32 AX_CONTAINER_ENABLED       = 0x00000004;
+ const sal_uInt32 AX_CONTAINER_HASDESIGNEXT  = 0x00004000;
+ const sal_uInt32 AX_CONTAINER_NOCLASSTABLE  = 0x00008000;
+@@ -231,14 +236,6 @@ ControlConverter::~ControlConverter()
+ 
+ // Generic conversion ---------------------------------------------------------
+ 
+-void ControlConverter::convertSize( PropertyMap& rPropMap, const AxPairData& rSize ) const
+-{
+-    // size is given in 1/100 mm, UNO needs AppFont units
+-    Size aAppFontSize = mrGraphicHelper.convertHmmToAppFont( Size( rSize.first, rSize.second ) );
+-    rPropMap.setProperty( PROP_Width, aAppFontSize.Width );
+-    rPropMap.setProperty( PROP_Height, aAppFontSize.Height );
+-}
+-
+ void ControlConverter::convertPosition( PropertyMap& rPropMap, const AxPairData& rPos ) const
+ {
+     // position is given in 1/100 mm, UNO needs AppFont units
+@@ -247,6 +244,14 @@ void ControlConverter::convertPosition( PropertyMap& rPropMap, const AxPairData&
+     rPropMap.setProperty( PROP_PositionY, aAppFontPos.Y );
+ }
+ 
++void ControlConverter::convertSize( PropertyMap& rPropMap, const AxPairData& rSize ) const
 +{
-+    static OUString sI = OUString::createFromAscii("i");
-+    static OUString sZero = OUString::createFromAscii( "0" );
-+    OUStringBuffer buf( 6 );
-+    buf.append( sI );
-+    // for subStorage id < 10 stream name has leading '0'
-+    // eg "i07"
-+    if ( subStorageId < 10 )
-+    {
-+        buf.append( sZero );
-+    }
-+    buf.append( OUString::valueOf( (sal_Int32)subStorageId ) );
-+    return buf.makeStringAndClear();
++    // size is given in 1/100 mm, UNO needs AppFont units
++    Size aAppFontSize = mrGraphicHelper.convertHmmToAppFont( Size( rSize.first, rSize.second ) );
++    rPropMap.setProperty( PROP_Width, aAppFontSize.Width );
++    rPropMap.setProperty( PROP_Height, aAppFontSize.Height );
 +}
 +
- // export ---------------------------------------------------------------------
- 
- /** This class implements writing a character array from a Unicode string.
-@@ -451,6 +484,44 @@ void SvxOcxString::WriteCharArray( SvStorageStream& rStrm ) const
+ void ControlConverter::convertColor( PropertyMap& rPropMap, sal_Int32 nPropId, sal_uInt32 nOleColor ) const
+ {
+     rPropMap.setProperty( nPropId, OleHelper::decodeOleColor( mrGraphicHelper, nOleColor, mbDefaultColorBgr ) );
+@@ -426,14 +431,16 @@ OUString ControlModelBase::getServiceName() const
+         case API_CONTROL_FIXEDTEXT:     return CREATE_OUSTRING( "com.sun.star.awt.UnoControlFixedTextModel" );
+         case API_CONTROL_IMAGE:         return CREATE_OUSTRING( "com.sun.star.awt.UnoControlImageControlModel" );
+         case API_CONTROL_CHECKBOX:      return CREATE_OUSTRING( "com.sun.star.awt.UnoControlCheckBoxModel" );
+-        case API_CONTROL_RADIOBUTTON:   return CREATE_OUSTRING( "com.sun.star.awt.UnoControlRadioButtonModel" );
++        case API_CONTROL_RADIOBUTTON:   return CREATE_OUSTRING( "com.sun.star.form.component.RadioButton" );
+         case API_CONTROL_EDIT:          return CREATE_OUSTRING( "com.sun.star.awt.UnoControlEditModel" );
+-        case API_CONTROL_LISTBOX:       return CREATE_OUSTRING( "com.sun.star.awt.UnoControlListBoxModel" );
+-        case API_CONTROL_COMBOBOX:      return CREATE_OUSTRING( "com.sun.star.awt.UnoControlComboBoxModel" );
+-        case API_CONTROL_SPINBUTTON:    return CREATE_OUSTRING( "com.sun.star.awt.UnoControlSpinButtonModel" );
+-        case API_CONTROL_SCROLLBAR:     return CREATE_OUSTRING( "com.sun.star.awt.UnoControlScrollBarModel" );
++        case API_CONTROL_LISTBOX:       return CREATE_OUSTRING( "com.sun.star.form.component.ListBox" );
++        case API_CONTROL_COMBOBOX:      return CREATE_OUSTRING( "com.sun.star.form.component.ComboBox" );
++        case API_CONTROL_SPINBUTTON:    return CREATE_OUSTRING( "com.sun.star.form.component.SpinButton" );
++        case API_CONTROL_SCROLLBAR:     return CREATE_OUSTRING( "com.sun.star.form.component.ScrollBar" );
+         case API_CONTROL_PROGRESSBAR:   return CREATE_OUSTRING( "com.sun.star.awt.UnoControlProgressBarModel" );
+-        case API_CONTROL_GROUPBOX:      return CREATE_OUSTRING( "com.sun.star.awt.UnoControlGroupBoxModel" );
++        case API_CONTROL_FRAME:         return CREATE_OUSTRING( "com.sun.star.awt.UnoFrameModel" );
++        case API_CONTROL_PAGE:          return CREATE_OUSTRING( "com.sun.star.awt.UnoPageModel" );
++        case API_CONTROL_MULTIPAGE:     return CREATE_OUSTRING( "com.sun.star.awt.UnoMultiPageModel" );
+         case API_CONTROL_DIALOG:        return CREATE_OUSTRING( "com.sun.star.awt.UnoControlDialogModel" );
+         default:    OSL_ENSURE( false, "ControlModelBase::getServiceName - no AWT model service supported" );
      }
- }
+@@ -1362,7 +1369,69 @@ void AxScrollBarModel::convertProperties( PropertyMap& rPropMap, const ControlCo
+ 
+ // ============================================================================
  
-+class MultiPageProps
+-AxContainerModelBase::AxContainerModelBase() :
++AxTabStripModel::AxTabStripModel() :
++    AxFontDataModel( false ),   // no support for Align property
++    mnBackColor( AX_SYSCOLOR_BUTTONFACE ),
++    mnTextColor( AX_SYSCOLOR_BUTTONTEXT ),
++    mnFlags( AX_TABSTRIP_DEFFLAGS ),
++    mnSelectedTab( -1 ),
++    mnTabStyle( AX_TABSTRIP_TABS ),
++    mnTabFlagCount( 0 )
 +{
-+public:
-+    sal_uInt16	nIdentifier; // major & minor version
-+    sal_uInt16	nFixedAreaLen; // size of record
-+    sal_uInt8	pBlockFlags[4]; // size of record
-+    sal_Int32   mnPageCount;
-+    sal_Int32   mnID;
-+    bool        mbEnabled;
-+    std::vector< sal_Int32 > mnIDs;
-+
-+    MultiPageProps();
-+    bool Read(SotStorageStream *pS);
-+};
++}
 +
-+MultiPageProps::MultiPageProps() : nIdentifier(0), nFixedAreaLen(0), mnPageCount(0), mnID(0), mbEnabled( true )
++bool AxTabStripModel::importBinaryModel( BinaryInputStream& rInStrm )
 +{
++    AxBinaryPropertyReader aReader( rInStrm );
++    aReader.readIntProperty< sal_Int32 >( mnSelectedTab );
++    aReader.readIntProperty< sal_uInt32 >( mnBackColor );
++    aReader.readIntProperty< sal_uInt32 >( mnTextColor );
++    aReader.skipUndefinedProperty();
++    aReader.readPairProperty( maSize );
++    aReader.readStringArrayProperty( maCaptions );
++    aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer
++    aReader.skipUndefinedProperty();
++    aReader.skipIntProperty< sal_uInt32 >(); // tab orientation
++    aReader.readIntProperty< sal_uInt32 >( mnTabStyle );
++    aReader.skipBoolProperty(); // multiple rows
++    aReader.skipIntProperty< sal_uInt32 >(); // fixed width
++    aReader.skipIntProperty< sal_uInt32 >(); // fixed height
++    aReader.skipBoolProperty(); // tooltips
++    aReader.skipUndefinedProperty();
++    aReader.skipStringArrayProperty(); // tooltip strings
++    aReader.skipUndefinedProperty();
++    aReader.skipStringArrayProperty(); // tab names
++    aReader.readIntProperty< sal_uInt32 >( mnFlags );
++    aReader.skipBoolProperty(); // new version
++    aReader.skipIntProperty< sal_uInt32 >(); // tabs allocated
++    aReader.skipStringArrayProperty(); // tags
++    aReader.readIntProperty< sal_uInt32 >( mnTabFlagCount );
++    aReader.skipStringArrayProperty(); // accelerators
++    aReader.skipPictureProperty(); // mouse icon
++    return aReader.finalizeImport() && AxFontDataModel::importBinaryModel( rInStrm );
 +}
 +
-+bool MultiPageProps::Read(SotStorageStream *pS)
++ApiControlType AxTabStripModel::getControlType() const
 +{
-+    *pS >> nIdentifier >> nFixedAreaLen;
-+    pS->Read( pBlockFlags, sizeof( pBlockFlags ) );
-+    if ( pBlockFlags[ 0 ] & 0x02 )
-+        *pS >> mnPageCount;
-+    if ( pBlockFlags[ 0 ] & 0x04 )
-+        *pS >> mnID;
-+    if ( pBlockFlags[ 0 ] & 0x08 )
-+        mbEnabled = false;
-+    for ( sal_Int32 i=0; i<mnPageCount; ++i )
-+    {
-+        sal_Int32 nID(0);
-+        *pS >> nID;
-+        mnIDs.push_back( nID );
-+    }
-+    return true;
++    return API_CONTROL_TABSTRIP;
 +}
 +
- const sal_uInt16 USERFORM = (sal_uInt16)0xFF;
- const sal_uInt16 STDCONTAINER = (sal_uInt16)0xFE;
- 
-@@ -476,48 +547,42 @@ const sal_uInt16 TOGGLEBUTTON = (sal_uInt16)0x1C;
- const sal_uInt16 SCROLLBAR = (sal_uInt16)0x2F;
- 
- const sal_uInt16 MULTIPAGE = (sal_uInt16)0x39;
--// The IDs with bit 0x8000 set appear to be generated.
--// It looks like these ID's are used with the non-toolbox [1]
--// ActiveX controls that can be present in a Userform
--// ( note: RefEdit seems to be an exception )
--// In UserForm::Read just before the Container record starts
--// you will notice there can be sometimes trailing records,
--// it seems that these records have a 1:1 relationship with the non-toolbox
--// controls present in the Userform. An id in the trailing record
--// seems to identify the specific ActiveX control and an artificial nTypeIdent
--// e.g. 0x8000, 0x8001 etc. is created so as to be able to associate
--// the ActiveX control when referenced later
--// [1] Such ActiveX controls are added via Tools/AddionalControls
--// menu
--
--// create a fixed set of those special id(s)
--// ahem, we can only read one Progress bars at the moment so....
-+
-+const sal_uInt16 UNKNOWNCTRL = (sal_uInt16)0x7FFF;
- const sal_uInt16 PROGRESSBAR = (sal_uInt16)0x8000;
- 
--// A set of IDs from the trailing records mentioned above that seem to
--// identify the following ActiveX controls
-+// following ActiveX controls are just for reference ( are NOT supported )
-+const sal_uInt16 REFEDIT = (sal_uInt16)0x8001;
-+const sal_uInt16 CALENDAR = (sal_uInt16)0x8002;
-+const sal_uInt16 IMAGECOMBO = (sal_uInt16)0x8003;
-+const sal_uInt16 IMAGELIST = (sal_uInt16)0x8004;
-+const sal_uInt16 SLIDER = (sal_uInt16)0x8005;
-+const sal_uInt16 STATUSBAR = (sal_uInt16)0x8006;
-+const sal_uInt16 CHARTSPACE = (sal_uInt16)0x8007;
-+
-+// A set of common CLSIDs
-+// there are to identify the following ActiveX controls ( that appear in the ClassTable records )
- // Currently we only can process ( in a limited way ) the ProgressBar
- // the other ID's are for reference ( & future )
- 
--// RefEdit control {00024512-0000-0000-c000-000000000046}
--const sal_uInt8 aRefEditID[] =
--{
--0x12, 0x45, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46,
--};
--
- // Microsoft ProgressBar Control, version 6.0 {35053A22-8589-11D1-B16A-00C0F0283628}
- const sal_uInt8 aProgressID[] =
++void AxTabStripModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const
++{
++    rPropMap.setProperty( PROP_Decoration, mnTabStyle != AX_TABSTRIP_NONE );
++    rPropMap.setProperty( PROP_MultiPageValue, mnSelectedTab );
++    rConv.convertColor( rPropMap, PROP_BackgroundColor, mnBackColor );
++    AxFontDataModel::convertProperties( rPropMap, rConv );
++}
++
++OUString AxTabStripModel::getCaption( sal_Int32 nIndex ) const
++{
++    return ContainerHelper::getVectorElement( maCaptions, nIndex, OUString() );
++}
++
++// ============================================================================
++
++AxContainerModelBase::AxContainerModelBase( bool bFontSupport ) :
+     AxFontDataModel( false ),   // no support for Align property
+     maLogicalSize( AX_CONTAINER_DEFWIDTH, AX_CONTAINER_DEFHEIGHT ),
+     maScrollPos( 0, 0 ),
+@@ -1376,7 +1445,8 @@ AxContainerModelBase::AxContainerModelBase() :
+     mnSpecialEffect( AX_SPECIALEFFECT_FLAT ),
+     mnPicAlign( AX_PICALIGN_CENTER ),
+     mnPicSizeMode( AX_PICSIZE_CLIP ),
+-    mbPicTiling( false )
++    mbPicTiling( false ),
++    mbFontSupport( bFontSupport )
  {
- 0x22, 0x3a, 0x05, 0x35, 0x89, 0x85, 0xd1, 0x11,  0xb1, 0x6a, 0x00, 0xc0, 0xf0, 0x28, 0x36, 0x28,
- };
+     setAwtModelMode();
+     // different default size for frame
+@@ -1423,6 +1493,15 @@ bool AxContainerModelBase::importBinaryModel( BinaryInputStream& rInStrm )
+     return aReader.finalizeImport();
+ }
  
-+// RefEdit control {00024512-0000-0000-c000-000000000046}
-+const sal_uInt8 aRefEditID[] =
++void AxContainerModelBase::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const
 +{
-+0x12, 0x45, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46,
-+};
++    if( mbFontSupport )
++    {
++        rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor );
++        AxFontDataModel::convertProperties( rPropMap, rConv );
++    }
++}
 +
- // Calendar Control 10.0
- const sal_uInt8 aCalendarID[] =
+ bool AxContainerModelBase::importClassTable( BinaryInputStream& rInStrm, AxClassTable& orClassTable )
  {
- 0x2b, 0xc9, 0x27, 0x8e, 0x64, 0x12, 0x1c, 0x10, 0x8a, 0x2f, 0x04, 0x02, 0x24, 0x00, 0x9c, 0x02,
- };
+     bool bValid = true;
+@@ -1457,13 +1536,14 @@ bool AxContainerModelBase::importClassTable( BinaryInputStream& rInStrm, AxClass
  
--
- // Microsoft ImageComboxBox Control, version 6.0 {DD9DA666-8594-11D1-B16A-00C0F0283628}
- const sal_uInt8 aImageComboID[] =
- {
-@@ -548,243 +613,368 @@ const sal_uInt8 aChartSpaceID[] =
- 0x46, 0xe5, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46,
- };
+ // ============================================================================
  
--const sal_Int16 ActiveXIDLen = 0x10; // CLSID len
--const sal_Int16 ActiveXIDBlockLen = 0x30; // the block len that contains the CLSID
-+const sal_uInt8 nSizeOfClsid = sizeof( aProgressID );
+-AxFrameModel::AxFrameModel()
++AxFrameModel::AxFrameModel() :
++    AxContainerModelBase( true )
+ {
+ }
  
--bool lcl_handleActiveXControl(  SvStorageStream *pS, sal_uInt16& nTypeID )
-+struct ClsIdTypeIDPair
+ ApiControlType AxFrameModel::getControlType() const
  {
--    nTypeID = 0; // Illegal ActiveX ID
--    bool bRes = false;
--    sal_uInt16 nIdentifier, nFixedAreaLen;
--    *pS >> nIdentifier;
--    *pS >> nFixedAreaLen;
--    pS->SeekRel( ( nFixedAreaLen - ActiveXIDBlockLen ) );
--    sal_uInt8 aID[ ActiveXIDLen ];
--    if ( !pS->IsEof() )
--    {
--        pS->Read( aID, ActiveXIDLen );
--        pS->SeekRel( ActiveXIDBlockLen - ActiveXIDLen ); // read remainer of record
--        if ( memcmp( aID, aProgressID, ActiveXIDLen ) == 0 )
-+//    ClsIdTypeIDPair() : pClsID( NULL ), nTypeID( UNKNOWNCTRL ) {}
-+    const sal_uInt8* pClsID;
-+    const sal_uInt16 nTypeID;
-+};
+-    return API_CONTROL_GROUPBOX;
++    return mbAwtModel ? API_CONTROL_FRAME : API_CONTROL_GROUPBOX;
+ }
+ 
+ void AxFrameModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const
+@@ -1475,6 +1555,49 @@ void AxFrameModel::convertProperties( PropertyMap& rPropMap, const ControlConver
+ 
+ // ============================================================================
+ 
++AxFormPageModel::AxFormPageModel()
++{
++}
 +
-+ClsIdTypeIDPair ClsidList[] = { { aProgressID, PROGRESSBAR },
-+// unsupported common activex controls
-+#ifdef DEBUG
-+                                 { aRefEditID, REFEDIT },
-+                                 { aCalendarID, CALENDAR },
-+                                 { aImageComboID, IMAGECOMBO },
-+                                 { aImageListID, IMAGELIST },
-+                                 { aSliderID, SLIDER },
-+                                 { aStatusBarID, STATUSBAR },
-+                                 { aChartSpaceID, CHARTSPACE },
-+#endif
-+};
++ApiControlType AxFormPageModel::getControlType() const
++{
++    return API_CONTROL_PAGE;
++}
 +
++void AxFormPageModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const
++{
++    rPropMap.setProperty( PROP_Title, maCaption );
++    rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_CONTAINER_ENABLED ) );
++    rConv.convertColor( rPropMap, PROP_BackgroundColor, mnBackColor );
++    AxContainerModelBase::convertProperties( rPropMap, rConv );
++}
 +
-+typedef std::vector< ContainerRecord > ContainerRecordList;
++// ============================================================================
 +
-+class FormObjectDepthTypeCount
++AxMultiPageModel::AxMultiPageModel()
 +{
-+    public:
-+    sal_uInt8 depth;
-+    sal_uInt8 TypeOrCount;
-+    std::auto_ptr< sal_uInt8 > OptionalType;
-+    FormObjectDepthTypeCount() : depth(0), TypeOrCount(0) {}
-+    bool Read( SvStorageStream* pS )
-+    {
-+        *pS >> depth >> TypeOrCount;
-+        if ( TypeOrCount &  0x80 )
-         {
--            nTypeID = PROGRESSBAR;
--            OSL_TRACE("Found supported ***PROGRESSBAR*** ActiveX control");
--            bRes = true;
-+            OptionalType.reset( new sal_uInt8 );
-+            *pS >> *OptionalType;
-         }
--#if (OSL_DEBUG_LEVEL > 0)
--        // If we really want to process these more controls we should put them in
--        // a list or array and have a single loop testing each id. For the moment
--        // as we only can process PROGRESSBAR, not much point doing that until
--        // we add support for at least another activex control
--
--        else if ( memcmp( aID, aCalendarID, ActiveXIDLen ) == 0 )
--            OSL_TRACE("Found unsupported ***CALENDAR*** ActiveX control");
--        else if ( memcmp( aID, aRefEditID, ActiveXIDLen ) == 0 )
--            OSL_TRACE("Found unsupported ***REFEDIT*** ActiveX control");
--        else if ( memcmp( aID, aImageComboID, ActiveXIDLen ) == 0 )
--            OSL_TRACE("Found unsupported ***IMAGECOMBO*** ActiveX control");
--        else if ( memcmp( aID, aImageListID, ActiveXIDLen ) == 0 )
--            OSL_TRACE("Found unsupported ***IMAGELIST*** ActiveX control");
--        else if ( memcmp( aID, aChartSpaceID, ActiveXIDLen ) == 0 )
--            OSL_TRACE("Found unsupported ***CHARTSPACE*** ActiveX control");
--        else if ( memcmp( aID, aSliderID, ActiveXIDLen ) == 0 )
--            OSL_TRACE("Found unsupported ***SLIDER*** ActiveX control");
--        else if ( memcmp( aID, aStatusBarID, ActiveXIDLen ) == 0 )
--            OSL_TRACE("Found unsupported ***STATUSBAR*** ActiveX control");
--#endif
--        else
-+        TypeOrCount = ( TypeOrCount >> 1 );
-+        return true;
-+    }
-+};
++}
 +
-+class ClassTable
-+{
-+    sal_uInt16 nIdentifier;
-+    sal_uInt16 nFixedAreaLen;
-+    sal_uInt32 nContentFlags;
-+    sal_uInt16 nClassTableFlags;
-+    sal_uInt16 nVarFlags;
-+    sal_Int32 nCountOfMethods;
-+    sal_Int32 nDispidBind;
-+    sal_uInt16 nGetBindIndex;
-+    sal_uInt16 nPutBindIndex;
-+    sal_uInt16 nBindType;
-+    sal_uInt16 nGetValueIndex;
-+    sal_uInt16 nPutValueIndex;
-+    sal_uInt16 nValueType;
-+    sal_uInt32 nDisidRowset;
-+    sal_uInt16 nSetRowset;
-+    sal_uInt8 pClsId[16];
-+    sal_uInt8 pDispEvent[16];
-+    sal_uInt8 pDefaultProg[16];
-+    sal_uInt16 nTypeId;
-+public:
-+    ClassTable() :  nIdentifier( 0 )
-+                   ,nFixedAreaLen( 0 )
-+                   ,nContentFlags(0)
-+                   ,nClassTableFlags(0)
-+                   ,nVarFlags(0)
-+                   ,nCountOfMethods(0)
-+                   ,nDispidBind(0)
-+                   ,nGetBindIndex(0)
-+                   ,nPutBindIndex(0)
-+                   ,nBindType(0)
-+                   ,nGetValueIndex(0)
-+                   ,nPutValueIndex(0)
-+                   ,nValueType(0)
-+                   ,nDisidRowset(0)
-+                   ,nSetRowset(0)
-+                   ,nTypeId(UNKNOWNCTRL)
++ApiControlType AxMultiPageModel::getControlType() const
++{
++    return API_CONTROL_MULTIPAGE;
++}
 +
-+    {
-+        memset( pClsId, 0, sizeof( pClsId ) );
-+        memset( pDispEvent, 0, sizeof( pDispEvent ) );
-+        memset( pDefaultProg, 0, sizeof( pDefaultProg ) );
-+    }
-+    bool Read(  SvStorageStream* pS )
-+    {
-+        long nStartPos = pS->Tell();
-+        *pS >> nIdentifier >> nFixedAreaLen >> nContentFlags;
-+        bool bClsID( false );
-+        bool bDispEvent( false );
-+        bool bDefaultProg( false );
-+        if (  nContentFlags & 0x00000001 )
-+            bClsID = true;
-+        if (  nContentFlags & 0x00000002 )
-+            bDispEvent = true;
-+//        if (  nContentFlags & 0x00000004 ) ' not set should be 0
-+        if (  nContentFlags & 0x00000008 )
-+            bDefaultProg = true;
-+        if (  nContentFlags & 0x00000010 )
-+            *pS >> nClassTableFlags >> nVarFlags;
-+        if (  nContentFlags & 0x00000020 )
-+            *pS >> nCountOfMethods;
-+        if (  nContentFlags & 0x00000040 )
-+            *pS >> nDispidBind;
-+        if (  nContentFlags & 0x00000080 )
-+            *pS >> nGetBindIndex;
-+        if (  nContentFlags & 0x00000100 )
-+            *pS >> nPutBindIndex;
-+        if (  nContentFlags & 0x00000200 )
-+            *pS >> nBindType;
-+        if (  nContentFlags & 0x00000400 )
-+            *pS >> nGetValueIndex;
-+        if (  nContentFlags & 0x00000800 )
-+            *pS >> nPutValueIndex;
-+        if (  nContentFlags & 0x00001000 )
-+            *pS >> nValueType;
-+        if (  nContentFlags & 0x00002000 )
-         {
--            OSL_TRACE("Unknown activeX ID !");
-+            ReadAlign( pS, pS->Tell() - nStartPos, 4 );
-+            *pS >> nDisidRowset;
-         }
-+        if (  nContentFlags & 0x00004000 )
-+            *pS >> nSetRowset;
-+        ReadAlign( pS, pS->Tell() - nStartPos, 4 );
-+        // Extra Block
-+        if ( bClsID )
-+            pS->Read( pClsId, sizeof( pClsId ) );
-+        if ( bDispEvent )
-+            pS->Read( pDispEvent, sizeof( pDispEvent ) );
-+        if ( bDefaultProg )
-+            pS->Read( pDefaultProg, sizeof( pDefaultProg ) );
-+
-+        sal_Int32 nNumIds =  sizeof( ClsidList ) / sizeof( ClsidList[0] );
-+
-+        if ( bClsID )
-+        {
-+            for ( sal_Int32 index = 0; index < nNumIds; ++index )
-+            {
-+                if ( memcmp( pClsId, ClsidList[ index ].pClsID, nSizeOfClsid ) == 0 )
-+                {
-+                    nTypeId = ClsidList[ index ].nTypeID;
-+                    OSL_TRACE( "... found activex control ClsidList[ %d ] and have given it TypeIdent 0x%x", index, nTypeId );
-+                }
-+            }
-+        }
-+        ReadAlign( pS, pS->Tell() - nStartPos, 4 );
-+        return true;
-     }
--    return bRes;
--}
- 
--typedef std::vector< ContainerRecord > ContainerRecordList;
-+    sal_uInt16 getTypeId() { return nTypeId; }
-+};
++void AxMultiPageModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const
++{
++    rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_CONTAINER_ENABLED ) );
++    if( mxTabStrip.get() )
++        mxTabStrip->convertProperties( rPropMap, rConv );
++    AxContainerModelBase::convertProperties( rPropMap, rConv );
++}
++
++void AxMultiPageModel::setTabStripModel( const AxTabStripModelRef& rxTabStrip )
++{
++    mxTabStrip = rxTabStrip;
++}
++
++// ============================================================================
++
+ AxUserFormModel::AxUserFormModel()
+ {
+ }
+diff --git oox/source/ole/makefile.mk oox/source/ole/makefile.mk
+index 4e01392..e94ab3e 100644
+--- oox/source/ole/makefile.mk

... etc. - the rest is truncated


More information about the ooo-build-commit mailing list