ooo-build r14875 - trunk/patches/vba



Author: noelpwer
Date: Tue Dec 16 20:43:30 2008
New Revision: 14875
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14875&view=rev

Log:
latest ( non applied ) vba for word experimentation


Modified:
   trunk/patches/vba/vba-word-support.diff

Modified: trunk/patches/vba/vba-word-support.diff
==============================================================================
--- trunk/patches/vba/vba-word-support.diff	(original)
+++ trunk/patches/vba/vba-word-support.diff	Tue Dec 16 20:43:30 2008
@@ -43,6 +43,46 @@
 +..\inc\basic\helperdecl.hxx %_DEST%\inc%_EXT%\basic\helperdecl.hxx
 +..\inc\basic\vbahelperinterface.hxx %_DEST%\inc%_EXT%\basic\vbahelperinterface.hxx
  ..\inc\modsizeexceeded.hxx %_DEST%\inc%_EXT%\basic\modsizeexceeded.hxx
+diff --git basic/source/app/brkpnts.cxx basic/source/app/brkpnts.cxx
+index 79f702b..66cf563 100644
+--- basic/source/app/brkpnts.cxx
++++ basic/source/app/brkpnts.cxx
+@@ -111,7 +111,7 @@ void BreakpointWindow::SetBPsInModule()
+ 	{
+ 		pModule->SetBP( (USHORT)pBrk->nLine );
+ #if OSL_DEBUG_LEVEL > 1
+-		DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( (USHORT)pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" )
++		DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( (USHORT)pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" );
+ #endif
+ 		pBrk = Next();
+ 	}
+@@ -152,7 +152,7 @@ void BreakpointWindow::InsertBreakpoint( USHORT nLine )
+ 	if ( pModule->SetBP( nLine ) )
+ 	{
+ #if OSL_DEBUG_LEVEL > 1
+-		DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( nLine ), "Brechpunkt wurde nicht gesetzt" )
++		DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( nLine ), "Brechpunkt wurde nicht gesetzt" );
+ #endif
+ 		if ( StarBASIC::IsRunning() )
+ 		{
+@@ -165,7 +165,7 @@ void BreakpointWindow::InsertBreakpoint( USHORT nLine )
+ 		}
+ 	}
+ #if OSL_DEBUG_LEVEL > 1
+-	DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( nLine ), "Brechpunkt wurde nicht gesetzt" )
++	DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( nLine ), "Brechpunkt wurde nicht gesetzt" );
+ #endif
+ }
+ 
+@@ -282,7 +282,7 @@ void BreakpointWindow::Paint( const Rectangle& )
+ 	while ( pBrk )
+ 	{
+ #if OSL_DEBUG_LEVEL > 1
+-		DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" )
++		DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" );
+ #endif
+ 		ULONG nLine = pBrk->nLine-1;
+ 		ULONG nY = nLine*nLineHeight - nCurYOffset;
 diff --git basic/source/classes/sb.cxx basic/source/classes/sb.cxx
 index 349c2cc..b149e96 100644
 --- basic/source/classes/sb.cxx
@@ -621,19 +661,23 @@
  sc	sc\inc									nmake	-	all	sc_inc NULL
  sc	sc\prj									get		-	all	sc_prj NULL
 diff --git sc/source/filter/excel/excimp8.cxx sc/source/filter/excel/excimp8.cxx
-index 033cb76..f091a47 100644
+index 033cb76..b712eb9 100644
 --- sc/source/filter/excel/excimp8.cxx
 +++ sc/source/filter/excel/excimp8.cxx
-@@ -103,7 +103,7 @@
+@@ -103,8 +103,11 @@
  #include <com/sun/star/document/XDocumentProperties.hpp>
  #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
  #include <com/sun/star/script/ModuleInfo.hpp>
--
 +#include <basic/basmgr.hxx>
++#include <cppuhelper/component_context.hxx>
  
+-
++#include <com/sun/star/container/XNameContainer.hpp>
++ 
  using namespace com::sun::star;
  
-@@ -280,6 +280,15 @@ void ImportExcel8::ReadBasic( void )
+ 
+@@ -280,6 +283,32 @@ void ImportExcel8::ReadBasic( void )
          bool bLoadStrg = pFilterOpt->IsLoadExcelBasicStorage();
          if( bLoadCode || bLoadStrg )
          {
@@ -644,7 +688,24 @@
 +            xCtx.set( xProps->getPropertyValue( rtl::OUString(
 +                RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))),
 +                uno::UNO_QUERY_THROW );
-+            uno::Any aGlobs = uno::makeAny( xCtx->getValueByName( ::rtl::OUString::createFromAscii( "/singletons/ooo.vba.theGlobals") ) );
++            // Create context with 'excel' initially (null) application
++            ::cppu::ContextEntry_Init aHandlerContextInfo[] =
++            {
++                ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Application" ) ), uno::Any() ) 
++            };
++
++            // Create Application with new context
++
++            uno::Reference< uno::XComponentContext > xHandlerContext = ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), xCtx );
++
++            OSL_TRACE("***** Before creating application");
++
++            uno::Any aApplication( xCtx->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.excel.Application" ) ), xHandlerContext ) );
++            uno::Reference< container::XNameContainer > xNameContainer( xHandlerContext, uno::UNO_QUERY_THROW );
++            xNameContainer->replaceByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Application") ), aApplication );
++            OSL_TRACE("***** After creating application");
++
++            uno::Any aGlobs = uno::makeAny( xHandlerContext->getValueByName( ::rtl::OUString::createFromAscii( "/singletons/ooo.vba.theGlobals") ) );
 +            pShell->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
              SvxImportMSVBasic aBasicImport( *pShell, *xRootStrg, bLoadCode, bLoadStrg );
  			bool bAsComment = !bLoadExecutable || !lcl_hasVBAEnabled();
@@ -1135,7 +1196,7 @@
 +};
 +#endif
 diff --git sc/source/ui/vba/makefile.mk sc/source/ui/vba/makefile.mk
-index 4eaad61..4122073 100644
+index 4eaad61..a29a128 100644
 --- sc/source/ui/vba/makefile.mk
 +++ sc/source/ui/vba/makefile.mk
 @@ -63,7 +63,7 @@ SLOFILES= \
@@ -1147,8 +1208,124 @@
  		$(SLO)$/vbainterior.obj\
  		$(SLO)$/vbawsfunction.obj\
  		$(SLO)$/vbawindow.obj\
+@@ -80,20 +80,10 @@ SLOFILES= \
+ 		$(SLO)$/vbapalette.obj \
+ 		$(SLO)$/vbaborders.obj \
+ 		$(SLO)$/vbacharacters.obj \
+-		$(SLO)$/vbacombobox.obj \
+ 		$(SLO)$/vbavalidation.obj \
+-                $(SLO)$/vbacontrol.obj \
+-                $(SLO)$/vbacontrols.obj \
+                 $(SLO)$/vbaoleobject.obj \
+                 $(SLO)$/vbaoleobjects.obj \
+-                $(SLO)$/vbabutton.obj \
+-                $(SLO)$/vbalabel.obj \
+-                $(SLO)$/vbatextbox.obj \
+                 $(SLO)$/vbatextboxshape.obj \
+-                $(SLO)$/vbaradiobutton.obj \
+-                $(SLO)$/vbalistbox.obj \
+-		$(SLO)$/vbalistcontrolhelper.obj \
+-                $(SLO)$/vbapropvalue.obj \
+                 $(SLO)$/vbapane.obj \
+                 $(SLO)$/vbashape.obj \
+                 $(SLO)$/vbacolorformat.obj \
+@@ -115,14 +105,6 @@ SLOFILES= \
+                 $(SLO)$/vbastyle.obj \
+                 $(SLO)$/vbastyles.obj \
+                 $(SLO)$/vbaassistant.obj \
+-                $(SLO)$/vbauserform.obj \
+-                $(SLO)$/vbacheckbox.obj \
+-                $(SLO)$/vbatogglebutton.obj \
+-                $(SLO)$/vbaframe.obj \
+-                $(SLO)$/vbascrollbar.obj \
+-                $(SLO)$/vbaprogressbar.obj \
+-				$(SLO)$/vbamultipage.obj \
+-				$(SLO)$/vbapages.obj \
+                 $(SLO)$/vbacommandbarcontrol.obj \
+                 $(SLO)$/vbacommandbarcontrols.obj \
+                 $(SLO)$/vbacommandbar.obj \
+@@ -131,8 +113,6 @@ SLOFILES= \
+         		$(SLO)$/vbapagesetup.obj \
+ 		        $(SLO)$/vbapagebreak.obj \
+         		$(SLO)$/vbapagebreaks.obj \
+-		        $(SLO)$/vbaspinbutton.obj \
+-		        $(SLO)$/vbaimage.obj \
+ 				$(SLO)$/service.obj \
+         $(SLO)$/vbaeventshelper.obj \
+  
+diff --git sc/source/ui/vba/service.cxx sc/source/ui/vba/service.cxx
+index 03ea759..bf4d4c4 100644
+--- sc/source/ui/vba/service.cxx
++++ sc/source/ui/vba/service.cxx
+@@ -61,11 +61,11 @@ namespace globals
+ {
+ extern sdecl::ServiceDecl const serviceDecl;
+ }
+-namespace  userform
++namespace hyperlink 
+ {
+ extern sdecl::ServiceDecl const serviceDecl;
+ }
+-namespace hyperlink 
++namespace application 
+ {
+ extern sdecl::ServiceDecl const serviceDecl;
+ }
+@@ -90,7 +90,7 @@ extern "C"
+ 
+ 	// Component registration
+         if ( component_writeInfoHelper( pServiceManager, pRegistryKey, 
+-		range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl, hyperlink::serviceDecl ) && component_writeInfoHelper( pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl ) )
++		range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl ) && component_writeInfoHelper( pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl ) )
+ 		{
+ 			// Singleton registration
+ 			try
+@@ -118,7 +118,7 @@ extern "C"
+     {
+ 		OSL_TRACE("In component_getFactory for %s", pImplName );
+ 	void* pRet =  component_getFactoryHelper(
+-        	pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl, window::serviceDecl, hyperlink::serviceDecl );
++        	pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl );
+     if( !pRet )
+         pRet = component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl );
+ 	OSL_TRACE("Ret is 0x%x", pRet);
+diff --git sc/source/ui/vba/vbaapplication.cxx sc/source/ui/vba/vbaapplication.cxx
+index 332d6b1..163ad9f 100644
+--- sc/source/ui/vba/vbaapplication.cxx
++++ sc/source/ui/vba/vbaapplication.cxx
+@@ -87,6 +87,7 @@
+ #include "miscuno.hxx"
+ #include "unonames.hxx"
+ #include "docsh.hxx"
++#include <vbahelper/helperdecl.hxx>
+ 
+ using namespace ::ooo::vba;
+ using namespace ::com::sun::star;
+@@ -123,7 +124,7 @@ public:
+ 	ActiveWorkbook( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext) : ScVbaWorkbook(  xParent, xContext ){}
+ };
+ 
+-ScVbaApplication::ScVbaApplication( uno::Reference<uno::XComponentContext >& xContext ): ScVbaApplication_BASE( uno::Reference< XHelperInterface >(), xContext ), m_xCalculation( excel::XlCalculation::xlCalculationAutomatic )
++ScVbaApplication::ScVbaApplication( const uno::Reference<uno::XComponentContext >& xContext ): ScVbaApplication_BASE( uno::Reference< XHelperInterface >(), xContext ), m_xCalculation( excel::XlCalculation::xlCalculationAutomatic )
+ {
+ }
+ 
+@@ -1344,3 +1345,13 @@ ScVbaApplication::getServiceNames()
+ 	}
+ 	return aServiceNames;
+ }
++
++namespace application
++{
++namespace sdecl = comphelper::service_decl;
++sdecl::vba_service_class_<ScVbaApplication, sdecl::with_args<false> > serviceImpl;
++extern sdecl::ServiceDecl const serviceDecl(
++    serviceImpl,
++    "ScVbaApplication",
++    "ooo.vba.excel.Application" );
++}
 diff --git sc/source/ui/vba/vbaapplication.hxx sc/source/ui/vba/vbaapplication.hxx
-index 754885e..4749b24 100644
+index 754885e..dccb6b7 100644
 --- sc/source/ui/vba/vbaapplication.hxx
 +++ sc/source/ui/vba/vbaapplication.hxx
 @@ -35,7 +35,7 @@
@@ -1160,6 +1337,15 @@
  
  typedef InheritedHelperInterfaceImpl1< ov::excel::XApplication > ScVbaApplication_BASE;
  
+@@ -45,7 +45,7 @@ private:
+ 	sal_Int32 m_xCalculation;
+ 	rtl::OUString getOfficePath( const rtl::OUString& sPath ) throw ( css::uno::RuntimeException );
+ public:
+-	ScVbaApplication( css::uno::Reference< css::uno::XComponentContext >& m_xContext );
++	ScVbaApplication( const css::uno::Reference< css::uno::XComponentContext >& m_xContext );
+ 	virtual ~ScVbaApplication();
+ 
+ 	// XHelperInterface ( parent is itself )
 diff --git sc/source/ui/vba/vbaassistant.hxx sc/source/ui/vba/vbaassistant.hxx
 index d3c5ff4..060538d 100644
 --- sc/source/ui/vba/vbaassistant.hxx
@@ -1216,19 +1402,143 @@
  
  typedef CollTestImplHelper< ov::excel::XBorders > ScVbaBorders_BASE;
  class ScVbaPalette;
+diff --git sc/source/ui/vba/vbabutton.cxx sc/source/ui/vba/vbabutton.cxx
+deleted file mode 100644
+index 0e4d749..0000000
+--- sc/source/ui/vba/vbabutton.cxx
++++ /dev/null
+@@ -1,74 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbabutton.cxx,v $
+- * $Revision: 1.3 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#include "vbabutton.hxx"
+-#include <vector>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-
+-const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+-ScVbaButton::ScVbaButton( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+-{
+-}
+-
+-// Attributes
+-rtl::OUString SAL_CALL 
+-ScVbaButton::getCaption() throw (css::uno::RuntimeException)
+-{
+-    rtl::OUString Label;
+-    m_xProps->getPropertyValue( LABEL ) >>= Label;
+-    return Label;
+-}
+-
+-void SAL_CALL 
+-ScVbaButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+-}
+-
+-rtl::OUString& 
+-ScVbaButton::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaButton") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaButton::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Button" ) );
+-	}
+-	return aServiceNames;
+-}
 diff --git sc/source/ui/vba/vbabutton.hxx sc/source/ui/vba/vbabutton.hxx
-index 2a98ad6..818f245 100644
+deleted file mode 100644
+index 2a98ad6..0000000
 --- sc/source/ui/vba/vbabutton.hxx
-+++ sc/source/ui/vba/vbabutton.hxx
-@@ -33,7 +33,7 @@
- #include <ooo/vba/msforms/XButton.hpp>
- 
- #include "vbacontrol.hxx"
++++ /dev/null
+@@ -1,51 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbabutton.hxx,v $
+- * $Revision: 1.3 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_BUTTON_HXX
+-#define SC_VBA_BUTTON_HXX
+-#include <cppuhelper/implbase1.hxx>
+-#include <ooo/vba/msforms/XButton.hpp>
+-
+-#include "vbacontrol.hxx"
 -#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- 
- typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XButton > ButtonImpl_BASE;
- 
+-
+-typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XButton > ButtonImpl_BASE;
+-
+-class ScVbaButton : public ButtonImpl_BASE
+-{
+-public:
+-    ScVbaButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper  );
+-   // Attributes
+-    virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-};
+-#endif //SC_VBA_BUTTON_HXX
 diff --git sc/source/ui/vba/vbacharacters.hxx sc/source/ui/vba/vbacharacters.hxx
 index 1ea523f..f69b6d2 100644
 --- sc/source/ui/vba/vbacharacters.hxx
@@ -1298,19 +1608,188 @@
  #include <hash_map>
  
  typedef CollTestImplHelper< ov::excel::XCharts > Charts_BASE;
+diff --git sc/source/ui/vba/vbacheckbox.cxx sc/source/ui/vba/vbacheckbox.cxx
+deleted file mode 100644
+index 958e375..0000000
+--- sc/source/ui/vba/vbacheckbox.cxx
++++ /dev/null
+@@ -1,110 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#include "vbacheckbox.hxx"
+-#include <vector>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-
+-const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+-const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") );
+-ScVbaCheckbox::ScVbaCheckbox( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : CheckBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+-{
+-}
+-
+-// Attributes
+-rtl::OUString SAL_CALL 
+-ScVbaCheckbox::getCaption() throw (css::uno::RuntimeException)
+-{
+-    rtl::OUString Label;
+-    m_xProps->getPropertyValue( LABEL ) >>= Label;
+-    return Label;
+-}
+-
+-void SAL_CALL 
+-ScVbaCheckbox::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+-}
+-
+-uno::Any SAL_CALL 
+-ScVbaCheckbox::getValue() throw (css::uno::RuntimeException)
+-{
+-    sal_Int16 nValue = -1;
+-    m_xProps->getPropertyValue( STATE ) >>= nValue;
+-    if( nValue != 0 )
+-        nValue = -1;
+-//    return uno::makeAny( nValue ); 
+-// I must be missing something MSO says value should be -1 if selected, 0 if not
+-// selected
+-    return uno::makeAny( ( nValue == -1 ) ? sal_True : sal_False ); 
+-}
+-
+-void SAL_CALL 
+-ScVbaCheckbox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeException)
+-{
+-    sal_Int16 nValue = 0;
+-    sal_Bool bValue = false;
+-    if( _value >>= nValue )
+-    {
+-        if( nValue == -1)
+-            nValue = 1;
+-    }
+-    else if ( _value >>= bValue )
+-    {
+-        if ( bValue )
+-            nValue = 1;
+-    }
+-    m_xProps->setPropertyValue( STATE, uno::makeAny( nValue ) );
+-}
+-rtl::OUString& 
+-ScVbaCheckbox::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaCheckbox") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaCheckbox::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.CheckBox" ) );
+-	}
+-	return aServiceNames;
+-}
 diff --git sc/source/ui/vba/vbacheckbox.hxx sc/source/ui/vba/vbacheckbox.hxx
-index 58805c6..c3ddfb5 100644
+deleted file mode 100644
+index 58805c6..0000000
 --- sc/source/ui/vba/vbacheckbox.hxx
-+++ sc/source/ui/vba/vbacheckbox.hxx
-@@ -38,7 +38,7 @@
- #include <ooo/vba/msforms/XRadioButton.hpp>
- 
- #include "vbacontrol.hxx"
++++ /dev/null
+@@ -1,60 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_CHECKBOX_HXX
+-#define SC_VBA_CHECKBOX_HXX
+-#include <cppuhelper/implbase2.hxx>
+-#include <ooo/vba/msforms/XRadioButton.hpp>
+-
+-#include "vbacontrol.hxx"
 -#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- 
- typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XRadioButton, css::script::XDefaultProperty > CheckBoxImpl_BASE;
- 
+-
+-typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XRadioButton, css::script::XDefaultProperty > CheckBoxImpl_BASE;
+-
+-class ScVbaCheckbox : public CheckBoxImpl_BASE
+-{
+-public:
+-    ScVbaCheckbox(  const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+-   // Attributes
+-    virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+-    virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-    // XDefaultProperty
+-    rtl::OUString SAL_CALL getDefaultPropertyName(  ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-};
+-#endif //SC_VBA_CHECKBOX_HXX
 diff --git sc/source/ui/vba/vbacollectionimpl.cxx sc/source/ui/vba/vbacollectionimpl.cxx
 deleted file mode 100644
 index 5a9ae13..0000000
@@ -1731,58 +2210,312 @@
  #include "vbafillformat.hxx"
  
  typedef InheritedHelperInterfaceImpl1< ov::msforms::XColorFormat > ScVbaColorFormat_BASE;
-diff --git sc/source/ui/vba/vbacombobox.hxx sc/source/ui/vba/vbacombobox.hxx
-index 45996e2..d14a19f 100644
---- sc/source/ui/vba/vbacombobox.hxx
-+++ sc/source/ui/vba/vbacombobox.hxx
-@@ -40,7 +40,7 @@
- 
- #include "vbacontrol.hxx"
- #include "vbalistcontrolhelper.hxx"
--#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- 
- typedef cppu::ImplInheritanceHelper2<ScVbaControl, ov::msforms::XComboBox, css::script::XDefaultProperty > ComboBoxImpl_BASE;
- class ScVbaComboBox : public ComboBoxImpl_BASE
-diff --git sc/source/ui/vba/vbacommandbar.cxx sc/source/ui/vba/vbacommandbar.cxx
-index 24e5189..b5c283d 100644
---- sc/source/ui/vba/vbacommandbar.cxx
-+++ sc/source/ui/vba/vbacommandbar.cxx
-@@ -41,7 +41,7 @@
- 
- #include "vbacommandbar.hxx"
- #include "vbacommandbarcontrols.hxx"
--#include "vbahelper.hxx"
-+#include "excelvbahelper.hxx"
- 
- 
- using namespace com::sun::star;
-diff --git sc/source/ui/vba/vbacommandbar.hxx sc/source/ui/vba/vbacommandbar.hxx
-index bbeda7c..0b830b2 100644
---- sc/source/ui/vba/vbacommandbar.hxx
-+++ sc/source/ui/vba/vbacommandbar.hxx
-@@ -41,7 +41,7 @@
- #include <com/sun/star/container/XIndexContainer.hpp>
- #include <com/sun/star/beans/PropertyValues.hpp>
- 
--#include "vbahelperinterface.hxx"
-+#include <vbahelper/vbahelperinterface.hxx>
- #include "vbacommandbars.hxx"
- 
- #include <map>
-diff --git sc/source/ui/vba/vbacommandbarcontrol.hxx sc/source/ui/vba/vbacommandbarcontrol.hxx
-index 1c406a5..4d7d133 100644
---- sc/source/ui/vba/vbacommandbarcontrol.hxx
-+++ sc/source/ui/vba/vbacommandbarcontrol.hxx
-@@ -40,7 +40,7 @@
- #include <ooo/vba/XCommandBarButton.hpp>
- #include <ooo/vba/office/MsoControlType.hpp>
- 
--#include "vbahelperinterface.hxx"
-+#include <vbahelper/vbahelperinterface.hxx>
- #include "vbacommandbarcontrols.hxx"
- 
- typedef InheritedHelperInterfaceImpl1< ov::XCommandBarControl > CommandBarControl_BASE;
+diff --git sc/source/ui/vba/vbacombobox.cxx sc/source/ui/vba/vbacombobox.cxx
+deleted file mode 100644
+index 8f1e0fb..0000000
+--- sc/source/ui/vba/vbacombobox.cxx
++++ /dev/null
+@@ -1,175 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbacombobox.cxx,v $
+- * $Revision: 1.4 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#include "vbacombobox.hxx"
+-#include <vector>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-
+-//SelectedItems list of integer indexes
+-//StringItemList list of items
+-
+-const static rtl::OUString TEXT( RTL_CONSTASCII_USTRINGPARAM("Text") );
+-const static rtl::OUString SELECTEDITEMS( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") );
+-const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") );
+-const static rtl::OUString CONTROLSOURCEPROP( RTL_CONSTASCII_USTRINGPARAM("DataFieldProperty") );
+-
+-ScVbaComboBox::ScVbaComboBox( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper, bool bDialogType ) : ComboBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ), mbDialogType( bDialogType )
+-{
+-    	mpListHelper.reset( new ListControlHelper( m_xProps ) );
+-	// grab the default value property name
+-	m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
+-}
+-
+-// Attributes
+-
+-
+-// Value, [read] e.g. getValue returns the value of ooo Text propery e.g. the value in
+-// the drop down
+-uno::Any SAL_CALL 
+-ScVbaComboBox::getValue() throw (uno::RuntimeException)
+-{
+-	return m_xProps->getPropertyValue( sSourceName );
+-}
+-
+-void SAL_CALL 
+-ScVbaComboBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeException)
+-{
+-    uno::Sequence< sal_Int16 > sSelection(1);
+-    _value >>= sSelection[ 0 ];
+-    m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( sSelection ) );
+-}
+-
+-uno::Any SAL_CALL 
+-ScVbaComboBox::getListIndex() throw (uno::RuntimeException)
+-{
+-	uno::Sequence< rtl::OUString > sItems;
+-	m_xProps->getPropertyValue( ITEMS ) >>= sItems;
+-	// should really return the item that has focus regardless of
+-	// it been selected
+-	if ( sItems.getLength() > 0 )
+-	{
+-		rtl::OUString sText = getText();
+-		sal_Int32 nLen = sItems.getLength();
+-		for ( sal_Int32 index = 0; sText.getLength() && index < nLen; ++index )
+-		{
+-			if ( sItems[ index ].equals( sText ) )
+-			{
+-				OSL_TRACE("getListIndex returning %d", index );
+-				return uno::makeAny( index );
+-			}
+-				
+-		} 
+- 	} 
+-	OSL_TRACE("getListIndex returning %d", -1 );
+-	return uno::makeAny( sal_Int32( -1 ) );
+-}
+-
+-// Value, [write]e.g. setValue sets the value in the drop down, and if the value is one
+-// of the values in the list then the selection is also set
+-void SAL_CALL 
+-ScVbaComboBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
+-{
+-	m_xProps->setPropertyValue( sSourceName, _value );
+-}
+-
+-// see Value
+-
+-::rtl::OUString SAL_CALL 
+-ScVbaComboBox::getText() throw (uno::RuntimeException)
+-{
+-	rtl::OUString result;
+-	getValue() >>= result;
+-	return result;
+-}
+-
+-void SAL_CALL 
+-ScVbaComboBox::setText( const ::rtl::OUString& _text ) throw (uno::RuntimeException)
+-{
+-	setValue( uno::makeAny( _text ) ); // seems the same
+-}
+-
+-// Methods
+-void SAL_CALL 
+-ScVbaComboBox::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) throw (uno::RuntimeException)
+-{
+-	mpListHelper->AddItem( pvargItem, pvargIndex );
+-}
+-
+-void SAL_CALL 
+-ScVbaComboBox::removeItem( const uno::Any& index ) throw (uno::RuntimeException)
+-	{
+-	mpListHelper->removeItem( index );
+-}
+-
+-void SAL_CALL 
+-ScVbaComboBox::Clear(  ) throw (uno::RuntimeException)
+-		{
+-	mpListHelper->Clear();
+-		}
+-
+-void SAL_CALL
+-ScVbaComboBox::setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException)
+-{
+-	ScVbaControl::setRowSource( _rowsource );
+-	mpListHelper->setRowSource( _rowsource );
+-		}
+-
+-sal_Int32 SAL_CALL
+-ScVbaComboBox::getListCount() throw (uno::RuntimeException)
+-		{
+-	return mpListHelper->getListCount();
+-		}
+-		
+-uno::Any SAL_CALL 
+-ScVbaComboBox::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn ) throw (uno::RuntimeException)
+-		{
+-	return mpListHelper->List( pvargIndex, pvarColumn );
+-		}
+-
+-rtl::OUString& 
+-ScVbaComboBox::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaComboBox") );
+-	return sImplName;
+-	}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaComboBox::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ComboBox" ) );
+-}
+-	return aServiceNames;
+-}
+diff --git sc/source/ui/vba/vbacombobox.hxx sc/source/ui/vba/vbacombobox.hxx
+deleted file mode 100644
+index 45996e2..0000000
+--- sc/source/ui/vba/vbacombobox.hxx
++++ /dev/null
+@@ -1,80 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbacombobox.hxx,v $
+- * $Revision: 1.4 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_COMBOBOX_HXX
+-#define SC_VBA_COMBOBOX_HXX
+-#include <cppuhelper/implbase2.hxx>
+-#include <com/sun/star/uno/XComponentContext.hpp>
+-#include <com/sun/star/beans/XPropertySet.hpp>
+-#include <com/sun/star/script/XDefaultProperty.hpp>
+-#include <ooo/vba/msforms/XComboBox.hpp>
+-#include <comphelper/proparrhlp.hxx>
+-#include <comphelper/propertycontainer.hxx>
+-#include <com/sun/star/beans/PropertyAttribute.hpp>
+-
+-#include "vbacontrol.hxx"
+-#include "vbalistcontrolhelper.hxx"
+-#include "vbahelper.hxx"
+-
+-typedef cppu::ImplInheritanceHelper2<ScVbaControl, ov::msforms::XComboBox, css::script::XDefaultProperty > ComboBoxImpl_BASE;
+-class ScVbaComboBox : public ComboBoxImpl_BASE
+-{		
+-	std::auto_ptr< ListControlHelper > mpListHelper;
+-	rtl::OUString sSourceName; 
+-	rtl::OUString msDftPropName;
+-	bool mbDialogType;
+-
+-public:
+-	ScVbaComboBox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper, bool bDialogType = false );
+-
+-	// Attributes
+-	virtual css::uno::Any SAL_CALL getListIndex() throw (css::uno::RuntimeException);
+-	virtual ::sal_Int32 SAL_CALL getListCount() throw (css::uno::RuntimeException);
+-	virtual void SAL_CALL setListIndex( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-	virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+-	virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-	virtual ::rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
+-	virtual void SAL_CALL setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException);
+-
+-	// Methods
+-	virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException);
+-	virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+-	virtual void SAL_CALL Clear(  ) throw (css::uno::RuntimeException);
+-	virtual css::uno::Any SAL_CALL List( const css::uno::Any& pvargIndex, const css::uno::Any& pvarColumn ) throw (css::uno::RuntimeException);
+-	// XControl
+-    virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
+-
+-	// XDefaultProperty
+-        ::rtl::OUString SAL_CALL getDefaultPropertyName(  ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+-	//XHelperInterface
+-	virtual rtl::OUString& getServiceImplName();
+-	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-};
+-
+-#endif //
+diff --git sc/source/ui/vba/vbacommandbar.cxx sc/source/ui/vba/vbacommandbar.cxx
+index 24e5189..b5c283d 100644
+--- sc/source/ui/vba/vbacommandbar.cxx
++++ sc/source/ui/vba/vbacommandbar.cxx
+@@ -41,7 +41,7 @@
+ 
+ #include "vbacommandbar.hxx"
+ #include "vbacommandbarcontrols.hxx"
+-#include "vbahelper.hxx"
++#include "excelvbahelper.hxx"
+ 
+ 
+ using namespace com::sun::star;
+diff --git sc/source/ui/vba/vbacommandbar.hxx sc/source/ui/vba/vbacommandbar.hxx
+index bbeda7c..0b830b2 100644
+--- sc/source/ui/vba/vbacommandbar.hxx
++++ sc/source/ui/vba/vbacommandbar.hxx
+@@ -41,7 +41,7 @@
+ #include <com/sun/star/container/XIndexContainer.hpp>
+ #include <com/sun/star/beans/PropertyValues.hpp>
+ 
+-#include "vbahelperinterface.hxx"
++#include <vbahelper/vbahelperinterface.hxx>
+ #include "vbacommandbars.hxx"
+ 
+ #include <map>
+diff --git sc/source/ui/vba/vbacommandbarcontrol.hxx sc/source/ui/vba/vbacommandbarcontrol.hxx
+index 1c406a5..4d7d133 100644
+--- sc/source/ui/vba/vbacommandbarcontrol.hxx
++++ sc/source/ui/vba/vbacommandbarcontrol.hxx
+@@ -40,7 +40,7 @@
+ #include <ooo/vba/XCommandBarButton.hpp>
+ #include <ooo/vba/office/MsoControlType.hpp>
+ 
+-#include "vbahelperinterface.hxx"
++#include <vbahelper/vbahelperinterface.hxx>
+ #include "vbacommandbarcontrols.hxx"
+ 
+ typedef InheritedHelperInterfaceImpl1< ov::XCommandBarControl > CommandBarControl_BASE;
 diff --git sc/source/ui/vba/vbacommandbarcontrols.hxx sc/source/ui/vba/vbacommandbarcontrols.hxx
 index 8e7d1e1..ff00609 100644
 --- sc/source/ui/vba/vbacommandbarcontrols.hxx
@@ -1867,236 +2600,12 @@
  #include <com/sun/star/sheet/ConditionOperator.hpp>
  
  template< typename Ifc1 >
-diff --git sc/source/ui/vba/vbacontrol.hxx sc/source/ui/vba/vbacontrol.hxx
-index 21c5de2..e7593e8 100644
---- sc/source/ui/vba/vbacontrol.hxx
-+++ sc/source/ui/vba/vbacontrol.hxx
-@@ -39,8 +39,9 @@
- #include <com/sun/star/awt/XWindowPeer.hpp>
- #include <ooo/vba/msforms/XControl.hpp>
- 
--#include "vbahelper.hxx"
--#include "vbahelperinterface.hxx"
-+#include <vbahelper/vbahelper.hxx>
-+#include <vbahelper/vbahelperinterface.hxx>
-+#include <memory>
- 
- //typedef ::cppu::WeakImplHelper1< ov::msforms::XControl > ControlImpl_BASE;
- typedef InheritedHelperInterfaceImpl1< ov::msforms::XControl > ControlImpl_BASE;
-diff --git sc/source/ui/vba/vbacontrols.hxx sc/source/ui/vba/vbacontrols.hxx
-index 31ab049..461c360 100644
---- sc/source/ui/vba/vbacontrols.hxx
-+++ sc/source/ui/vba/vbacontrols.hxx
-@@ -34,8 +34,8 @@
- #include <ooo/vba/msforms/XControls.hpp>
- #include <com/sun/star/awt/XControl.hpp>
- 
--#include "vbacollectionimpl.hxx"
--#include "vbahelper.hxx"
-+#include <vbahelper/vbacollectionimpl.hxx>
-+#include <vbahelper/vbahelper.hxx>
- 
- typedef CollTestImplHelper< ov::msforms::XControls > ControlsImpl_BASE;
- 
-diff --git sc/source/ui/vba/vbadialog.cxx sc/source/ui/vba/vbadialog.cxx
-index 6037390..7383f5d 100644
---- sc/source/ui/vba/vbadialog.cxx
-+++ sc/source/ui/vba/vbadialog.cxx
-@@ -35,7 +35,7 @@
- 
- #include <tools/string.hxx>
- 
--#include "vbahelper.hxx"
-+#include "excelvbahelper.hxx"
- #include "vbadialog.hxx"
- #include "vbaglobals.hxx"
- 
-diff --git sc/source/ui/vba/vbadialog.hxx sc/source/ui/vba/vbadialog.hxx
-index 94d8114..162e19c 100644
---- sc/source/ui/vba/vbadialog.hxx
-+++ sc/source/ui/vba/vbadialog.hxx
-@@ -37,7 +37,7 @@
- #include <ooo/vba/excel/XApplication.hpp>
- #include <ooo/vba/excel/XDialog.hpp>
-  
--#include "vbahelperinterface.hxx"
-+#include <vbahelper/vbahelperinterface.hxx>
- #include "vbadialog.hxx"
- 
- typedef InheritedHelperInterfaceImpl1< ov::excel::XDialog > ScVbaDialog_BASE;
-diff --git sc/source/ui/vba/vbadialogs.cxx sc/source/ui/vba/vbadialogs.cxx
-index e25cf7c..c798be9 100644
---- sc/source/ui/vba/vbadialogs.cxx
-+++ sc/source/ui/vba/vbadialogs.cxx
-@@ -36,7 +36,7 @@
- 
- #include <tools/string.hxx>
- 
--#include "vbahelper.hxx"
-+#include "excelvbahelper.hxx"
- #include "vbadialogs.hxx"
- #include "vbaglobals.hxx"
- #include "vbadialog.hxx"
-diff --git sc/source/ui/vba/vbadialogs.hxx sc/source/ui/vba/vbadialogs.hxx
-index fe9a32c..a0b2b24 100644
---- sc/source/ui/vba/vbadialogs.hxx
-+++ sc/source/ui/vba/vbadialogs.hxx
-@@ -35,7 +35,7 @@
- #include <com/sun/star/uno/XComponentContext.hpp>
- #include <ooo/vba/excel/XDialogs.hpp>
- #include <ooo/vba/XCollection.hpp>
--#include "vbahelperinterface.hxx" 
-+#include <vbahelper/vbahelperinterface.hxx>
- 
- class ScModelObj;
- 
-diff --git sc/source/ui/vba/vbaeventshelper.cxx sc/source/ui/vba/vbaeventshelper.cxx
-index c83406f..52ba287 100644
---- sc/source/ui/vba/vbaeventshelper.cxx
-+++ sc/source/ui/vba/vbaeventshelper.cxx
-@@ -33,7 +33,7 @@
-  *
-  ************************************************************************/
- #include "vbaeventshelper.hxx"
--#include "helperdecl.hxx"
-+#include <vbahelper/helperdecl.hxx>
- #include <sfx2/objsh.hxx> 
- #include <basic/basmgr.hxx>
- #include <basic/sbmod.hxx>
-diff --git sc/source/ui/vba/vbaeventshelper.hxx sc/source/ui/vba/vbaeventshelper.hxx
-index df56886..fd0dc12 100644
---- sc/source/ui/vba/vbaeventshelper.hxx
-+++ sc/source/ui/vba/vbaeventshelper.hxx
-@@ -40,7 +40,7 @@
- #include <cppuhelper/implbase1.hxx>
- #include <com/sun/star/document/VbaEventId.hpp>
- #include <com/sun/star/document/XVbaEventsHelper.hpp>
--#include "vbahelper.hxx"
-+#include "excelvbahelper.hxx"
- 
- #define INVALID_TAB -1
- 
-diff --git sc/source/ui/vba/vbafillformat.hxx sc/source/ui/vba/vbafillformat.hxx
-index 88fcfc0..047af92 100644
---- sc/source/ui/vba/vbafillformat.hxx
-+++ sc/source/ui/vba/vbafillformat.hxx
-@@ -33,7 +33,7 @@
- #include <com/sun/star/drawing/XShape.hpp>
- #include <com/sun/star/drawing/FillStyle.hpp>
- #include <ooo/vba/msforms/XFillFormat.hpp>
--#include "vbahelperinterface.hxx"
-+#include <vbahelper/vbahelperinterface.hxx>
- 
- typedef InheritedHelperInterfaceImpl1< ov::msforms::XFillFormat > ScVbaFillFormat_BASE;
- 
-diff --git sc/source/ui/vba/vbafont.hxx sc/source/ui/vba/vbafont.hxx
-index f73d729..efca63c 100644
---- sc/source/ui/vba/vbafont.hxx
-+++ sc/source/ui/vba/vbafont.hxx
-@@ -34,7 +34,7 @@
- 
- #include <ooo/vba/excel/XFont.hpp>
- #include <com/sun/star/beans/XPropertySet.hpp>
--#include "vbahelperinterface.hxx"
-+#include <vbahelper/vbahelperinterface.hxx>
- #include "vbapalette.hxx"
- 
- class ScTableSheetsObj;
-diff --git sc/source/ui/vba/vbaformat.cxx sc/source/ui/vba/vbaformat.cxx
-index 16cbf3a..9a13b94 100644
---- sc/source/ui/vba/vbaformat.cxx
-+++ sc/source/ui/vba/vbaformat.cxx
-@@ -33,6 +33,7 @@
- #include <ooo/vba/excel/XlHAlign.hpp>
- #include <ooo/vba/excel/XlOrientation.hpp>
- #include <ooo/vba/excel/Constants.hpp>
-+#include <ooo/vba/excel/XRange.hpp>
- #include <com/sun/star/table/CellVertJustify.hpp>
- #include <com/sun/star/table/CellHoriJustify.hpp>
- #include <com/sun/star/table/CellOrientation.hpp>
-diff --git sc/source/ui/vba/vbaformat.hxx sc/source/ui/vba/vbaformat.hxx
-index a88687d..7c01ea4 100644
---- sc/source/ui/vba/vbaformat.hxx
-+++ sc/source/ui/vba/vbaformat.hxx
-@@ -39,7 +39,7 @@
- #include <com/sun/star/lang/XMultiServiceFactory.hpp>
- #include <com/sun/star/lang/Locale.hpp>
- #include <com/sun/star/beans/XPropertyState.hpp>
--#include "vbahelperinterface.hxx"
-+#include <vbahelper/vbahelperinterface.hxx>
- 
- template< typename Ifc1 >
- class ScVbaFormat : public InheritedHelperInterfaceImpl1< Ifc1 >
-diff --git sc/source/ui/vba/vbaformatconditions.cxx sc/source/ui/vba/vbaformatconditions.cxx
-index 26d8b67..827503e 100644
---- sc/source/ui/vba/vbaformatconditions.cxx
-+++ sc/source/ui/vba/vbaformatconditions.cxx
-@@ -36,6 +36,7 @@
- #include "vbaformatcondition.hxx"
- #include "vbaworkbook.hxx"
- #include "vbastyles.hxx"
-+#include "vbaglobals.hxx"
- using namespace ::ooo::vba;
- using namespace ::com::sun::star;
- 
-diff --git sc/source/ui/vba/vbaformatconditions.hxx sc/source/ui/vba/vbaformatconditions.hxx
-index efdfce5..cac54da 100644
---- sc/source/ui/vba/vbaformatconditions.hxx
-+++ sc/source/ui/vba/vbaformatconditions.hxx
-@@ -35,7 +35,7 @@
- #include <com/sun/star/beans/XPropertySet.hpp>
- #include <com/sun/star/table/CellAddress.hpp>
- #include <com/sun/star/sheet/XSheetConditionalEntries.hpp>
--#include "vbacollectionimpl.hxx"
-+#include <vbahelper/vbacollectionimpl.hxx>
- 
- typedef CollTestImplHelper< ov::excel::XFormatConditions > ScVbaFormatConditions_BASE;
- class ScVbaFormatConditions: public ScVbaFormatConditions_BASE
-diff --git sc/source/ui/vba/vbaframe.hxx sc/source/ui/vba/vbaframe.hxx
-index 6020457..071b5b0 100644
---- sc/source/ui/vba/vbaframe.hxx
-+++ sc/source/ui/vba/vbaframe.hxx
-@@ -38,7 +38,7 @@
- #include <ooo/vba/msforms/XLabel.hpp>
- 
- #include "vbacontrol.hxx"
--#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- 
- typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XLabel > FrameImpl_BASE;
- 
-diff --git sc/source/ui/vba/vbaglobals.cxx sc/source/ui/vba/vbaglobals.cxx
-index bfc291f..7c829bf 100644
---- sc/source/ui/vba/vbaglobals.cxx
-+++ sc/source/ui/vba/vbaglobals.cxx
-@@ -27,7 +27,7 @@
-  * for a copy of the LGPLv3 License.
-  *
-  ************************************************************************/
--#include "helperdecl.hxx"
-+#include <vbahelper/helperdecl.hxx>
- #include "vbaglobals.hxx"
- 
- #include <comphelper/unwrapargs.hxx>
-diff --git sc/source/ui/vba/vbaglobals.hxx sc/source/ui/vba/vbaglobals.hxx
-index 0e9e3a5..ee33026 100644
---- sc/source/ui/vba/vbaglobals.hxx
-+++ sc/source/ui/vba/vbaglobals.hxx
-@@ -36,7 +36,7 @@
- #include <ooo/vba/XGlobals.hpp>
- 
- #include <cppuhelper/implbase1.hxx>
--#include "vbahelper.hxx"
-+#include "excelvbahelper.hxx"
- 
-     // =============================================================================
-     // class ScVbaGlobals
-diff --git sc/source/ui/vba/vbahelper.cxx sc/source/ui/vba/vbahelper.cxx
+diff --git sc/source/ui/vba/vbacontrol.cxx sc/source/ui/vba/vbacontrol.cxx
 deleted file mode 100644
-index 5e5f6e6..0000000
---- sc/source/ui/vba/vbahelper.cxx
+index a84703c..0000000
+--- sc/source/ui/vba/vbacontrol.cxx
 +++ /dev/null
-@@ -1,818 +0,0 @@
+@@ -1,467 +0,0 @@
 -/*************************************************************************
 - *
 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2105,8 +2614,8 @@
 - *
 - * OpenOffice.org - a multi-platform office productivity suite
 - *
-- * $RCSfile: vbahelper.cxx,v $
-- * $Revision: 1.5.32.1 $
+- * $RCSfile: vbacontrol.cxx,v $
+- * $Revision: 1.3 $
 - *
 - * This file is part of OpenOffice.org.
 - *
@@ -2126,801 +2635,2762 @@
 - * for a copy of the LGPLv3 License.
 - *
 - ************************************************************************/
--#include <cppuhelper/bootstrap.hxx>
--#include <com/sun/star/util/XURLTransformer.hpp>
--#include <com/sun/star/frame/XDispatchProvider.hpp>
+-#include <com/sun/star/form/FormComponentType.hpp>
+-#include <com/sun/star/awt/XControlModel.hpp>
+-#include <com/sun/star/awt/XControl.hpp>
+-#include <com/sun/star/awt/XWindow2.hpp>
+-#include <com/sun/star/lang/XEventListener.hpp>
+-#include <com/sun/star/drawing/XShape.hpp>
 -#include <com/sun/star/frame/XModel.hpp>
--#include <com/sun/star/frame/XFrame.hpp>
--#include <com/sun/star/frame/XDesktop.hpp>
--#include <com/sun/star/frame/XController.hpp>
--#include <com/sun/star/uno/XComponentContext.hpp>
--#include <com/sun/star/lang/XMultiComponentFactory.hpp>
--#include <com/sun/star/beans/XPropertySet.hpp>
--#include <com/sun/star/beans/XIntrospection.hpp>
+-#include <com/sun/star/view/XControlAccess.hpp>
+-#include <com/sun/star/container/XChild.hpp>
+-#include <com/sun/star/form/binding/XBindableValue.hpp>
+-#include <com/sun/star/form/binding/XListEntrySink.hpp>
+-#include <com/sun/star/table/CellAddress.hpp>
+-#include <com/sun/star/table/CellRangeAddress.hpp>
+-#ifdef VBA_OOBUILD_HACK
+-#include <svtools/bindablecontrolhelper.hxx>
+-#endif
+-#include"vbacontrol.hxx"
+-#include"vbacombobox.hxx"
+-#include "vbabutton.hxx"
+-#include "vbalabel.hxx"
+-#include "vbatextbox.hxx"
+-#include "vbaradiobutton.hxx"
+-#include "vbalistbox.hxx"
+-#include "vbatogglebutton.hxx"
+-#include "vbacheckbox.hxx"
+-#include "vbaframe.hxx"
+-#include "vbascrollbar.hxx"
+-#include "vbaprogressbar.hxx"
+-#include "vbamultipage.hxx"
+-#include "vbaspinbutton.hxx"
+-#include "vbaimage.hxx"
+-
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-uno::Reference< css::awt::XWindowPeer > 
+-ScVbaControl::getWindowPeer() throw (uno::RuntimeException)
+-{
+-    uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY );
+-
+-    uno::Reference< awt::XControlModel > xControlModel;
+-    uno::Reference< css::awt::XWindowPeer >  xWinPeer;
+-    if ( !xControlShape.is() ) 
+-    { 
+-        // would seem to be a Userform control
+-        uno::Reference< awt::XControl > xControl( m_xControl, uno::UNO_QUERY_THROW );
+-        xWinPeer =  xControl->getPeer();
+-	return xWinPeer;
+-    }
+-    // form control
+-    xControlModel.set( xControlShape->getControl(), uno::UNO_QUERY_THROW );
 -
--#include <comphelper/processfactory.hxx>
+-    uno::Reference< view::XControlAccess > xControlAccess( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+-    try
+-    {
+-        uno::Reference< awt::XControl > xControl( xControlAccess->getControl( xControlModel ), uno::UNO_QUERY );
+-        xWinPeer =  xControl->getPeer();
+-    }
+-    catch( uno::Exception )
+-    {
+-        throw uno::RuntimeException( rtl::OUString::createFromAscii( "The Control does not exsit" ),
+-                uno::Reference< uno::XInterface >() );
+-    }
+-    return xWinPeer;
+-}
 -
--#include <sfx2/objsh.hxx>
--#include <sfx2/viewfrm.hxx>
--#include <sfx2/dispatch.hxx>
--#include <sfx2/app.hxx>
--#include <svtools/stritem.hxx>
+-//ScVbaControlListener
+-class ScVbaControlListener: public cppu::WeakImplHelper1< lang::XEventListener >
+-{
+-private:
+-    ScVbaControl *pControl;
+-public:
+-    ScVbaControlListener( ScVbaControl *pTmpControl );
+-    virtual ~ScVbaControlListener();
+-    virtual void SAL_CALL disposing( const lang::EventObject& rEventObject ) throw( uno::RuntimeException );
+-};
 -
--#include <docuno.hxx>
+-ScVbaControlListener::ScVbaControlListener( ScVbaControl *pTmpControl ): pControl( pTmpControl )
+-{
+-}
 -
--#include <basic/sbx.hxx>
--#include <basic/sbstar.hxx>
--#include <rtl/math.hxx>
+-ScVbaControlListener::~ScVbaControlListener()
+-{
+-}
 -
--#include <math.h>
--#include "vbahelper.hxx"
--#include "tabvwsh.hxx"
--#include "transobj.hxx"
--#include "scmod.hxx"
--#include "vbashape.hxx"
--#include "unonames.hxx"
--using namespace ::com::sun::star;
--using namespace ::ooo::vba;
+-void SAL_CALL
+-ScVbaControlListener::disposing( const lang::EventObject& ) throw( uno::RuntimeException )
+-{
+-    if( pControl )
+-    {
+-        pControl->removeResouce();
+-        pControl = NULL;
+-    }
+-}
 -
--#define POINTTO100THMILLIMETERFACTOR 35.27778
--void unoToSbxValue( SbxVariable* pVar, const uno::Any& aValue );
+-//ScVbaControl
 -
--uno::Any sbxToUnoValue( SbxVariable* pVar );
+-ScVbaControl::ScVbaControl( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ::uno::XInterface >& xControl,  const css::uno::Reference< css::frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ControlImpl_BASE( xParent, xContext ),  m_xControl( xControl ), m_xModel( xModel )
+-{
+-    //add listener
+-    m_xEventListener.set( new ScVbaControlListener( this ) );
+-    setGeometryHelper( pGeomHelper );
+-    uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
+-    xComponent->addEventListener( m_xEventListener );
+-   
+-    //init m_xProps
+-    uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY ) ;
+-    uno::Reference< awt::XControl> xUserFormControl( m_xControl, uno::UNO_QUERY ) ;
+-    if ( xControlShape.is() ) // form control
+-        m_xProps.set( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+-    else if ( xUserFormControl.is() ) // userform control
+-        m_xProps.set( xUserFormControl->getModel(), uno::UNO_QUERY_THROW );
+-}
 -
+-ScVbaControl::~ScVbaControl()
+-{
+-    if( m_xControl.is() )
+-    {
+-        uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
+-        xComponent->removeEventListener( m_xEventListener );
+-    }
+-}
 -
--namespace ooo
+-void 
+-ScVbaControl::setGeometryHelper( AbstractGeometryAttributes* pHelper )
 -{
--namespace vba
+-    mpGeometryHelper.reset( pHelper );
+-}
+-
+-void ScVbaControl::removeResouce() throw( uno::RuntimeException )
 -{
+-    uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
+-    xComponent->removeEventListener( m_xEventListener );
+-    m_xControl= NULL;
+-    m_xProps = NULL;
+-}
 -
--const double Millimeter::factor =  35.27778;
+-//In design model has different behavior
+-sal_Bool SAL_CALL ScVbaControl::getEnabled() throw (uno::RuntimeException)
+-{
+-    uno::Any aValue = m_xProps->getPropertyValue
+-            (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) ) );
+-    sal_Bool bRet = false;
+-    aValue >>= bRet;
+-    return bRet;
+-}
 -
--uno::Reference< beans::XIntrospectionAccess >
--getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
+-void SAL_CALL ScVbaControl::setEnabled( sal_Bool bVisible ) throw (uno::RuntimeException)
 -{
--	static uno::Reference< beans::XIntrospection > xIntrospection;
--	if( !xIntrospection.is() )
--	{
--		uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
--		xIntrospection.set( xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.beans.Introspection") ), uno::UNO_QUERY_THROW );
--	}
--	return xIntrospection->inspect( aObject );
+-    uno::Any aValue( bVisible );
+-    m_xProps->setPropertyValue
+-            (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) ), aValue);
+-
 -}
 -
--uno::Reference< script::XTypeConverter >
--getTypeConverter( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
+-sal_Bool SAL_CALL ScVbaControl::getVisible() throw (uno::RuntimeException)
 -{
--	static uno::Reference< script::XTypeConverter > xTypeConv( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter") ), xContext ), uno::UNO_QUERY_THROW );
--	return xTypeConv;
+-    uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW );
+-    return xWindow2->isVisible();
 -}
--// helper method to determine if the view ( calc ) is in print-preview mode
--bool isInPrintPreview( SfxViewFrame* pView )
+-
+-void SAL_CALL ScVbaControl::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
 -{
--	sal_uInt16 nViewNo = SID_VIEWSHELL1 - SID_VIEWSHELL0;
--	if ( pView->GetObjectShell()->GetFactory().GetViewFactoryCount() >
--nViewNo && !pView->GetObjectShell()->IsInPlaceActive() )
--	{
--		SfxViewFactory &rViewFactory =
--			pView->GetObjectShell()->GetFactory().GetViewFactory(nViewNo);
--		if (  pView->GetCurViewId() == rViewFactory.GetOrdinal() )
--			return true;
--	}
--	return false;
+-    uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW );
+-    xWindow2->setVisible( bVisible );
 -}
--const ::rtl::OUString REPLACE_CELLS_WARNING(  RTL_CONSTASCII_USTRINGPARAM( "ReplaceCellsWarning"));
--const uno::Any&
--aNULL()
+-double SAL_CALL ScVbaControl::getHeight() throw (uno::RuntimeException)
 -{
-- 	static  uno::Any aNULLL = uno::makeAny( uno::Reference< uno::XInterface >() );
--	return aNULLL;
+-    return mpGeometryHelper->getHeight();
+-}
+-void SAL_CALL ScVbaControl::setHeight( double _height ) throw (uno::RuntimeException)
+-{
+-    mpGeometryHelper->setHeight( _height );
 -}
 -
--class PasteCellsWarningReseter
+-double SAL_CALL ScVbaControl::getWidth() throw (uno::RuntimeException)
 -{
--private:
--	bool bInitialWarningState;
--	static uno::Reference< beans::XPropertySet > getGlobalSheetSettings() throw ( uno::RuntimeException )
--	{
--		static uno::Reference< beans::XPropertySet > xTmpProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
--		static uno::Reference<uno::XComponentContext > xContext( xTmpProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
--		static uno::Reference<lang::XMultiComponentFactory > xServiceManager(
--				xContext->getServiceManager(), uno::UNO_QUERY_THROW );
--		static uno::Reference< beans::XPropertySet > xProps( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.GlobalSheetSettings" ) ) ,xContext ), uno::UNO_QUERY_THROW );
--		return xProps;
--	}
+-    return mpGeometryHelper->getWidth();
+-}
+-void SAL_CALL ScVbaControl::setWidth( double _width ) throw (uno::RuntimeException)
+-{
+-    mpGeometryHelper->setWidth( _width );
+-}
 -
--	bool getReplaceCellsWarning() throw ( uno::RuntimeException )
--	{
--		sal_Bool res = sal_False;
--		getGlobalSheetSettings()->getPropertyValue( REPLACE_CELLS_WARNING ) >>= res;
--		return ( res == sal_True );
--	}
+-double SAL_CALL
+-ScVbaControl::getLeft() throw (uno::RuntimeException)
+-{
+-    return mpGeometryHelper->getLeft();
+-}
 -
--	void setReplaceCellsWarning( bool bState ) throw ( uno::RuntimeException )
--	{
--		getGlobalSheetSettings()->setPropertyValue( REPLACE_CELLS_WARNING, uno::makeAny( bState ) );
--	}
--public:
--	PasteCellsWarningReseter() throw ( uno::RuntimeException )
--	{
--		bInitialWarningState = getReplaceCellsWarning();
--		if ( bInitialWarningState )
--			setReplaceCellsWarning( false );
--	}
--	~PasteCellsWarningReseter()
--	{
--		if ( bInitialWarningState )
--		{
--			// don't allow dtor to throw
--			try
--			{
--				setReplaceCellsWarning( true );
--			}
--			catch ( uno::Exception& /*e*/ ){}
--		}
--	}
--};
--
--void
--dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl, uno::Sequence< beans::PropertyValue >& sProps )
+-void SAL_CALL
+-ScVbaControl::setLeft( double _left ) throw (uno::RuntimeException)
 -{
+-    mpGeometryHelper->setLeft( _left );
 -
--	util::URL  url ;
--	url.Complete = aUrl;
--	rtl::OUString emptyString = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" ));
--	uno::Reference<frame::XController> xController = xModel->getCurrentController();
--	uno::Reference<frame::XFrame> xFrame = xController->getFrame();
--	uno::Reference<frame::XDispatchProvider> xDispatchProvider (xFrame,uno::UNO_QUERY_THROW);
--	try
--	{
--		uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
--		uno::Reference<uno::XComponentContext > xContext( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW  );
--		if ( !xContext.is() )
--		{
--			return ;
--		}
--
--		uno::Reference<lang::XMultiComponentFactory > xServiceManager(
--				xContext->getServiceManager() );
--		if ( !xServiceManager.is() )
--		{
--			return ;
--		}
--		uno::Reference<util::XURLTransformer> xParser( xServiceManager->createInstanceWithContext(     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) )
--			,xContext), uno::UNO_QUERY_THROW );
--		if (!xParser.is())
--			return;
--		xParser->parseStrict (url);
--	}
--	catch ( uno::Exception & /*e*/ )
--	{
--		return ;
--	}
--
--	uno::Reference<frame::XDispatch> xDispatcher = xDispatchProvider->queryDispatch(url,emptyString,0);
--
--	uno::Sequence<beans::PropertyValue> dispatchProps(1);
--
--	sal_Int32 nProps = sProps.getLength();
--	beans::PropertyValue* pDest = dispatchProps.getArray();
--	if ( nProps )
--	{
--		dispatchProps.realloc( nProps + 1 );
--		// need to reaccquire pDest after realloc
--		pDest = dispatchProps.getArray();
--		beans::PropertyValue* pSrc = sProps.getArray();
--		for ( sal_Int32 index=0; index<nProps; ++index, ++pSrc, ++pDest )
--			*pDest = *pSrc;
--	}
--
--	(*pDest).Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Silent" ));
--	(*pDest).Value <<= (sal_Bool)sal_True;
--
--	if (xDispatcher.is())
--		xDispatcher->dispatch( url, dispatchProps );
 -}
 -
--void
--dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl) 
+-double SAL_CALL
+-ScVbaControl::getTop() throw (uno::RuntimeException)
 -{
--	uno::Sequence<beans::PropertyValue> dispatchProps;
--	dispatchRequests( xModel, aUrl, dispatchProps );
+-    return mpGeometryHelper->getTop();
 -}
 -
--
--void dispatchExecute(css::uno::Reference< css::frame::XModel>& xModel, USHORT nSlot, SfxCallMode nCall)
--{
--	ScTabViewShell* pViewShell = getBestViewShell( xModel );
--	SfxViewFrame* pViewFrame = NULL;
--	if ( pViewShell )
--		pViewFrame = pViewShell->GetViewFrame();
--	if ( pViewFrame )
--	{
--		SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
--		if( pDispatcher )
--		{
--			pDispatcher->Execute( nSlot , nCall );
--		}
--	}	
--}
--		
--void
--implnPaste()
+-void SAL_CALL
+-ScVbaControl::setTop( double _top ) throw (uno::RuntimeException)
 -{
--	PasteCellsWarningReseter resetWarningBox;
--	ScTabViewShell* pViewShell = getCurrentBestViewShell();
--	if ( pViewShell )
--	{
--		pViewShell->PasteFromSystem();
--		pViewShell->CellContentChanged();
--	}
+-    mpGeometryHelper->setTop( _top );
 -}
 -
--
--void
--implnCopy()
+-uno::Reference< uno::XInterface > SAL_CALL
+-ScVbaControl::getObject() throw (uno::RuntimeException)
 -{
--	ScTabViewShell* pViewShell = getCurrentBestViewShell();
--	if ( pViewShell )
--		pViewShell->CopyToClip(NULL,false,false,true);
+-	uno::Reference< msforms::XControl > xRet( this );
+-	return xRet;
 -}
 -
--void 
--implnCut()
+-void SAL_CALL ScVbaControl::SetFocus() throw (uno::RuntimeException) 
 -{
--	ScTabViewShell* pViewShell =  getCurrentBestViewShell();
--	if ( pViewShell )
--		pViewShell->CutToClip( NULL, TRUE );
+-    uno::Reference< awt::XWindow > xWin( m_xControl, uno::UNO_QUERY_THROW );
+-    xWin->setFocus();
 -}
 -
--void implnPasteSpecial(USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose)
+-rtl::OUString SAL_CALL 
+-ScVbaControl::getControlSource() throw (uno::RuntimeException)
 -{
--	PasteCellsWarningReseter resetWarningBox;
--	sal_Bool bAsLink(sal_False), bOtherDoc(sal_False);
--	InsCellCmd eMoveMode = INS_NONE;
--
--	ScTabViewShell* pTabViewShell = ScTabViewShell::GetActiveViewShell();
--	if ( !pTabViewShell ) 
--		// none active, try next best
--		pTabViewShell = getCurrentBestViewShell();
--	if ( pTabViewShell )
+-// #FIXME I *hate* having these upstream differences
+-// but this is necessary until I manage to upstream other
+-// dependant parts
+-#ifdef VBA_OOBUILD_HACK
+-	rtl::OUString sControlSource;
+-	uno::Reference< form::binding::XBindableValue > xBindable( m_xProps, uno::UNO_QUERY );
+-	if ( xBindable.is() )
 -	{
--		ScViewData* pView = pTabViewShell->GetViewData();	
--		Window* pWin = ( pView != NULL ) ? pView->GetActiveWin() : NULL;
--		if ( pView && pWin )
+-		try
 -		{
--			if ( bAsLink && bOtherDoc )
--				pTabViewShell->PasteFromSystem(0);//SOT_FORMATSTR_ID_LINK
--			else 
--			{
--				ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
--				ScDocument* pDoc = NULL; 
--				if ( pOwnClip )
--					pDoc = pOwnClip->GetDocument();	
--				pTabViewShell->PasteFromClip( nFlags, pDoc,
--					nFunction, bSkipEmpty, bTranspose, bAsLink,
--					eMoveMode, IDF_NONE, TRUE );
--				pTabViewShell->CellContentChanged();
--			}
--		}
+-			uno::Reference< lang::XMultiServiceFactory > xFac( m_xModel, uno::UNO_QUERY_THROW );
+-			uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.table.CellAddressConversion" ))), uno::UNO_QUERY );
+-			uno::Reference< beans::XPropertySet > xProps( xBindable->getValueBinding(), uno::UNO_QUERY_THROW );
+-			table::CellAddress aAddress;
+-			xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BoundCell") ) ) >>= aAddress;
+-			xConvertor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Address") ), uno::makeAny( aAddress ) );
+-                	xConvertor->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("XL_A1_Representation") ) ) >>= sControlSource;
+-}
+-		catch( uno::Exception& )
+-		{
+-		}	
 -	}
--
+-	return sControlSource;
+-#else
+-	throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("getControlSource not supported") ), uno::Reference< uno::XInterface >()); // not supported
+-#endif
 -}
 -
-- uno::Reference< frame::XModel > 
--getCurrentDocument() throw (uno::RuntimeException)
+-void SAL_CALL 
+-ScVbaControl::setControlSource( const rtl::OUString& _controlsource ) throw (uno::RuntimeException)
 -{
--	uno::Reference< frame::XModel > xModel;
--	SbxObject* pBasic = dynamic_cast< SbxObject* > ( SFX_APP()->GetBasic() );
--	SbxObject* basicChosen =  pBasic ;
--	if ( basicChosen == NULL)
--	{
--		OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" );
--		return xModel;
--	}    
--    SbxObject* p = pBasic;
--    SbxObject* pParent = p->GetParent();
--    SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL;
+-#ifdef VBA_OOBUILD_HACK
+-    rtl::OUString sEmpty;
+-    svt::BindableControlHelper::ApplyListSourceAndBindableData( m_xModel, m_xProps, _controlsource, sEmpty );
+-#else
+-	throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("setControlSource not supported ") ).concat( _controlsource ), uno::Reference< uno::XInterface >()); // not supported
+-#endif
+-}
 -
--    if( pParentParent )
+-rtl::OUString SAL_CALL 
+-ScVbaControl::getRowSource() throw (uno::RuntimeException)
 -    {
--        basicChosen = pParentParent;
--    }
--    else if( pParent )
+-#ifdef VBA_OOBUILD_HACK
+-	rtl::OUString sRowSource;
+-	uno::Reference< form::binding::XListEntrySink > xListSink( m_xProps, uno::UNO_QUERY );
+-	if ( xListSink.is() )
 -    {
--        basicChosen = pParent;
--    }
--
--
--    uno::Any aModel; 
--    SbxVariable *pCompVar = basicChosen->Find(  UniString(RTL_CONSTASCII_USTRINGPARAM("ThisComponent")), SbxCLASS_OBJECT );
--
--	if ( pCompVar )
--	{
--		aModel = sbxToUnoValue( pCompVar );
--		if ( sal_False == ( aModel >>= xModel ) ||
--			!xModel.is() )
+-		try
 -		{
--			// trying last gasp try the current component
--			uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
--			// test if vba service is present
--			uno::Reference< uno::XComponentContext > xCtx( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
--			uno::Reference<lang::XMultiComponentFactory > xSMgr( xCtx->getServiceManager(), uno::UNO_QUERY_THROW );
--			uno::Reference< frame::XDesktop > xDesktop (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx), uno::UNO_QUERY_THROW );
--			xModel.set( xDesktop->getCurrentComponent(), uno::UNO_QUERY );
--			if ( !xModel.is() )
--			{
--				throw uno::RuntimeException( 
--					rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't extract model from basic ( its obviously not set yet ) therefore don't know the currently selected document") ), uno::Reference< uno::XInterface >() );
--			}
--			return xModel;
--		}
--		else
+-			uno::Reference< lang::XMultiServiceFactory > xFac( m_xModel, uno::UNO_QUERY_THROW );
+-			uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.table.CellRangeAddressConversion" ))), uno::UNO_QUERY );
+-
+-			uno::Reference< beans::XPropertySet > xProps( xListSink->getListEntrySource(), uno::UNO_QUERY_THROW );
+-			table::CellRangeAddress aAddress;
+-			xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellRange") ) ) >>= aAddress;
+-			xConvertor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Address")), uno::makeAny( aAddress ) );
+-			xConvertor->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("XL_A1_Representation") ) ) >>= sRowSource;
+-    }
+-		catch( uno::Exception& )
 -		{
--			OSL_TRACE("Have model ThisComponent points to url %s",
--			::rtl::OUStringToOString( xModel->getURL(),
--				RTL_TEXTENCODING_ASCII_US ).pData->buffer );
--		}
--	}
--	else
--	{
--		OSL_TRACE("Failed to get ThisComponent");
--		throw uno::RuntimeException( 
--			rtl::OUString( 
--				RTL_CONSTASCII_USTRINGPARAM(
--					"Can't determine the currently selected document") ),
--			uno::Reference< uno::XInterface >() );
+-}
 -	}
--	return xModel;
+-	return sRowSource;
+-#else
+-	throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("getRowSource not supported") ), uno::Reference< uno::XInterface >()); // not supported
+-#endif
 -}
 -
--ScDocShell* 
--getDocShell( css::uno::Reference< css::frame::XModel>& xModel ) 
+-void SAL_CALL 
+-ScVbaControl::setRowSource( const rtl::OUString& _rowsource ) throw (uno::RuntimeException)
 -{
--	uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW );
--	ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() );
--	ScDocShell* pDocShell = NULL;
--	if ( pModel )
--		pDocShell = (ScDocShell*)pModel->GetEmbeddedObject();
--	return pDocShell;
--
+-#ifdef VBA_OOBUILD_HACK
+-    rtl::OUString sEmpty;
+-    svt::BindableControlHelper::ApplyListSourceAndBindableData( m_xModel, m_xProps, sEmpty, _rowsource );
+-#else
+-	throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("setRowSource not supported ") ).concat( _rowsource ), uno::Reference< uno::XInterface >()); // not supported
+-#endif
 -}
 -
--ScTabViewShell* 
--getBestViewShell(  css::uno::Reference< css::frame::XModel>& xModel )
+-rtl::OUString SAL_CALL 
+-ScVbaControl::getName() throw (uno::RuntimeException)
 -{
--	ScDocShell* pDocShell = getDocShell( xModel );
--	if ( pDocShell )
--		return pDocShell->GetBestViewShell();
--	return NULL;
--}
+-	rtl::OUString sName;
+-	m_xProps->getPropertyValue
+-            (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= sName;
+-	return sName;
 -
--ScTabViewShell* 
--getCurrentBestViewShell()
--{ 
--	uno::Reference< frame::XModel > xModel = getCurrentDocument();
--	return getBestViewShell( xModel );
 -}
 -
--SfxViewFrame* 
--getCurrentViewFrame()
+-void SAL_CALL
+-ScVbaControl::setName( const rtl::OUString& _name ) throw (uno::RuntimeException)
+-{
+-	m_xProps->setPropertyValue
+-            (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ), uno::makeAny( _name ) );
+-    }
+-//ScVbaControlFactory
+-
+-ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel ): m_xContext( xContext ), m_xControl( xControl ), m_xModel( xModel )
 -{
--	ScTabViewShell* pViewShell = getCurrentBestViewShell();	
--	if ( pViewShell )
--		return pViewShell->GetViewFrame();
--	return NULL;
 -}
 -
--sal_Int32 
--OORGBToXLRGB( sal_Int32 nCol )
+-ScVbaControl* ScVbaControlFactory::createControl()  throw (uno::RuntimeException)
 -{
--	sal_Int32 nRed = nCol;
--	nRed &= 0x00FF0000;
--	nRed >>= 16;
--	sal_Int32 nGreen = nCol;
--	nGreen &= 0x0000FF00;
--	nGreen >>= 8;
--	sal_Int32 nBlue = nCol;
--	nBlue &= 0x000000FF;
--	sal_Int32 nRGB =  ( (nBlue << 16) | (nGreen << 8) | nRed );
--	return nRGB;
+-    return createControl( m_xModel );
 -}
--sal_Int32 
--XLRGBToOORGB( sal_Int32 nCol )
+-ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< uno::XInterface >& xParent )  throw (uno::RuntimeException)
 -{
--	sal_Int32 nBlue = nCol;
--	nBlue &= 0x00FF0000;
--	nBlue >>= 16;
--	sal_Int32 nGreen = nCol;
--	nGreen &= 0x0000FF00;
--	nGreen >>= 8;
--	sal_Int32 nRed = nCol;
--	nRed &= 0x000000FF;
--	sal_Int32 nRGB =  ( (nRed << 16) | (nGreen << 8) | nBlue );
--	return nRGB;
+-    uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY );
+-    if ( xControlShape.is() ) // form controls
+-        return createControl( xControlShape, xParent );
+-    uno::Reference< awt::XControl > xControl( m_xControl, uno::UNO_QUERY );
+-    if ( !xControl.is() )
+-        throw uno::RuntimeException(); // really we should be more informative
+-    return createControl( xControl, xParent );
+-    
 -}
--uno::Any 
--OORGBToXLRGB( const uno::Any& aCol )
+-
+-ScVbaControl* ScVbaControlFactory::createControl(const uno::Reference< drawing::XControlShape >& xControlShape,  const uno::Reference< uno::XInterface >& /*xParent*/ )  throw (uno::RuntimeException)
 -{
--	sal_Int32 nCol;
--	aCol >>= nCol;
--	nCol = OORGBToXLRGB( nCol );
--	return uno::makeAny( nCol );
+-    uno::Reference< beans::XPropertySet > xProps( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+-    sal_Int32 nClassId = -1;
+-    const static rtl::OUString sClassId( RTL_CONSTASCII_USTRINGPARAM("ClassId") );
+-    xProps->getPropertyValue( sClassId ) >>= nClassId;
+-    uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess
+-    switch( nClassId )
+-    {
+-        case form::FormComponentType::COMBOBOX:
+-            return new ScVbaComboBox( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+-        case form::FormComponentType::COMMANDBUTTON:
+-            return new ScVbaButton( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+-        case form::FormComponentType::FIXEDTEXT:
+-            return new ScVbaLabel( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+-        case form::FormComponentType::TEXTFIELD:
+-            return new ScVbaTextBox( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+-        case form::FormComponentType::RADIOBUTTON:
+-            return new ScVbaRadioButton( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+-        case form::FormComponentType::LISTBOX:
+-            return new ScVbaListBox( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+-        case form::FormComponentType::SPINBUTTON:
+-            return new ScVbaSpinButton( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+-        case form::FormComponentType::IMAGECONTROL:
+-            return new ScVbaImage( xVbaParent, m_xContext, xControlShape, m_xModel, new ConcreteXShapeGeometryAttributes( m_xContext, uno::Reference< drawing::XShape >( xControlShape, uno::UNO_QUERY_THROW ) ) );
+-        default:
+-            throw uno::RuntimeException( rtl::OUString::createFromAscii(
+-                    "Donot support this Control Type." ), uno::Reference< uno::XInterface >() );
+-    }
 -}
--uno::Any 
--XLRGBToOORGB(  const uno::Any& aCol )
+-
+-ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< awt::XControl >& xControl,  const uno::Reference< uno::XInterface >& xParent  )  throw (uno::RuntimeException)
 -{
--	sal_Int32 nCol;
--	aCol >>= nCol;
--	nCol = XLRGBToOORGB( nCol );
--	return uno::makeAny( nCol );
+-    uno::Reference< beans::XPropertySet > xProps( xControl->getModel(), uno::UNO_QUERY_THROW );
+-    uno::Reference< lang::XServiceInfo > xServiceInfo( xProps, uno::UNO_QUERY_THROW );
+-    ScVbaControl* pControl = NULL;
+-    uno::Reference< XHelperInterface > xVbaParent; // #FIXME - should be worksheet I guess
+-    if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCheckBoxModel") ) ) )
+-	pControl = new ScVbaCheckbox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );	
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ) ) )
+-	pControl = new ScVbaRadioButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );	
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlEditModel") ) ) )
+-        pControl = new ScVbaTextBox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ), true );
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlButtonModel") ) ) )
+-    {
+-        sal_Bool bToggle = sal_False;
+-        xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toggle") ) ) >>= bToggle;
+-        if ( bToggle )
+-            pControl = new ScVbaToggleButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+-        else
+-            pControl = new ScVbaButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+-    }
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlComboBoxModel") ) ) )
+-        pControl = new ScVbaComboBox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ), true );
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) ) )
+-	pControl = new ScVbaListBox( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedTextModel") ) ) )
+-	pControl = new ScVbaLabel( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlImageControlModel") ) ) )
+-	pControl = new ScVbaImage( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ) )
+-	pControl = new ScVbaProgressBar( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ) )
+-	pControl = new ScVbaFrame( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ) ) )
+-	pControl = new ScVbaScrollBar( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ) )
+-	pControl = new ScVbaMultiPage( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ), xParent );
+-    else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) ) )
+-	pControl = new ScVbaSpinButton( xVbaParent, m_xContext, xControl, m_xModel, new UserFormGeometryHelper( m_xContext, xControl ) );
+-    else
+-        throw uno::RuntimeException( rtl::OUString::createFromAscii("Unsupported control " ), uno::Reference< uno::XInterface >() );
+-    return pControl;
+-}
+-
+-rtl::OUString& 
+-ScVbaControl::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaControl") );
+-	return sImplName;
 -}
 -
--void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& Copies, const uno::Any& Preview, const uno::Any& /*ActivePrinter*/, const uno::Any& /*PrintToFile*/, const uno::Any& Collate, const uno::Any& PrToFileName, css::uno::Reference< frame::XModel >& xModel, sal_Bool bUseSelection  )
+-uno::Sequence< rtl::OUString > 
+-ScVbaControl::getServiceNames()
 -{
--	sal_Int32 nTo = 0;
--	sal_Int32 nFrom = 0;
--	sal_Int16 nCopies = 1;
--	sal_Bool bPreview = sal_False;
--	sal_Bool bCollate = sal_False;
--	sal_Bool bSelection = bUseSelection;
--	From >>= nFrom;
--	To >>= nTo;
--	Copies >>= nCopies;
--	Preview >>= bPreview;
--	if ( nCopies > 1 ) // Collate only useful when more that 1 copy
--		Collate >>= bCollate;
--
--	rtl::OUString sRange(  RTL_CONSTASCII_USTRINGPARAM( "-" ) );
--	rtl::OUString sFileName;
--	
--	if (( nFrom || nTo ) )
--	{
--		if ( nFrom )
--			sRange = ( ::rtl::OUString::valueOf( nFrom ) + sRange );
--		if ( nTo )
--			sRange += ::rtl::OUString::valueOf( nTo );
--	}
--
--	if (  PrToFileName.getValue() )
--	{
--		PrToFileName >>= sFileName;
--	}
--	ScTabViewShell* pViewShell = getBestViewShell( xModel );
--	SfxViewFrame* pViewFrame = NULL;
--	if ( pViewShell )
--		pViewFrame = pViewShell->GetViewFrame();
--	if ( pViewFrame )
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
 -	{
--		SfxAllItemSet aArgs( SFX_APP()->GetPool() );
--				
--		SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate );
--		aArgs.Put( sfxCollate, sfxCollate.Which() );
--		SfxInt16Item sfxCopies( SID_PRINT_COPIES, nCopies );
--		aArgs.Put( sfxCopies, sfxCopies.Which() );
--		if ( sFileName.getLength() )
--		{
--			SfxStringItem sfxFileName( SID_FILE_NAME, sFileName);
--			aArgs.Put( sfxFileName, sfxFileName.Which() );
--		
--		}
--		if (  sRange.getLength() )
--		{
--			SfxStringItem sfxRange( SID_PRINT_PAGES, sRange );
--			aArgs.Put( sfxRange, sfxRange.Which() );
--		}
--		SfxBoolItem sfxSelection( SID_SELECTION, bSelection );
--		aArgs.Put( sfxSelection, sfxSelection.Which() );
--		SfxBoolItem sfxAsync( SID_ASYNCHRON, sal_False );
--		aArgs.Put( sfxAsync, sfxAsync.Which() );
--		SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
--
--		if ( pDispatcher )
--		{
--			if ( bPreview )
--			{
--				if ( !pViewFrame->GetFrame()->IsInPlace() ) 	
--				{
--					SC_MOD()->InputEnterHandler();
--					pViewFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SFX_CALLMODE_SYNCHRON );
--					while ( isInPrintPreview( pViewFrame ) )
--						Application::Yield();
--				}
--			}
--			else
--				pDispatcher->Execute( (USHORT)SID_PRINTDOC, (SfxCallMode)SFX_CALLMODE_SYNCHRON, aArgs );
--		}
--			
--	}
--	
--	// #FIXME #TODO
--	// 1 ActivePrinter ( how/can we switch a printer via API? )
--	// 2 PrintToFile ( ms behaviour if this option is specified but no 
--	//   filename supplied 'PrToFileName' then the user will be prompted )
--	// 3 Need to check behaviour of Selected sheets with range ( e.g. From & To
--	//    values ) in oOO these options are mutually exclusive
--	// 4 There is a pop up to do with transparent objects in the print source
--	//   should be able to disable that via configuration for the duration
--	//   of this method
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Control" ) );
+-    }
+-	return aServiceNames;
 -}
 -
-- void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, css::uno::Reference< css::frame::XModel >& xModel )
--{
--	dispatchExecute( xModel, SID_VIEWSHELL1 );
--}
 -
--rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException )
--{
--	uno::Type aType = pvargItem.getValueType();
--	uno::TypeClass eTypeClass = aType.getTypeClass();
--	rtl::OUString sString;
--	switch ( eTypeClass )
--	{
--		case uno::TypeClass_BOOLEAN:
--		{
--			sal_Bool bBool = sal_False;
--			pvargItem >>= bBool;
--			sString = rtl::OUString::valueOf( bBool );
--			break;
--		}
--		case uno::TypeClass_STRING:
--			pvargItem >>= sString;
--			break;
--		case uno::TypeClass_FLOAT:
--			{
--				float aFloat = 0;
--				pvargItem >>= aFloat;
--				sString = rtl::OUString::valueOf( aFloat );
--				break;
--			}
--		case uno::TypeClass_DOUBLE:
--			{
--				double aDouble = 0;
--				pvargItem >>= aDouble;
--				sString = rtl::OUString::valueOf( aDouble );
--				break;
--			}
--		case uno::TypeClass_SHORT:
--		case uno::TypeClass_LONG:
--		case uno::TypeClass_BYTE:
--			{
--				sal_Int32 aNum = 0;
--				pvargItem >>= aNum;
--				sString = rtl::OUString::valueOf( aNum );
--				break;
--			}
+diff --git sc/source/ui/vba/vbacontrol.hxx sc/source/ui/vba/vbacontrol.hxx
+deleted file mode 100644
+index 21c5de2..0000000
+--- sc/source/ui/vba/vbacontrol.hxx
++++ /dev/null
+@@ -1,111 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbacontrol.hxx,v $
+- * $Revision: 1.3 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_CONTROL_HXX
+-#define SC_VBA_CONTROL_HXX
 -
--		case uno::TypeClass_HYPER:
--			{
--				sal_Int64 aHyper = 0;
--				pvargItem >>= aHyper;
--				sString = rtl::OUString::valueOf( aHyper );
--				break;
--			}
--		default:
--       			throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid type, can't convert" ), uno::Reference< uno::XInterface >() );
--	}
--	return sString;
--}
+-#include <cppuhelper/implbase1.hxx>
+-#include <com/sun/star/beans/XPropertySet.hpp>
+-#include <com/sun/star/uno/XComponentContext.hpp>
+-#include <com/sun/star/script/XDefaultProperty.hpp>
+-#include <com/sun/star/drawing/XControlShape.hpp>
+-#include <com/sun/star/awt/XControl.hpp>
+-#include <com/sun/star/awt/XWindowPeer.hpp>
+-#include <ooo/vba/msforms/XControl.hpp>
 -
+-#include "vbahelper.hxx"
+-#include "vbahelperinterface.hxx"
 -
--rtl::OUString 
--ContainerUtilities::getUniqueName( const uno::Sequence< ::rtl::OUString >&  _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator)
--{
--	return getUniqueName(_slist, _sElementName, _sSuffixSeparator, sal_Int32(2));
--}
+-//typedef ::cppu::WeakImplHelper1< ov::msforms::XControl > ControlImpl_BASE;
+-typedef InheritedHelperInterfaceImpl1< ov::msforms::XControl > ControlImpl_BASE;
 -
--rtl::OUString 
--ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix)
+-class ScVbaControl : public ControlImpl_BASE
 -{
--	sal_Int32 a = _nStartSuffix;
--	rtl::OUString scompname = _sElementName;
--	bool bElementexists = true;
--	sal_Int32 nLen = _slist.getLength();
--	if ( nLen == 0 )
--		return _sElementName;
+-private:
+-    com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > m_xEventListener;
+-protected:
+-    std::auto_ptr< ov::AbstractGeometryAttributes > mpGeometryHelper;
+-    css::uno::Reference< css::beans::XPropertySet > m_xProps;
+-    css::uno::Reference< css::uno::XInterface > m_xControl;
+-    css::uno::Reference< css::frame::XModel > m_xModel;
 -
--	while (bElementexists == true) 
--	{
--		for (sal_Int32 i = 0; i < nLen; i++)
--		{
--			if (FieldInList(_slist, scompname) == -1)
--			{
--				return scompname;
--			}
--		}
--		scompname = _sElementName + _sSuffixSeparator + rtl::OUString::valueOf( a++ );
--	}
--	return rtl::OUString();
--}
+-    virtual css::uno::Reference< css::awt::XWindowPeer > getWindowPeer() throw (css::uno::RuntimeException);
+-public:
+-    ScVbaControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, 
+-                    const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pHelper );
+-    virtual ~ScVbaControl();
+-    // This class will own the helper, so make sure it is allocated from 
+-    // the heap
+-    void setGeometryHelper( ov::AbstractGeometryAttributes* pHelper );
+-    // XControl
+-    virtual sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setEnabled( sal_Bool _enabled ) throw (css::uno::RuntimeException);
+-    virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
+-    virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException);
+-    virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setWidth( double _width ) throw (css::uno::RuntimeException);
+-    virtual double SAL_CALL getLeft() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setLeft( double _left ) throw (css::uno::RuntimeException);
+-    virtual double SAL_CALL getTop() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL SetFocus(  ) throw (css::uno::RuntimeException);
+-
+-    virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getObject() throw (css::uno::RuntimeException);
+-    virtual rtl::OUString SAL_CALL getControlSource() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setControlSource( const rtl::OUString& _controlsource ) throw (css::uno::RuntimeException);
+-    virtual rtl::OUString SAL_CALL getRowSource() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
+-    virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setName( const rtl::OUString& _name ) throw (css::uno::RuntimeException);
+-    //remove resouce because ooo.vba.excel.XControl is a wrapper of com.sun.star.drawing.XControlShape
+-    virtual void removeResouce() throw( css::uno::RuntimeException );
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-};
 -
--sal_Int32 
--ContainerUtilities::FieldInList( const uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString )
+-
+-class ScVbaControlFactory
 -{
--	sal_Int32 FieldLen = SearchList.getLength();
--	sal_Int32 retvalue = -1;
--	for (sal_Int32 i = 0; i < FieldLen; i++) 
--	{
--		// I wonder why comparing lexicographically is done
--		// when its a match is whats interesting?
--		//if (SearchList[i].compareTo(SearchString) == 0) 
--		if ( SearchList[i].equals( SearchString ) ) 
--		{
--			retvalue = i;
--			break;
--		}
--	}
--	return retvalue;
+-public:
+-    ScVbaControlFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext, 
+-                    const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel );
+-    ScVbaControl* createControl()  throw ( css::uno::RuntimeException );
+-    ScVbaControl* createControl( const css::uno::Reference< css::uno::XInterface >& xParent )  throw ( css::uno::RuntimeException );
+-private:
+-    ScVbaControl* createControl( const css::uno::Reference< css::awt::XControl >&, const css::uno::Reference< css::uno::XInterface >&  )  throw ( css::uno::RuntimeException );
+-    ScVbaControl* createControl( const css::uno::Reference< css::drawing::XControlShape >&, const css::uno::Reference< css::uno::XInterface >& )  throw ( css::uno::RuntimeException );
+-    css::uno::Reference< css::uno::XComponentContext > m_xContext;
+-    css::uno::Reference< css::uno::XInterface > m_xControl;
+-    css::uno::Reference< css::frame::XModel > m_xModel;
+-};
+-
+-#endif//SC_VBA_CONTROL_HXX
+diff --git sc/source/ui/vba/vbacontrols.cxx sc/source/ui/vba/vbacontrols.cxx
+deleted file mode 100644
+index e27e46a..0000000
+--- sc/source/ui/vba/vbacontrols.cxx
++++ /dev/null
+@@ -1,227 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile$
+- * $Revision$
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-
+-#include "vbacontrols.hxx"
+-#include "vbacontrol.hxx"
+-#include <cppuhelper/implbase2.hxx>
+-#include <com/sun/star/awt/XControlContainer.hpp>
+-#include <hash_map>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-
+-typedef ::cppu::WeakImplHelper2< container::XNameAccess, container::XIndexAccess > ArrayWrapImpl;
+-
+-typedef  std::hash_map< rtl::OUString, sal_Int32, ::rtl::OUStringHash,
+-    ::std::equal_to< ::rtl::OUString >  > ControlIndexMap;
+-typedef  std::vector< uno::Reference< awt::XControl > > ControlVec;
+-
+-class ControlArrayWrapper : public ArrayWrapImpl
+-{
+-    uno::Reference< awt::XControlContainer > mxDialog;
+-    uno::Sequence< ::rtl::OUString > msNames;
+-    ControlVec mControls;
+-    ControlIndexMap mIndices;
+-
+-    rtl::OUString getControlName( const uno::Reference< awt::XControl >& xCtrl )
+-    {
+-        uno::Reference< beans::XPropertySet > xProp( xCtrl->getModel(), uno::UNO_QUERY );
+-        rtl::OUString sName;
+-        xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= sName;
+-        return sName;
+-    }
+-
+-public:
+-
+-    ControlArrayWrapper( const uno::Reference< awt::XControl >& xDialog )
+-    {
+-        mxDialog.set( xDialog, uno::UNO_QUERY_THROW );
+-        uno::Sequence< uno::Reference< awt::XControl > > sXControls = mxDialog->getControls();
+-    
+-        msNames.realloc( sXControls.getLength() );
+-        for ( sal_Int32 i = 0; i < sXControls.getLength(); ++i )
+-        {
+-            uno::Reference< awt::XControl > xCtrl = sXControls[ i ];
+-            msNames[ i ] = getControlName( xCtrl );
+-            mControls.push_back( xCtrl );
+-            mIndices[ msNames[ i ] ] = i;
+-        }
+-    }
+-    
+-    // XElementAccess
+-    virtual uno::Type SAL_CALL getElementType(  ) throw (uno::RuntimeException)
+-    {
+-        return awt::XControl::static_type(0);
+-    }
+-    
+-    virtual ::sal_Bool SAL_CALL hasElements(  ) throw (uno::RuntimeException) 
+-    {
+-        return mControls.size();
+-    }
+-    
+-    // XNameAcess 
+-    virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+-    {
+-        if ( !hasByName( aName ) )
+-            throw container::NoSuchElementException();
+-        return getByIndex( mIndices[ aName ] );
+-    }
+-    
+-    virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(  ) throw (uno::RuntimeException)
+-    {
+-        return msNames;
+-    }
+-    
+-    virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException)
+-    {
+-        ControlIndexMap::iterator it = mIndices.find( aName );
+-        return it != mIndices.end();
+-    }
+-    
+-    // XElementAccess
+-    virtual ::sal_Int32 SAL_CALL getCount(  ) throw (css::uno::RuntimeException)
+-    {
+-        return mControls.size();
+-    }
+-    
+-    virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
+-    {
+-        if ( Index < 0 || Index >= static_cast< sal_Int32 >( mControls.size() ) )
+-            throw lang::IndexOutOfBoundsException();
+-        return uno::makeAny( mControls[ Index ] );
+-    }
+-};
+-
+-
+-class ControlsEnumWrapper : public EnumerationHelper_BASE
+-{
+-    uno::Reference<XHelperInterface > m_xParent;
+-    uno::Reference<uno::XComponentContext > m_xContext;
+-    uno::Reference<container::XIndexAccess > m_xIndexAccess;
+-    uno::Reference<awt::XControl > m_xDlg;
+-    sal_Int32 nIndex;
+-
+-public:
+-
+-    ControlsEnumWrapper(  const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess, const uno::Reference< awt::XControl >& xDlg ) :  m_xParent( xParent ), m_xContext( xContext), m_xIndexAccess( xIndexAccess ), m_xDlg( xDlg ), nIndex( 0 ) {}
+-
+-    virtual ::sal_Bool SAL_CALL hasMoreElements(  ) throw (uno::RuntimeException)
+-    {
+-        return ( nIndex < m_xIndexAccess->getCount() );
+-    }
 -
+-    virtual uno::Any SAL_CALL nextElement(  ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+-    {
+-        if ( nIndex < m_xIndexAccess->getCount() )
+-        {
+-            uno::Reference< frame::XModel > xModel;
+-            uno::Reference< uno::XInterface > xControl;
+-            m_xIndexAccess->getByIndex( nIndex++ ) >>= xControl;
+-            // Create control from awt::XControl
+-            ScVbaControlFactory aFac( m_xContext, xControl,  xModel );
+-            uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( m_xDlg->getModel() ) );
+-            return uno::makeAny( xVBAControl );
+-        }
+-        throw container::NoSuchElementException();
+-    }
+-
+-};
+-
+-
+-uno::Reference<container::XIndexAccess >
+-lcl_controlsWrapper( const uno::Reference< awt::XControl >& xDlg )
+-{
+-    return new ControlArrayWrapper( xDlg );
 -}
--bool NeedEsc(sal_Unicode cCode)
+-
+-ScVbaControls::ScVbaControls( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext,
+-                const css::uno::Reference< awt::XControl >& xDialog )
+-            : ControlsImpl_BASE( xParent, xContext, lcl_controlsWrapper( xDialog  ) )
 -{
--	String sEsc(RTL_CONSTASCII_USTRINGPARAM(".^$+\\|{}()"));
--	return (STRING_NOTFOUND != sEsc.Search(cCode));
+-    mxDialog.set( xDialog, uno::UNO_QUERY_THROW );
 -}
 -
--rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike )
+-uno::Reference< container::XEnumeration >
+-ScVbaControls::createEnumeration() throw (uno::RuntimeException)
 -{
--	rtl::OUStringBuffer sResult;
--	const sal_Unicode *start = rIn.getStr();
--	const sal_Unicode *end = start + rIn.getLength();
+-    uno::Reference< container::XEnumeration > xEnum( new ControlsEnumWrapper( mxParent, mxContext, m_xIndexAccess, mxDialog ) );
+-    if ( !xEnum.is() )
+-        throw uno::RuntimeException();
+-    return xEnum;
+-}
 -
--	int seenright = 0;
--	if ( bForLike )
--		sResult.append(static_cast<sal_Unicode>('^'));
+-uno::Any
+-ScVbaControls::createCollectionObject( const css::uno::Any& aSource )
+-{
+-    // Create control from awt::XControl
+-    uno::Reference< awt::XControl > xControl;
+-    aSource >>= xControl;
+-    uno::Reference< frame::XModel > xModel;
+-    ScVbaControlFactory aFac( mxContext, xControl,  xModel );
+-    uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( mxDialog->getModel() ) );
+-    return uno::makeAny( xVBAControl );
+-}
 -
--	while (start < end) 
+-void SAL_CALL 
+-ScVbaControls::Move( double cx, double cy ) throw (uno::RuntimeException)
+-{
+-    uno::Reference< container::XEnumeration > xEnum( createEnumeration() );
+-    while ( xEnum->hasMoreElements() )
+-    {
+-        uno::Reference< msforms::XControl > xControl( xEnum->nextElement(), uno::UNO_QUERY_THROW );
+-        xControl->setLeft( xControl->getLeft() + cx );
+-        xControl->setTop( xControl->getTop() + cy ); 
+-    }
+-}
+-
+-uno::Type
+-ScVbaControls::getElementType() throw (uno::RuntimeException)
+-{
+-    return ooo::vba::msforms::XControl::static_type(0);
+-}
+-rtl::OUString& 
+-ScVbaControls::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaControls") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaControls::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
 -	{
--		switch (*start)
--		{
--			case '?':
--				sResult.append(static_cast<sal_Unicode>('.'));
--				start++;
--				break;
--			case '*':
--				sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".*")));
--				start++;
--				break;
--			case '#':
--				sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[0-9]")));
--				start++;
--				break;
--			case '~':
--				sResult.append(static_cast<sal_Unicode>('\\'));
--				sResult.append(*(++start));
--				start++;
--				break;
--				// dump the ~ and escape the next characture
--			case ']':
--				sResult.append(static_cast<sal_Unicode>('\\'));
--				sResult.append(*start++);
--				break;
--			case '[':
--				sResult.append(*start++);
--				seenright = 0;
--				while (start < end && !seenright)
--				{
--					switch (*start)
--					{
--						case '[':
--						case '?':
--						case '*':
--						sResult.append(static_cast<sal_Unicode>('\\'));
--						sResult.append(*start);
--							break;
--						case ']':
--						sResult.append(*start);
--							seenright = 1;
--							break;
--						case '!':
--							sResult.append(static_cast<sal_Unicode>('^'));
--							break;
--						default:
--						if (NeedEsc(*start))
--							sResult.append(static_cast<sal_Unicode>('\\'));
--						sResult.append(*start);
--							break;
--					}
--					start++;
--				}
--				break;
--			default:
--				if (NeedEsc(*start))
--					sResult.append(static_cast<sal_Unicode>('\\'));
--				sResult.append(*start++);
--		}
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Controls" ) );
 -	}
+-	return aServiceNames;
+-}
+diff --git sc/source/ui/vba/vbacontrols.hxx sc/source/ui/vba/vbacontrols.hxx
+deleted file mode 100644
+index 31ab049..0000000
+--- sc/source/ui/vba/vbacontrols.hxx
++++ /dev/null
+@@ -1,62 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile$
+- * $Revision$
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_CONTROLS_HXX
+-#define SC_VBA_CONTROLS_HXX
+-
+-#include <cppuhelper/implbase1.hxx>
+-#include <ooo/vba/msforms/XControls.hpp>
+-#include <com/sun/star/awt/XControl.hpp>
+-
+-#include "vbacollectionimpl.hxx"
+-#include "vbahelper.hxx"
+-
+-typedef CollTestImplHelper< ov::msforms::XControls > ControlsImpl_BASE;
+-
+-class ScVbaControls : public ControlsImpl_BASE
+-{
+-	css::uno::Reference< css::awt::XControl > mxDialog;
+-protected:
+-	virtual rtl::OUString& getServiceImplName();
+-	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-public:
+-    ScVbaControls( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, 
+-                    const css::uno::Reference< css::awt::XControl >& xDialog );
+-    // XControls
+-     virtual void SAL_CALL Move( double cx, double cy ) throw (css::uno::RuntimeException);
+-    // XEnumerationAccess
+-    virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+-    virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+-
+-    // ScVbaCollectionBaseImpl
+-    virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+-    
+-};
+-#endif //SC_VBA_OLEOBJECTS_HXX
+-
+diff --git sc/source/ui/vba/vbadialog.cxx sc/source/ui/vba/vbadialog.cxx
+index 6037390..7383f5d 100644
+--- sc/source/ui/vba/vbadialog.cxx
++++ sc/source/ui/vba/vbadialog.cxx
+@@ -35,7 +35,7 @@
+ 
+ #include <tools/string.hxx>
+ 
+-#include "vbahelper.hxx"
++#include "excelvbahelper.hxx"
+ #include "vbadialog.hxx"
+ #include "vbaglobals.hxx"
+ 
+diff --git sc/source/ui/vba/vbadialog.hxx sc/source/ui/vba/vbadialog.hxx
+index 94d8114..162e19c 100644
+--- sc/source/ui/vba/vbadialog.hxx
++++ sc/source/ui/vba/vbadialog.hxx
+@@ -37,7 +37,7 @@
+ #include <ooo/vba/excel/XApplication.hpp>
+ #include <ooo/vba/excel/XDialog.hpp>
+  
+-#include "vbahelperinterface.hxx"
++#include <vbahelper/vbahelperinterface.hxx>
+ #include "vbadialog.hxx"
+ 
+ typedef InheritedHelperInterfaceImpl1< ov::excel::XDialog > ScVbaDialog_BASE;
+diff --git sc/source/ui/vba/vbadialogs.cxx sc/source/ui/vba/vbadialogs.cxx
+index e25cf7c..c798be9 100644
+--- sc/source/ui/vba/vbadialogs.cxx
++++ sc/source/ui/vba/vbadialogs.cxx
+@@ -36,7 +36,7 @@
+ 
+ #include <tools/string.hxx>
+ 
+-#include "vbahelper.hxx"
++#include "excelvbahelper.hxx"
+ #include "vbadialogs.hxx"
+ #include "vbaglobals.hxx"
+ #include "vbadialog.hxx"
+diff --git sc/source/ui/vba/vbadialogs.hxx sc/source/ui/vba/vbadialogs.hxx
+index fe9a32c..a0b2b24 100644
+--- sc/source/ui/vba/vbadialogs.hxx
++++ sc/source/ui/vba/vbadialogs.hxx
+@@ -35,7 +35,7 @@
+ #include <com/sun/star/uno/XComponentContext.hpp>
+ #include <ooo/vba/excel/XDialogs.hpp>
+ #include <ooo/vba/XCollection.hpp>
+-#include "vbahelperinterface.hxx" 
++#include <vbahelper/vbahelperinterface.hxx>
+ 
+ class ScModelObj;
+ 
+diff --git sc/source/ui/vba/vbaeventshelper.cxx sc/source/ui/vba/vbaeventshelper.cxx
+index c83406f..52ba287 100644
+--- sc/source/ui/vba/vbaeventshelper.cxx
++++ sc/source/ui/vba/vbaeventshelper.cxx
+@@ -33,7 +33,7 @@
+  *
+  ************************************************************************/
+ #include "vbaeventshelper.hxx"
+-#include "helperdecl.hxx"
++#include <vbahelper/helperdecl.hxx>
+ #include <sfx2/objsh.hxx> 
+ #include <basic/basmgr.hxx>
+ #include <basic/sbmod.hxx>
+diff --git sc/source/ui/vba/vbaeventshelper.hxx sc/source/ui/vba/vbaeventshelper.hxx
+index df56886..fd0dc12 100644
+--- sc/source/ui/vba/vbaeventshelper.hxx
++++ sc/source/ui/vba/vbaeventshelper.hxx
+@@ -40,7 +40,7 @@
+ #include <cppuhelper/implbase1.hxx>
+ #include <com/sun/star/document/VbaEventId.hpp>
+ #include <com/sun/star/document/XVbaEventsHelper.hpp>
+-#include "vbahelper.hxx"
++#include "excelvbahelper.hxx"
+ 
+ #define INVALID_TAB -1
+ 
+diff --git sc/source/ui/vba/vbafillformat.hxx sc/source/ui/vba/vbafillformat.hxx
+index 88fcfc0..047af92 100644
+--- sc/source/ui/vba/vbafillformat.hxx
++++ sc/source/ui/vba/vbafillformat.hxx
+@@ -33,7 +33,7 @@
+ #include <com/sun/star/drawing/XShape.hpp>
+ #include <com/sun/star/drawing/FillStyle.hpp>
+ #include <ooo/vba/msforms/XFillFormat.hpp>
+-#include "vbahelperinterface.hxx"
++#include <vbahelper/vbahelperinterface.hxx>
+ 
+ typedef InheritedHelperInterfaceImpl1< ov::msforms::XFillFormat > ScVbaFillFormat_BASE;
+ 
+diff --git sc/source/ui/vba/vbafont.hxx sc/source/ui/vba/vbafont.hxx
+index f73d729..efca63c 100644
+--- sc/source/ui/vba/vbafont.hxx
++++ sc/source/ui/vba/vbafont.hxx
+@@ -34,7 +34,7 @@
+ 
+ #include <ooo/vba/excel/XFont.hpp>
+ #include <com/sun/star/beans/XPropertySet.hpp>
+-#include "vbahelperinterface.hxx"
++#include <vbahelper/vbahelperinterface.hxx>
+ #include "vbapalette.hxx"
+ 
+ class ScTableSheetsObj;
+diff --git sc/source/ui/vba/vbaformat.cxx sc/source/ui/vba/vbaformat.cxx
+index 16cbf3a..9a13b94 100644
+--- sc/source/ui/vba/vbaformat.cxx
++++ sc/source/ui/vba/vbaformat.cxx
+@@ -33,6 +33,7 @@
+ #include <ooo/vba/excel/XlHAlign.hpp>
+ #include <ooo/vba/excel/XlOrientation.hpp>
+ #include <ooo/vba/excel/Constants.hpp>
++#include <ooo/vba/excel/XRange.hpp>
+ #include <com/sun/star/table/CellVertJustify.hpp>
+ #include <com/sun/star/table/CellHoriJustify.hpp>
+ #include <com/sun/star/table/CellOrientation.hpp>
+diff --git sc/source/ui/vba/vbaformat.hxx sc/source/ui/vba/vbaformat.hxx
+index a88687d..7c01ea4 100644
+--- sc/source/ui/vba/vbaformat.hxx
++++ sc/source/ui/vba/vbaformat.hxx
+@@ -39,7 +39,7 @@
+ #include <com/sun/star/lang/XMultiServiceFactory.hpp>
+ #include <com/sun/star/lang/Locale.hpp>
+ #include <com/sun/star/beans/XPropertyState.hpp>
+-#include "vbahelperinterface.hxx"
++#include <vbahelper/vbahelperinterface.hxx>
+ 
+ template< typename Ifc1 >
+ class ScVbaFormat : public InheritedHelperInterfaceImpl1< Ifc1 >
+diff --git sc/source/ui/vba/vbaformatconditions.cxx sc/source/ui/vba/vbaformatconditions.cxx
+index 26d8b67..827503e 100644
+--- sc/source/ui/vba/vbaformatconditions.cxx
++++ sc/source/ui/vba/vbaformatconditions.cxx
+@@ -36,6 +36,7 @@
+ #include "vbaformatcondition.hxx"
+ #include "vbaworkbook.hxx"
+ #include "vbastyles.hxx"
++#include "vbaglobals.hxx"
+ using namespace ::ooo::vba;
+ using namespace ::com::sun::star;
+ 
+diff --git sc/source/ui/vba/vbaformatconditions.hxx sc/source/ui/vba/vbaformatconditions.hxx
+index efdfce5..cac54da 100644
+--- sc/source/ui/vba/vbaformatconditions.hxx
++++ sc/source/ui/vba/vbaformatconditions.hxx
+@@ -35,7 +35,7 @@
+ #include <com/sun/star/beans/XPropertySet.hpp>
+ #include <com/sun/star/table/CellAddress.hpp>
+ #include <com/sun/star/sheet/XSheetConditionalEntries.hpp>
+-#include "vbacollectionimpl.hxx"
++#include <vbahelper/vbacollectionimpl.hxx>
+ 
+ typedef CollTestImplHelper< ov::excel::XFormatConditions > ScVbaFormatConditions_BASE;
+ class ScVbaFormatConditions: public ScVbaFormatConditions_BASE
+diff --git sc/source/ui/vba/vbaframe.cxx sc/source/ui/vba/vbaframe.cxx
+deleted file mode 100644
+index b2827d0..0000000
+--- sc/source/ui/vba/vbaframe.cxx
++++ /dev/null
+@@ -1,93 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#include "vbaframe.hxx"
+-#include <vector>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-
+-const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+-ScVbaFrame::ScVbaFrame( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : FrameImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+-{
+-}
+-
+-// Attributes
+-rtl::OUString SAL_CALL 
+-ScVbaFrame::getCaption() throw (css::uno::RuntimeException)
+-{
+-    rtl::OUString Label;
+-    m_xProps->getPropertyValue( LABEL ) >>= Label;
+-    return Label;
+-}
+-
+-void SAL_CALL 
+-ScVbaFrame::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+-}
+-
+-uno::Any SAL_CALL 
+-ScVbaFrame::getValue() throw (css::uno::RuntimeException)
+-{
+-    return uno::makeAny( getCaption() );
+-}
+-
+-void SAL_CALL 
+-ScVbaFrame::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
+-{
+-    rtl::OUString sCaption;
+-    _value >>= sCaption;
+-    setCaption( sCaption ); 
+-}
+-
+-rtl::OUString& 
+-ScVbaFrame::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaFrame") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaFrame::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) );
+-	}
+-	return aServiceNames;
+-}
+diff --git sc/source/ui/vba/vbaframe.hxx sc/source/ui/vba/vbaframe.hxx
+deleted file mode 100644
+index 6020457..0000000
+--- sc/source/ui/vba/vbaframe.hxx
++++ /dev/null
+@@ -1,58 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_FRAME_HXX
+-#define SC_VBA_FRAME_HXX
+-#include <cppuhelper/implbase1.hxx>
+-#include <ooo/vba/msforms/XLabel.hpp>
+-
+-#include "vbacontrol.hxx"
+-#include "vbahelper.hxx"
+-
+-typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XLabel > FrameImpl_BASE;
+-
+-class ScVbaFrame : public FrameImpl_BASE
+-{
+-public:
+-    ScVbaFrame(  const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+-   // Attributes
+-    virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-    virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-};
+-#endif //SC_VBA_LABEL_HXX
+diff --git sc/source/ui/vba/vbaglobals.cxx sc/source/ui/vba/vbaglobals.cxx
+index bfc291f..7c829bf 100644
+--- sc/source/ui/vba/vbaglobals.cxx
++++ sc/source/ui/vba/vbaglobals.cxx
+@@ -27,7 +27,7 @@
+  * for a copy of the LGPLv3 License.
+  *
+  ************************************************************************/
+-#include "helperdecl.hxx"
++#include <vbahelper/helperdecl.hxx>
+ #include "vbaglobals.hxx"
+ 
+ #include <comphelper/unwrapargs.hxx>
+diff --git sc/source/ui/vba/vbaglobals.hxx sc/source/ui/vba/vbaglobals.hxx
+index 0e9e3a5..ee33026 100644
+--- sc/source/ui/vba/vbaglobals.hxx
++++ sc/source/ui/vba/vbaglobals.hxx
+@@ -36,7 +36,7 @@
+ #include <ooo/vba/XGlobals.hpp>
+ 
+ #include <cppuhelper/implbase1.hxx>
+-#include "vbahelper.hxx"
++#include "excelvbahelper.hxx"
+ 
+     // =============================================================================
+     // class ScVbaGlobals
+diff --git sc/source/ui/vba/vbahelper.cxx sc/source/ui/vba/vbahelper.cxx
+deleted file mode 100644
+index 5e5f6e6..0000000
+--- sc/source/ui/vba/vbahelper.cxx
++++ /dev/null
+@@ -1,818 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbahelper.cxx,v $
+- * $Revision: 1.5.32.1 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#include <cppuhelper/bootstrap.hxx>
+-#include <com/sun/star/util/XURLTransformer.hpp>
+-#include <com/sun/star/frame/XDispatchProvider.hpp>
+-#include <com/sun/star/frame/XModel.hpp>
+-#include <com/sun/star/frame/XFrame.hpp>
+-#include <com/sun/star/frame/XDesktop.hpp>
+-#include <com/sun/star/frame/XController.hpp>
+-#include <com/sun/star/uno/XComponentContext.hpp>
+-#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+-#include <com/sun/star/beans/XPropertySet.hpp>
+-#include <com/sun/star/beans/XIntrospection.hpp>
+-
+-#include <comphelper/processfactory.hxx>
+-
+-#include <sfx2/objsh.hxx>
+-#include <sfx2/viewfrm.hxx>
+-#include <sfx2/dispatch.hxx>
+-#include <sfx2/app.hxx>
+-#include <svtools/stritem.hxx>
+-
+-#include <docuno.hxx>
+-
+-#include <basic/sbx.hxx>
+-#include <basic/sbstar.hxx>
+-#include <rtl/math.hxx>
+-
+-#include <math.h>
+-#include "vbahelper.hxx"
+-#include "tabvwsh.hxx"
+-#include "transobj.hxx"
+-#include "scmod.hxx"
+-#include "vbashape.hxx"
+-#include "unonames.hxx"
+-using namespace ::com::sun::star;
+-using namespace ::ooo::vba;
+-
+-#define POINTTO100THMILLIMETERFACTOR 35.27778
+-void unoToSbxValue( SbxVariable* pVar, const uno::Any& aValue );
+-
+-uno::Any sbxToUnoValue( SbxVariable* pVar );
+-
+-
+-namespace ooo
+-{
+-namespace vba
+-{
+-
+-const double Millimeter::factor =  35.27778;
+-
+-uno::Reference< beans::XIntrospectionAccess >
+-getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
+-{
+-	static uno::Reference< beans::XIntrospection > xIntrospection;
+-	if( !xIntrospection.is() )
+-	{
+-		uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+-		xIntrospection.set( xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.beans.Introspection") ), uno::UNO_QUERY_THROW );
+-	}
+-	return xIntrospection->inspect( aObject );
+-}
+-
+-uno::Reference< script::XTypeConverter >
+-getTypeConverter( const uno::Reference< uno::XComponentContext >& xContext ) throw (uno::RuntimeException)
+-{
+-	static uno::Reference< script::XTypeConverter > xTypeConv( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter") ), xContext ), uno::UNO_QUERY_THROW );
+-	return xTypeConv;
+-}
+-// helper method to determine if the view ( calc ) is in print-preview mode
+-bool isInPrintPreview( SfxViewFrame* pView )
+-{
+-	sal_uInt16 nViewNo = SID_VIEWSHELL1 - SID_VIEWSHELL0;
+-	if ( pView->GetObjectShell()->GetFactory().GetViewFactoryCount() >
+-nViewNo && !pView->GetObjectShell()->IsInPlaceActive() )
+-	{
+-		SfxViewFactory &rViewFactory =
+-			pView->GetObjectShell()->GetFactory().GetViewFactory(nViewNo);
+-		if (  pView->GetCurViewId() == rViewFactory.GetOrdinal() )
+-			return true;
+-	}
+-	return false;
+-}
+-const ::rtl::OUString REPLACE_CELLS_WARNING(  RTL_CONSTASCII_USTRINGPARAM( "ReplaceCellsWarning"));
+-const uno::Any&
+-aNULL()
+-{
+- 	static  uno::Any aNULLL = uno::makeAny( uno::Reference< uno::XInterface >() );
+-	return aNULLL;
+-}
+-
+-class PasteCellsWarningReseter
+-{
+-private:
+-	bool bInitialWarningState;
+-	static uno::Reference< beans::XPropertySet > getGlobalSheetSettings() throw ( uno::RuntimeException )
+-	{
+-		static uno::Reference< beans::XPropertySet > xTmpProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+-		static uno::Reference<uno::XComponentContext > xContext( xTmpProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
+-		static uno::Reference<lang::XMultiComponentFactory > xServiceManager(
+-				xContext->getServiceManager(), uno::UNO_QUERY_THROW );
+-		static uno::Reference< beans::XPropertySet > xProps( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.GlobalSheetSettings" ) ) ,xContext ), uno::UNO_QUERY_THROW );
+-		return xProps;
+-	}
+-
+-	bool getReplaceCellsWarning() throw ( uno::RuntimeException )
+-	{
+-		sal_Bool res = sal_False;
+-		getGlobalSheetSettings()->getPropertyValue( REPLACE_CELLS_WARNING ) >>= res;
+-		return ( res == sal_True );
+-	}
+-
+-	void setReplaceCellsWarning( bool bState ) throw ( uno::RuntimeException )
+-	{
+-		getGlobalSheetSettings()->setPropertyValue( REPLACE_CELLS_WARNING, uno::makeAny( bState ) );
+-	}
+-public:
+-	PasteCellsWarningReseter() throw ( uno::RuntimeException )
+-	{
+-		bInitialWarningState = getReplaceCellsWarning();
+-		if ( bInitialWarningState )
+-			setReplaceCellsWarning( false );
+-	}
+-	~PasteCellsWarningReseter()
+-	{
+-		if ( bInitialWarningState )
+-		{
+-			// don't allow dtor to throw
+-			try
+-			{
+-				setReplaceCellsWarning( true );
+-			}
+-			catch ( uno::Exception& /*e*/ ){}
+-		}
+-	}
+-};
+-
+-void
+-dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl, uno::Sequence< beans::PropertyValue >& sProps )
+-{
+-
+-	util::URL  url ;
+-	url.Complete = aUrl;
+-	rtl::OUString emptyString = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" ));
+-	uno::Reference<frame::XController> xController = xModel->getCurrentController();
+-	uno::Reference<frame::XFrame> xFrame = xController->getFrame();
+-	uno::Reference<frame::XDispatchProvider> xDispatchProvider (xFrame,uno::UNO_QUERY_THROW);
+-	try
+-	{
+-		uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+-		uno::Reference<uno::XComponentContext > xContext( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW  );
+-		if ( !xContext.is() )
+-		{
+-			return ;
+-		}
+-
+-		uno::Reference<lang::XMultiComponentFactory > xServiceManager(
+-				xContext->getServiceManager() );
+-		if ( !xServiceManager.is() )
+-		{
+-			return ;
+-		}
+-		uno::Reference<util::XURLTransformer> xParser( xServiceManager->createInstanceWithContext(     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) )
+-			,xContext), uno::UNO_QUERY_THROW );
+-		if (!xParser.is())
+-			return;
+-		xParser->parseStrict (url);
+-	}
+-	catch ( uno::Exception & /*e*/ )
+-	{
+-		return ;
+-	}
+-
+-	uno::Reference<frame::XDispatch> xDispatcher = xDispatchProvider->queryDispatch(url,emptyString,0);
+-
+-	uno::Sequence<beans::PropertyValue> dispatchProps(1);
+-
+-	sal_Int32 nProps = sProps.getLength();
+-	beans::PropertyValue* pDest = dispatchProps.getArray();
+-	if ( nProps )
+-	{
+-		dispatchProps.realloc( nProps + 1 );
+-		// need to reaccquire pDest after realloc
+-		pDest = dispatchProps.getArray();
+-		beans::PropertyValue* pSrc = sProps.getArray();
+-		for ( sal_Int32 index=0; index<nProps; ++index, ++pSrc, ++pDest )
+-			*pDest = *pSrc;
+-	}
+-
+-	(*pDest).Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Silent" ));
+-	(*pDest).Value <<= (sal_Bool)sal_True;
+-
+-	if (xDispatcher.is())
+-		xDispatcher->dispatch( url, dispatchProps );
+-}
+-
+-void
+-dispatchRequests (uno::Reference< frame::XModel>& xModel,rtl::OUString & aUrl) 
+-{
+-	uno::Sequence<beans::PropertyValue> dispatchProps;
+-	dispatchRequests( xModel, aUrl, dispatchProps );
+-}
+-
+-
+-void dispatchExecute(css::uno::Reference< css::frame::XModel>& xModel, USHORT nSlot, SfxCallMode nCall)
+-{
+-	ScTabViewShell* pViewShell = getBestViewShell( xModel );
+-	SfxViewFrame* pViewFrame = NULL;
+-	if ( pViewShell )
+-		pViewFrame = pViewShell->GetViewFrame();
+-	if ( pViewFrame )
+-	{
+-		SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
+-		if( pDispatcher )
+-		{
+-			pDispatcher->Execute( nSlot , nCall );
+-		}
+-	}	
+-}
+-		
+-void
+-implnPaste()
+-{
+-	PasteCellsWarningReseter resetWarningBox;
+-	ScTabViewShell* pViewShell = getCurrentBestViewShell();
+-	if ( pViewShell )
+-	{
+-		pViewShell->PasteFromSystem();
+-		pViewShell->CellContentChanged();
+-	}
+-}
+-
+-
+-void
+-implnCopy()
+-{
+-	ScTabViewShell* pViewShell = getCurrentBestViewShell();
+-	if ( pViewShell )
+-		pViewShell->CopyToClip(NULL,false,false,true);
+-}
+-
+-void 
+-implnCut()
+-{
+-	ScTabViewShell* pViewShell =  getCurrentBestViewShell();
+-	if ( pViewShell )
+-		pViewShell->CutToClip( NULL, TRUE );
+-}
+-
+-void implnPasteSpecial(USHORT nFlags,USHORT nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose)
+-{
+-	PasteCellsWarningReseter resetWarningBox;
+-	sal_Bool bAsLink(sal_False), bOtherDoc(sal_False);
+-	InsCellCmd eMoveMode = INS_NONE;
+-
+-	ScTabViewShell* pTabViewShell = ScTabViewShell::GetActiveViewShell();
+-	if ( !pTabViewShell ) 
+-		// none active, try next best
+-		pTabViewShell = getCurrentBestViewShell();
+-	if ( pTabViewShell )
+-	{
+-		ScViewData* pView = pTabViewShell->GetViewData();	
+-		Window* pWin = ( pView != NULL ) ? pView->GetActiveWin() : NULL;
+-		if ( pView && pWin )
+-		{
+-			if ( bAsLink && bOtherDoc )
+-				pTabViewShell->PasteFromSystem(0);//SOT_FORMATSTR_ID_LINK
+-			else 
+-			{
+-				ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
+-				ScDocument* pDoc = NULL; 
+-				if ( pOwnClip )
+-					pDoc = pOwnClip->GetDocument();	
+-				pTabViewShell->PasteFromClip( nFlags, pDoc,
+-					nFunction, bSkipEmpty, bTranspose, bAsLink,
+-					eMoveMode, IDF_NONE, TRUE );
+-				pTabViewShell->CellContentChanged();
+-			}
+-		}
+-	}
+-
+-}
+-
+- uno::Reference< frame::XModel > 
+-getCurrentDocument() throw (uno::RuntimeException)
+-{
+-	uno::Reference< frame::XModel > xModel;
+-	SbxObject* pBasic = dynamic_cast< SbxObject* > ( SFX_APP()->GetBasic() );
+-	SbxObject* basicChosen =  pBasic ;
+-	if ( basicChosen == NULL)
+-	{
+-		OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" );
+-		return xModel;
+-	}    
+-    SbxObject* p = pBasic;
+-    SbxObject* pParent = p->GetParent();
+-    SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL;
+-
+-    if( pParentParent )
+-    {
+-        basicChosen = pParentParent;
+-    }
+-    else if( pParent )
+-    {
+-        basicChosen = pParent;
+-    }
+-
+-
+-    uno::Any aModel; 
+-    SbxVariable *pCompVar = basicChosen->Find(  UniString(RTL_CONSTASCII_USTRINGPARAM("ThisComponent")), SbxCLASS_OBJECT );
+-
+-	if ( pCompVar )
+-	{
+-		aModel = sbxToUnoValue( pCompVar );
+-		if ( sal_False == ( aModel >>= xModel ) ||
+-			!xModel.is() )
+-		{
+-			// trying last gasp try the current component
+-			uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+-			// test if vba service is present
+-			uno::Reference< uno::XComponentContext > xCtx( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
+-			uno::Reference<lang::XMultiComponentFactory > xSMgr( xCtx->getServiceManager(), uno::UNO_QUERY_THROW );
+-			uno::Reference< frame::XDesktop > xDesktop (xSMgr->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop"), xCtx), uno::UNO_QUERY_THROW );
+-			xModel.set( xDesktop->getCurrentComponent(), uno::UNO_QUERY );
+-			if ( !xModel.is() )
+-			{
+-				throw uno::RuntimeException( 
+-					rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can't extract model from basic ( its obviously not set yet ) therefore don't know the currently selected document") ), uno::Reference< uno::XInterface >() );
+-			}
+-			return xModel;
+-		}
+-		else
+-		{
+-			OSL_TRACE("Have model ThisComponent points to url %s",
+-			::rtl::OUStringToOString( xModel->getURL(),
+-				RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+-		}
+-	}
+-	else
+-	{
+-		OSL_TRACE("Failed to get ThisComponent");
+-		throw uno::RuntimeException( 
+-			rtl::OUString( 
+-				RTL_CONSTASCII_USTRINGPARAM(
+-					"Can't determine the currently selected document") ),
+-			uno::Reference< uno::XInterface >() );
+-	}
+-	return xModel;
+-}
+-
+-ScDocShell* 
+-getDocShell( css::uno::Reference< css::frame::XModel>& xModel ) 
+-{
+-	uno::Reference< uno::XInterface > xIf( xModel, uno::UNO_QUERY_THROW );
+-	ScModelObj* pModel = dynamic_cast< ScModelObj* >( xIf.get() );
+-	ScDocShell* pDocShell = NULL;
+-	if ( pModel )
+-		pDocShell = (ScDocShell*)pModel->GetEmbeddedObject();
+-	return pDocShell;
+-
+-}
+-
+-ScTabViewShell* 
+-getBestViewShell(  css::uno::Reference< css::frame::XModel>& xModel )
+-{
+-	ScDocShell* pDocShell = getDocShell( xModel );
+-	if ( pDocShell )
+-		return pDocShell->GetBestViewShell();
+-	return NULL;
+-}
+-
+-ScTabViewShell* 
+-getCurrentBestViewShell()
+-{ 
+-	uno::Reference< frame::XModel > xModel = getCurrentDocument();
+-	return getBestViewShell( xModel );
+-}
+-
+-SfxViewFrame* 
+-getCurrentViewFrame()
+-{
+-	ScTabViewShell* pViewShell = getCurrentBestViewShell();	
+-	if ( pViewShell )
+-		return pViewShell->GetViewFrame();
+-	return NULL;
+-}
+-
+-sal_Int32 
+-OORGBToXLRGB( sal_Int32 nCol )
+-{
+-	sal_Int32 nRed = nCol;
+-	nRed &= 0x00FF0000;
+-	nRed >>= 16;
+-	sal_Int32 nGreen = nCol;
+-	nGreen &= 0x0000FF00;
+-	nGreen >>= 8;
+-	sal_Int32 nBlue = nCol;
+-	nBlue &= 0x000000FF;
+-	sal_Int32 nRGB =  ( (nBlue << 16) | (nGreen << 8) | nRed );
+-	return nRGB;
+-}
+-sal_Int32 
+-XLRGBToOORGB( sal_Int32 nCol )
+-{
+-	sal_Int32 nBlue = nCol;
+-	nBlue &= 0x00FF0000;
+-	nBlue >>= 16;
+-	sal_Int32 nGreen = nCol;
+-	nGreen &= 0x0000FF00;
+-	nGreen >>= 8;
+-	sal_Int32 nRed = nCol;
+-	nRed &= 0x000000FF;
+-	sal_Int32 nRGB =  ( (nRed << 16) | (nGreen << 8) | nBlue );
+-	return nRGB;
+-}
+-uno::Any 
+-OORGBToXLRGB( const uno::Any& aCol )
+-{
+-	sal_Int32 nCol;
+-	aCol >>= nCol;
+-	nCol = OORGBToXLRGB( nCol );
+-	return uno::makeAny( nCol );
+-}
+-uno::Any 
+-XLRGBToOORGB(  const uno::Any& aCol )
+-{
+-	sal_Int32 nCol;
+-	aCol >>= nCol;
+-	nCol = XLRGBToOORGB( nCol );
+-	return uno::makeAny( nCol );
+-}
+-
+-void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& Copies, const uno::Any& Preview, const uno::Any& /*ActivePrinter*/, const uno::Any& /*PrintToFile*/, const uno::Any& Collate, const uno::Any& PrToFileName, css::uno::Reference< frame::XModel >& xModel, sal_Bool bUseSelection  )
+-{
+-	sal_Int32 nTo = 0;
+-	sal_Int32 nFrom = 0;
+-	sal_Int16 nCopies = 1;
+-	sal_Bool bPreview = sal_False;
+-	sal_Bool bCollate = sal_False;
+-	sal_Bool bSelection = bUseSelection;
+-	From >>= nFrom;
+-	To >>= nTo;
+-	Copies >>= nCopies;
+-	Preview >>= bPreview;
+-	if ( nCopies > 1 ) // Collate only useful when more that 1 copy
+-		Collate >>= bCollate;
+-
+-	rtl::OUString sRange(  RTL_CONSTASCII_USTRINGPARAM( "-" ) );
+-	rtl::OUString sFileName;
+-	
+-	if (( nFrom || nTo ) )
+-	{
+-		if ( nFrom )
+-			sRange = ( ::rtl::OUString::valueOf( nFrom ) + sRange );
+-		if ( nTo )
+-			sRange += ::rtl::OUString::valueOf( nTo );
+-	}
+-
+-	if (  PrToFileName.getValue() )
+-	{
+-		PrToFileName >>= sFileName;
+-	}
+-	ScTabViewShell* pViewShell = getBestViewShell( xModel );
+-	SfxViewFrame* pViewFrame = NULL;
+-	if ( pViewShell )
+-		pViewFrame = pViewShell->GetViewFrame();
+-	if ( pViewFrame )
+-	{
+-		SfxAllItemSet aArgs( SFX_APP()->GetPool() );
+-				
+-		SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate );
+-		aArgs.Put( sfxCollate, sfxCollate.Which() );
+-		SfxInt16Item sfxCopies( SID_PRINT_COPIES, nCopies );
+-		aArgs.Put( sfxCopies, sfxCopies.Which() );
+-		if ( sFileName.getLength() )
+-		{
+-			SfxStringItem sfxFileName( SID_FILE_NAME, sFileName);
+-			aArgs.Put( sfxFileName, sfxFileName.Which() );
+-		
+-		}
+-		if (  sRange.getLength() )
+-		{
+-			SfxStringItem sfxRange( SID_PRINT_PAGES, sRange );
+-			aArgs.Put( sfxRange, sfxRange.Which() );
+-		}
+-		SfxBoolItem sfxSelection( SID_SELECTION, bSelection );
+-		aArgs.Put( sfxSelection, sfxSelection.Which() );
+-		SfxBoolItem sfxAsync( SID_ASYNCHRON, sal_False );
+-		aArgs.Put( sfxAsync, sfxAsync.Which() );
+-		SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
+-
+-		if ( pDispatcher )
+-		{
+-			if ( bPreview )
+-			{
+-				if ( !pViewFrame->GetFrame()->IsInPlace() ) 	
+-				{
+-					SC_MOD()->InputEnterHandler();
+-					pViewFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SFX_CALLMODE_SYNCHRON );
+-					while ( isInPrintPreview( pViewFrame ) )
+-						Application::Yield();
+-				}
+-			}
+-			else
+-				pDispatcher->Execute( (USHORT)SID_PRINTDOC, (SfxCallMode)SFX_CALLMODE_SYNCHRON, aArgs );
+-		}
+-			
+-	}
+-	
+-	// #FIXME #TODO
+-	// 1 ActivePrinter ( how/can we switch a printer via API? )
+-	// 2 PrintToFile ( ms behaviour if this option is specified but no 
+-	//   filename supplied 'PrToFileName' then the user will be prompted )
+-	// 3 Need to check behaviour of Selected sheets with range ( e.g. From & To
+-	//    values ) in oOO these options are mutually exclusive
+-	// 4 There is a pop up to do with transparent objects in the print source
+-	//   should be able to disable that via configuration for the duration
+-	//   of this method
+-}
+-
+- void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, css::uno::Reference< css::frame::XModel >& xModel )
+-{
+-	dispatchExecute( xModel, SID_VIEWSHELL1 );
+-}
+-
+-rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException )
+-{
+-	uno::Type aType = pvargItem.getValueType();
+-	uno::TypeClass eTypeClass = aType.getTypeClass();
+-	rtl::OUString sString;
+-	switch ( eTypeClass )
+-	{
+-		case uno::TypeClass_BOOLEAN:
+-		{
+-			sal_Bool bBool = sal_False;
+-			pvargItem >>= bBool;
+-			sString = rtl::OUString::valueOf( bBool );
+-			break;
+-		}
+-		case uno::TypeClass_STRING:
+-			pvargItem >>= sString;
+-			break;
+-		case uno::TypeClass_FLOAT:
+-			{
+-				float aFloat = 0;
+-				pvargItem >>= aFloat;
+-				sString = rtl::OUString::valueOf( aFloat );
+-				break;
+-			}
+-		case uno::TypeClass_DOUBLE:
+-			{
+-				double aDouble = 0;
+-				pvargItem >>= aDouble;
+-				sString = rtl::OUString::valueOf( aDouble );
+-				break;
+-			}
+-		case uno::TypeClass_SHORT:
+-		case uno::TypeClass_LONG:
+-		case uno::TypeClass_BYTE:
+-			{
+-				sal_Int32 aNum = 0;
+-				pvargItem >>= aNum;
+-				sString = rtl::OUString::valueOf( aNum );
+-				break;
+-			}
+-
+-		case uno::TypeClass_HYPER:
+-			{
+-				sal_Int64 aHyper = 0;
+-				pvargItem >>= aHyper;
+-				sString = rtl::OUString::valueOf( aHyper );
+-				break;
+-			}
+-		default:
+-       			throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid type, can't convert" ), uno::Reference< uno::XInterface >() );
+-	}
+-	return sString;
+-}
+-
+-
+-rtl::OUString 
+-ContainerUtilities::getUniqueName( const uno::Sequence< ::rtl::OUString >&  _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator)
+-{
+-	return getUniqueName(_slist, _sElementName, _sSuffixSeparator, sal_Int32(2));
+-}
+-
+-rtl::OUString 
+-ContainerUtilities::getUniqueName( const uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix)
+-{
+-	sal_Int32 a = _nStartSuffix;
+-	rtl::OUString scompname = _sElementName;
+-	bool bElementexists = true;
+-	sal_Int32 nLen = _slist.getLength();
+-	if ( nLen == 0 )
+-		return _sElementName;
+-
+-	while (bElementexists == true) 
+-	{
+-		for (sal_Int32 i = 0; i < nLen; i++)
+-		{
+-			if (FieldInList(_slist, scompname) == -1)
+-			{
+-				return scompname;
+-			}
+-		}
+-		scompname = _sElementName + _sSuffixSeparator + rtl::OUString::valueOf( a++ );
+-	}
+-	return rtl::OUString();
+-}
+-
+-sal_Int32 
+-ContainerUtilities::FieldInList( const uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString )
+-{
+-	sal_Int32 FieldLen = SearchList.getLength();
+-	sal_Int32 retvalue = -1;
+-	for (sal_Int32 i = 0; i < FieldLen; i++) 
+-	{
+-		// I wonder why comparing lexicographically is done
+-		// when its a match is whats interesting?
+-		//if (SearchList[i].compareTo(SearchString) == 0) 
+-		if ( SearchList[i].equals( SearchString ) ) 
+-		{
+-			retvalue = i;
+-			break;
+-		}
+-	}
+-	return retvalue;
+-
+-}
+-bool NeedEsc(sal_Unicode cCode)
+-{
+-	String sEsc(RTL_CONSTASCII_USTRINGPARAM(".^$+\\|{}()"));
+-	return (STRING_NOTFOUND != sEsc.Search(cCode));
+-}
+-
+-rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike )
+-{
+-	rtl::OUStringBuffer sResult;
+-	const sal_Unicode *start = rIn.getStr();
+-	const sal_Unicode *end = start + rIn.getLength();
+-
+-	int seenright = 0;
+-	if ( bForLike )
+-		sResult.append(static_cast<sal_Unicode>('^'));
+-
+-	while (start < end) 
+-	{
+-		switch (*start)
+-		{
+-			case '?':
+-				sResult.append(static_cast<sal_Unicode>('.'));
+-				start++;
+-				break;
+-			case '*':
+-				sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".*")));
+-				start++;
+-				break;
+-			case '#':
+-				sResult.append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[0-9]")));
+-				start++;
+-				break;
+-			case '~':
+-				sResult.append(static_cast<sal_Unicode>('\\'));
+-				sResult.append(*(++start));
+-				start++;
+-				break;
+-				// dump the ~ and escape the next characture
+-			case ']':
+-				sResult.append(static_cast<sal_Unicode>('\\'));
+-				sResult.append(*start++);
+-				break;
+-			case '[':
+-				sResult.append(*start++);
+-				seenright = 0;
+-				while (start < end && !seenright)
+-				{
+-					switch (*start)
+-					{
+-						case '[':
+-						case '?':
+-						case '*':
+-						sResult.append(static_cast<sal_Unicode>('\\'));
+-						sResult.append(*start);
+-							break;
+-						case ']':
+-						sResult.append(*start);
+-							seenright = 1;
+-							break;
+-						case '!':
+-							sResult.append(static_cast<sal_Unicode>('^'));
+-							break;
+-						default:
+-						if (NeedEsc(*start))
+-							sResult.append(static_cast<sal_Unicode>('\\'));
+-						sResult.append(*start);
+-							break;
+-					}
+-					start++;
+-				}
+-				break;
+-			default:
+-				if (NeedEsc(*start))
+-					sResult.append(static_cast<sal_Unicode>('\\'));
+-				sResult.append(*start++);
+-		}
+-	}
+-
+-	if ( bForLike )
+-		sResult.append(static_cast<sal_Unicode>('$'));
+-
+-	return sResult.makeStringAndClear( );
+-}
+-
+-double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical)
+-{
+-	double fConvertFactor = 1.0;
+-	if( bVertical )
+-	{
+-		fConvertFactor = xDevice->getInfo().PixelPerMeterY/100000;
+-	}
+-	else
+-	{
+-		fConvertFactor = xDevice->getInfo().PixelPerMeterX/100000;	
+-	}
+-	return fConvertFactor;
+-}
+-
+-double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical)
+-{
+-	double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical );
+-	return fPoints * POINTTO100THMILLIMETERFACTOR * fConvertFactor;
+-}
+-double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPixels, sal_Bool bVertical)
+-{
+-	double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical );
+-	return (fPixels/fConvertFactor)/POINTTO100THMILLIMETERFACTOR;
+-}
+-
+-ConcreteXShapeGeometryAttributes::ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape )
+-{
+-	m_xShape = new ScVbaShape( xContext, xShape );
+-}
+-
+-#define VBA_LEFT "PositionX"
+-#define VBA_TOP "PositionY"
+-UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComponentContext >& /*xContext*/, const uno::Reference< awt::XControl >& xControl )
+-{
+-    mxModel.set( xControl->getModel(), uno::UNO_QUERY_THROW );
+-}
+-    double UserFormGeometryHelper::getLeft()
+-    {
+-	sal_Int32 nLeft = 0;
+-	mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft;	
+-	return Millimeter::getInPoints( nLeft );
+-    }
+-    void UserFormGeometryHelper::setLeft( double nLeft )
+-    {
+-        mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nLeft ) ) );
+-    }
+-    double UserFormGeometryHelper::getTop()
+-    {
+-	sal_Int32 nTop = 0;
+-	mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	VBA_TOP ) ) ) >>= nTop;	
+-	return Millimeter::getInPoints( nTop );
+-    }
+-    void UserFormGeometryHelper::setTop( double nTop )
+-    {
+-	mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	VBA_TOP ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nTop ) ) );
+-    }
+-    double UserFormGeometryHelper::getHeight()
+-    {
+-	sal_Int32 nHeight = 0;
+-	mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLHGT ) ) ) >>= nHeight;	
+-	return Millimeter::getInPoints( nHeight );
+-    }
+-    void UserFormGeometryHelper::setHeight( double nHeight )
+-    {
+-	mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLHGT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nHeight ) ) );
+-    }
+-    double UserFormGeometryHelper::getWidth()
+-    {
+-	sal_Int32 nWidth = 0;
+-	mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLWID ) ) ) >>= nWidth;	
+-	return Millimeter::getInPoints( nWidth );
+-    }
+-    void UserFormGeometryHelper::setWidth( double nWidth)
+-    {
+-	mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLWID ) ), uno::makeAny(  Millimeter::getInHundredthsOfOneMillimeter( nWidth ) ) );
+-    }
+-} // openoffice
+-} //org
+diff --git sc/source/ui/vba/vbahelper.hxx sc/source/ui/vba/vbahelper.hxx
+deleted file mode 100644
+index 6ba5f16..0000000
+--- sc/source/ui/vba/vbahelper.hxx
++++ /dev/null
+@@ -1,344 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbahelper.hxx,v $
+- * $Revision: 1.5.32.1 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_HELPER_HXX
+-#define SC_VBA_HELPER_HXX
+-
+-#include <com/sun/star/drawing/XShape.hpp>
+-#include <com/sun/star/beans/XIntrospectionAccess.hpp>
+-#include <com/sun/star/script/BasicErrorException.hpp>
+-#include <com/sun/star/script/XTypeConverter.hpp>
+-#include <com/sun/star/lang/IllegalArgumentException.hpp>
+-#include <com/sun/star/awt/XControl.hpp>
+-#include <com/sun/star/awt/XDevice.hpp>
+-#include <basic/sberrors.hxx>
+-#include <cppuhelper/implbase1.hxx>
+-#include <com/sun/star/frame/XModel.hpp>
+-#include <docsh.hxx>
+-#include <sfx2/dispatch.hxx>
+-#include <ooo/vba/msforms/XShape.hpp>
+-
+-namespace css = ::com::sun::star;
+-
+-namespace ooo 
+-{
+-	namespace vba 
+-	{
+-		template < class T > 
+-		css::uno::Reference< T > getXSomethingFromArgs( css::uno::Sequence< css::uno::Any > const & args, sal_Int32 nPos, bool bCanBeNull = true ) throw (css::lang::IllegalArgumentException)
+-		{
+-			if ( args.getLength() < ( nPos + 1) )
+-				throw css::lang::IllegalArgumentException();
+-			css::uno::Reference< T > aSomething( args[ nPos ], css::uno::UNO_QUERY );
+-			if ( !bCanBeNull && !aSomething.is() )
+-				throw css::lang::IllegalArgumentException();
+-			return aSomething;
+-		}
+-		css::uno::Reference< css::beans::XIntrospectionAccess > getIntrospectionAccess( const css::uno::Any& aObject ) throw (css::uno::RuntimeException);
+-		css::uno::Reference< css::script::XTypeConverter > getTypeConverter( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+-
+-		void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl) ;
+-		void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl, css::uno::Sequence< css::beans::PropertyValue >& sProps ) ;
+-		void dispatchExecute(css::uno::Reference< css::frame::XModel>& xModel, USHORT nSlot, SfxCallMode nCall = SFX_CALLMODE_SYNCHRON );
+-		void implnCopy();
+-		void implnPaste();
+-		void implnCut();
+-		void implnPasteSpecial(sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose);
+-		css::uno::Reference< css::frame::XModel >
+-			getCurrentDocument() throw (css::uno::RuntimeException);
+-		ScTabViewShell* getBestViewShell( css::uno::Reference< css::frame::XModel>& xModel ) ;
+-		ScDocShell* getDocShell( css::uno::Reference< css::frame::XModel>& xModel ) ;
+-		ScTabViewShell* getCurrentBestViewShell();
+-		SfxViewFrame* getCurrentViewFrame();
+-		sal_Int32 OORGBToXLRGB( sal_Int32 );
+-		sal_Int32 XLRGBToOORGB( sal_Int32 );
+-		css::uno::Any OORGBToXLRGB( const css::uno::Any& );
+-		css::uno::Any XLRGBToOORGB( const css::uno::Any& );
+-		// provide a NULL object that can be passed as variant so that 
+-		// the object when passed to IsNull will return true. aNULL 
+-		// contains an empty object reference
+-		const css::uno::Any& aNULL();
+-		void PrintOutHelper( const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, css::uno::Reference< css::frame::XModel >& xModel, sal_Bool bSelection  );
+-		void PrintPreviewHelper( const css::uno::Any& EnableChanges, css::uno::Reference< css::frame::XModel >& xModel );
+-
+-		rtl::OUString getAnyAsString( const css::uno::Any& pvargItem ) throw ( css::uno::RuntimeException );
+-		rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike = false); // needs to be in an uno service ( already this code is duplicated in basic )
+-	double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical);
+-	double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical);
+-	double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical);
+-
+-class Millimeter
+-{
+-//Factor to translate between points and hundredths of millimeters:
+-private:
+-	static const double factor;
+-    
+-	double m_nMillimeter;
+-
+-public:
+-	Millimeter():m_nMillimeter(0) {}
+-    
+-	Millimeter(double mm):m_nMillimeter(mm) {}
+-    
+-	void set(double mm) { m_nMillimeter = mm; }
+-	void setInPoints(double points) 
+-	{ 
+-		m_nMillimeter = points * 0.352777778; 
+-		// 25.4mm / 72 
+-	}
+-      
+-	void setInHundredthsOfOneMillimeter(double hmm)
+-	{
+-		m_nMillimeter = hmm / 100;
+-	}
+-    
+-	double get()
+-	{
+-		return m_nMillimeter;
+-	}
+-	double getInHundredthsOfOneMillimeter()
+-	{
+-		return m_nMillimeter * 100;
+-	}
+-	double getInPoints()
+-	{
+-		return m_nMillimeter * 2.834645669; // 72 / 25.4mm
+-	}    
+-
+-	static sal_Int32 getInHundredthsOfOneMillimeter(double points)
+-	{
+-		sal_Int32 mm = static_cast<sal_Int32>(points * factor);
+-		return mm;
+-	}
+-    
+-	static double getInPoints(int _hmm)
+-	{
+-		double points = double( static_cast<double>(_hmm) / factor);
+-		return points;
+-	}
+-};
+-
+-class AbstractGeometryAttributes // probably should replace the ShapeHelper below
+-{
+-public:
+-    virtual ~AbstractGeometryAttributes() {}
+-    virtual double getLeft() = 0;
+-    virtual void setLeft( double ) = 0;
+-    virtual double getTop() = 0;
+-    virtual void setTop( double ) = 0;
+-    virtual double getHeight() = 0;
+-    virtual void setHeight( double ) = 0;
+-    virtual double getWidth() = 0;
+-    virtual void setWidth( double ) = 0;
+-};
+-
+-class ConcreteXShapeGeometryAttributes : public AbstractGeometryAttributes
+-{
+-public:
+-    css::uno::Reference< ooo::vba::msforms::XShape > m_xShape; 
+-    ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape );
+-    virtual double getLeft()
+-    {
+-        return m_xShape->getLeft();
+-    }
+-    virtual void setLeft( double nLeft )
+-    {
+-        m_xShape->setLeft( nLeft );
+-    }
+-    virtual double getTop()
+-    {
+-        return m_xShape->getTop();
+-    }
+-    virtual void setTop( double nTop )
+-    {
+-        m_xShape->setTop( nTop );
+-    }
+-
+-    virtual double getHeight()
+-    {
+-        return m_xShape->getHeight();
+-    }
+-    virtual void setHeight( double nHeight )
+-    {
+-        m_xShape->setHeight( nHeight );
+-    }
+-    virtual double getWidth()
+-    {
+-        return m_xShape->getWidth();
+-    }
+-    virtual void setWidth( double nWidth)
+-    {
+-        m_xShape->setHeight( nWidth );
+-    }
+-
+-   
+-};
+-#define VBA_LEFT "PositionX"
+-#define VBA_TOP "PositionY"
+-class UserFormGeometryHelper : public AbstractGeometryAttributes
+-{
+-
+-    css::uno::Reference< css::beans::XPropertySet > mxModel;
+-public:
+-    UserFormGeometryHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::awt::XControl >& xControl );
+-    virtual double getLeft();
+-    virtual void setLeft( double nLeft );
+-    virtual double getTop();
+-    virtual void setTop( double nTop );
+-    virtual double getHeight();
+-    virtual void setHeight( double nHeight );
+-    virtual double getWidth();
+-    virtual void setWidth( double nWidth);
+-};
+-
+-class ShapeHelper
+-{
+-protected:
+-	css::uno::Reference< css::drawing::XShape > xShape;
+-public:
+-	ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape) throw (css::script::BasicErrorException ) : xShape( _xShape )
+-	{ 
+-		if( !xShape.is() ) 
+-			throw css::uno::RuntimeException( rtl::OUString::createFromAscii("No valid shape for helper"), css::uno::Reference< css::uno::XInterface >() );
+-	}
+-    
+-	double getHeight()
+-	{
+-        	return  Millimeter::getInPoints(xShape->getSize().Height);
+-    	}
+-
+-
+-    	void setHeight(double _fheight) throw ( css::script::BasicErrorException )
+-	{
+-		try
+-		{
+-			css::awt::Size aSize = xShape->getSize();
+-			aSize.Height = Millimeter::getInHundredthsOfOneMillimeter(_fheight);
+-			xShape->setSize(aSize);
+-		}
+-		catch ( css::uno::Exception& /*e*/)
+-		{
+-			throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
+-    		}
+-	}
+-    
+-    
+-	double getWidth()
+-	{ 
+-		return Millimeter::getInPoints(xShape->getSize().Width);
+-    	}
+-
+-	void setWidth(double _fWidth) throw ( css::script::BasicErrorException )
+-	{
+-		try
+-		{
+-			css::awt::Size aSize = xShape->getSize();
+-			aSize.Width = Millimeter::getInHundredthsOfOneMillimeter(_fWidth);
+-			xShape->setSize(aSize);
+-		}
+-		catch (css::uno::Exception& /*e*/)
+-		{
+-			throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
+-		}
+-	}
+-    
+-    
+-	double getLeft()
+-	{
+-		return Millimeter::getInPoints(xShape->getPosition().X);
+-	}
+-
+-    
+-	void setLeft(double _fLeft)
+-	{
+-		css::awt::Point aPoint = xShape->getPosition();
+-		aPoint.X = Millimeter::getInHundredthsOfOneMillimeter(_fLeft);
+-		xShape->setPosition(aPoint);
+-	}
+-    
+-
+-	double getTop()
+-	{
+-        	return Millimeter::getInPoints(xShape->getPosition().Y);
+-	}
+-
+-    
+-	void setTop(double _fTop)
+-	{
+-		css::awt::Point aPoint = xShape->getPosition();
+-		aPoint.Y = Millimeter::getInHundredthsOfOneMillimeter(_fTop);
+-		xShape->setPosition(aPoint);
+-	}
+-    
+-};
+-
+-class ContainerUtilities
+-{
+-
+-public: 
+-	static rtl::OUString getUniqueName( const css::uno::Sequence< ::rtl::OUString >&  _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator);
+-	static rtl::OUString getUniqueName( const css::uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix );
+-
+-	static sal_Int32 FieldInList( const css::uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString );
+-};
+-
+-// really just a a place holder to ease the porting pain
+-class DebugHelper
+-{
+-public:
+-	static void exception( const rtl::OUString&  DetailedMessage, const css::uno::Exception& ex,  int err, const rtl::OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException )
+-	{
+-		// #TODO #FIXME ( do we want to support additionalArg here )
+-		throw css::script::BasicErrorException( DetailedMessage.concat( rtl::OUString::createFromAscii(" ") ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, rtl::OUString() );
+-	}
+-
+-	static void exception( int err,  const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException )
+-	{
+-		exception( rtl::OUString(), css::uno::Exception(), err, additionalArgument );
+-	}
+-
+-	static void exception( css::uno::Exception& ex ) throw( css::script::BasicErrorException )
+-	{
+-		exception( rtl::OUString(), ex, SbERR_INTERNAL_ERROR, rtl::OUString() );
+-	}
+-};
+-	} // openoffice
+-} // org
+-
+-namespace ov = ooo::vba;
+-
+-#ifdef DEBUG
+-#  define SC_VBA_FIXME(a) OSL_TRACE( a )
+-#  define SC_VBA_STUB() SC_VBA_FIXME(( "%s - stubbed\n", __FUNCTION__ ))
+-#else
+-#  define SC_VBA_FIXME(a)
+-#  define SC_VBA_STUB()
+-#endif
+-
+-#endif
+diff --git sc/source/ui/vba/vbahelperinterface.hxx sc/source/ui/vba/vbahelperinterface.hxx
+deleted file mode 100644
+index 693706e..0000000
+--- sc/source/ui/vba/vbahelperinterface.hxx
++++ /dev/null
+@@ -1,116 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbahelperinterface.hxx,v $
+- * $Revision: 1.3 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_HELPERINTERFACE_HXX
+-#define SC_VBA_HELPERINTERFACE_HXX
+-
+-#include <cppuhelper/implbase1.hxx>
+-#include <ooo/vba/XHelperInterface.hpp>
+-#include "vbahelper.hxx"
+-#include "vbaglobals.hxx"
+-
+-// use this class when you have an a object like
+-// interface  XAnInterface which contains XHelperInterface in its inheritance hierarchy
+-// interface XAnInterface
+-// { 
+-//     interface XHelperInterface;
+-//     [attribute, string] name;
+-// }
+-// or
+-// interface XAnInterface : XHelperInterface;
+-// { 
+-//     [attribute, string] name;
+-// }
+-//
+-// then this class can provide a default implementation of XHelperInterface,
+-// you can use it like this
+-// typedef InheritedHelperInterfaceImpl< XAnInterface > > AnInterfaceImpl_BASE;
+-// class AnInterfaceImpl : public AnInterfaceImpl_BASE
+-// {
+-// public:
+-//     AnInterface( const Reference< HelperInterface >& xParent ) : AnInterfaceImpl_BASE( xParent ) {}
+-//     // implement XAnInterface methods only, no need to implement the XHelperInterface 
+-//     // methods
+-//     virtual void setName( const OUString& );  
+-//     virtual OUString getName();  
+-// }
+-//
+-const ::rtl::OUString sHelperServiceName( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.HelperServiceBase" ) );
+-
+-template< typename Ifc1 >
+-class InheritedHelperInterfaceImpl : public Ifc1
+-{
+-protected: 
+-	css::uno::WeakReference< ov::XHelperInterface > mxParent;
+-	css::uno::Reference< css::uno::XComponentContext > mxContext;
+-public:
+-	InheritedHelperInterfaceImpl() {}
+-	InheritedHelperInterfaceImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : mxParent( xParent ), mxContext( xContext ) {}
+-	virtual rtl::OUString& getServiceImplName() = 0;
+-	virtual css::uno::Sequence<rtl::OUString> getServiceNames() = 0;
+-
+-	// XHelperInterface Methods
+-	virtual ::sal_Int32 SAL_CALL getCreator() throw (css::script::BasicErrorException, css::uno::RuntimeException)
+-	{
+-		return 0x53756E4F;
+-	}
+-	virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return mxParent; }
+-	
+-	virtual css::uno::Any SAL_CALL Application(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return  css::uno::makeAny( ScVbaGlobals::getGlobalsImpl( mxContext )->getApplication() ); }
+-
+-
+-	// XServiceInfo Methods
+-	virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (css::uno::RuntimeException) { return getServiceImplName(); }
+-	virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (css::uno::RuntimeException) 
+-	{ 
+-		css::uno::Sequence< rtl::OUString > sServices = getSupportedServiceNames();
+-		const rtl::OUString* pStart = sServices.getConstArray();
+-		const rtl::OUString* pEnd = pStart + sServices.getLength();
+-		for ( ; pStart != pEnd ; ++pStart )
+-			if ( (*pStart).equals( ServiceName ) )
+-				return sal_True;
+-		return sal_False;	
+-	}
+-	virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (css::uno::RuntimeException) 
+-	{ 
+-		css::uno::Sequence< rtl::OUString > aNames = getServiceNames();;
+-		return aNames;
+-	}
+- };
+-
+-template< typename Ifc1 >
+-class InheritedHelperInterfaceImpl1 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > >
+-
+-{
+-typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > > Base;
+-public:
+-	InheritedHelperInterfaceImpl1< Ifc1 > ( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {}	
+-
+-};
+-#endif
+diff --git sc/source/ui/vba/vbahyperlink.cxx sc/source/ui/vba/vbahyperlink.cxx
+index 4b95eb7..1b30151 100644
+--- sc/source/ui/vba/vbahyperlink.cxx
++++ sc/source/ui/vba/vbahyperlink.cxx
+@@ -32,7 +32,7 @@
+  *    MA  02111-1307  USA
+  *
+  ************************************************************************/
+-#include "helperdecl.hxx"
++#include <vbahelper/helperdecl.hxx>
+ #include "vbahyperlink.hxx"
+ #include <com/sun/star/container/XIndexAccess.hpp>
+ #include <com/sun/star/text/XTextFieldsSupplier.hpp> 
+diff --git sc/source/ui/vba/vbahyperlink.hxx sc/source/ui/vba/vbahyperlink.hxx
+index aad0a87..ee33a33 100644
+--- sc/source/ui/vba/vbahyperlink.hxx
++++ sc/source/ui/vba/vbahyperlink.hxx
+@@ -40,7 +40,7 @@
+ #include <com/sun/star/beans/XPropertySet.hpp>
+ #include <ooo/vba/excel/XRange.hpp>
+ 
+-#include "vbahelperinterface.hxx"
++#include <vbahelper/vbahelperinterface.hxx>
+ 
+ typedef InheritedHelperInterfaceImpl1< ov::excel::XHyperlink > HyperlinkImpl_BASE;
+ 
+diff --git sc/source/ui/vba/vbaimage.cxx sc/source/ui/vba/vbaimage.cxx
+deleted file mode 100644
+index 847a08a..0000000
+--- sc/source/ui/vba/vbaimage.cxx
++++ /dev/null
+@@ -1,59 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile$
+- * $Revision$
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#include "vbaimage.hxx"
+-#include <vector>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-
+-const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+-ScVbaImage::ScVbaImage( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ImageImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+-{
+-}
+-
+-rtl::OUString& 
+-ScVbaImage::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaImage") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaImage::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Image" ) );
+-	}
+-	return aServiceNames;
+-}
+diff --git sc/source/ui/vba/vbaimage.hxx sc/source/ui/vba/vbaimage.hxx
+deleted file mode 100644
+index 2a8ba10..0000000
+--- sc/source/ui/vba/vbaimage.hxx
++++ /dev/null
+@@ -1,48 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile$
+- * $Revision$
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_IMAGE_HXX
+-#define SC_VBA_IMAGE_HXX
+-#include <cppuhelper/implbase1.hxx>
+-#include <ooo/vba/msforms/XImage.hpp>
+-
+-#include "vbacontrol.hxx"
+-#include "vbahelper.hxx"
+-
+-typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XImage > ImageImpl_BASE;
+-
+-class ScVbaImage : public ImageImpl_BASE
+-{
+-public:
+-    ScVbaImage( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper  );
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-};
+-#endif //SC_VBA_IMAGE_HXX
+diff --git sc/source/ui/vba/vbainterior.hxx sc/source/ui/vba/vbainterior.hxx
+index ee8175f..847af6b 100644
+--- sc/source/ui/vba/vbainterior.hxx
++++ sc/source/ui/vba/vbainterior.hxx
+@@ -34,9 +34,10 @@
+ #include <com/sun/star/uno/XComponentContext.hpp>
+ #include <com/sun/star/beans/XPropertySet.hpp>
+ #include <com/sun/star/container/XIndexAccess.hpp>
++#include <com/sun/star/container/XNameContainer.hpp>
+ 
+ #include <com/sun/star/script/XInvocation.hpp>
+-#include "vbahelperinterface.hxx"
++#include <vbahelper/vbahelperinterface.hxx>
+ 
+ class ScDocument;
+ 
+diff --git sc/source/ui/vba/vbalabel.cxx sc/source/ui/vba/vbalabel.cxx
+deleted file mode 100644
+index a5fa3c1..0000000
+--- sc/source/ui/vba/vbalabel.cxx
++++ /dev/null
+@@ -1,88 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbalabel.cxx,v $
+- * $Revision: 1.3 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#include "vbalabel.hxx"
+-#include <vector>
 -
--	if ( bForLike )
--		sResult.append(static_cast<sal_Unicode>('$'));
+-using namespace com::sun::star;
+-using namespace ooo::vba;
 -
--	return sResult.makeStringAndClear( );
+-
+-const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+-ScVbaLabel::ScVbaLabel(  const css::uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : LabelImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+-{
 -}
 -
--double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical)
+-// Attributes
+-rtl::OUString SAL_CALL 
+-ScVbaLabel::getCaption() throw (css::uno::RuntimeException)
 -{
--	double fConvertFactor = 1.0;
--	if( bVertical )
--	{
--		fConvertFactor = xDevice->getInfo().PixelPerMeterY/100000;
--	}
--	else
--	{
--		fConvertFactor = xDevice->getInfo().PixelPerMeterX/100000;	
--	}
--	return fConvertFactor;
+-    rtl::OUString Label;
+-    m_xProps->getPropertyValue( LABEL ) >>= Label;
+-    return Label;
 -}
 -
--double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical)
+-void SAL_CALL 
+-ScVbaLabel::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
 -{
--	double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical );
--	return fPoints * POINTTO100THMILLIMETERFACTOR * fConvertFactor;
+-    m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
 -}
--double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPixels, sal_Bool bVertical)
+-uno::Any SAL_CALL 
+-ScVbaLabel::getValue() throw (css::uno::RuntimeException)
 -{
--	double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical );
--	return (fPixels/fConvertFactor)/POINTTO100THMILLIMETERFACTOR;
+-    return uno::makeAny( getCaption() );
 -}
 -
--ConcreteXShapeGeometryAttributes::ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape )
+-void SAL_CALL 
+-ScVbaLabel::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
 -{
--	m_xShape = new ScVbaShape( xContext, xShape );
+-    rtl::OUString sCaption;
+-    _value >>= sCaption;
+-    setCaption( sCaption ); 
 -}
 -
--#define VBA_LEFT "PositionX"
--#define VBA_TOP "PositionY"
--UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComponentContext >& /*xContext*/, const uno::Reference< awt::XControl >& xControl )
+-
+-rtl::OUString& 
+-ScVbaLabel::getServiceImplName()
 -{
--    mxModel.set( xControl->getModel(), uno::UNO_QUERY_THROW );
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaLabel") );
+-	return sImplName;
 -}
--    double UserFormGeometryHelper::getLeft()
--    {
--	sal_Int32 nLeft = 0;
--	mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft;	
--	return Millimeter::getInPoints( nLeft );
--    }
--    void UserFormGeometryHelper::setLeft( double nLeft )
--    {
--        mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nLeft ) ) );
--    }
--    double UserFormGeometryHelper::getTop()
--    {
--	sal_Int32 nTop = 0;
--	mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	VBA_TOP ) ) ) >>= nTop;	
--	return Millimeter::getInPoints( nTop );
--    }
--    void UserFormGeometryHelper::setTop( double nTop )
--    {
--	mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	VBA_TOP ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nTop ) ) );
--    }
--    double UserFormGeometryHelper::getHeight()
--    {
--	sal_Int32 nHeight = 0;
--	mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLHGT ) ) ) >>= nHeight;	
--	return Millimeter::getInPoints( nHeight );
--    }
--    void UserFormGeometryHelper::setHeight( double nHeight )
--    {
--	mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLHGT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nHeight ) ) );
--    }
--    double UserFormGeometryHelper::getWidth()
--    {
--	sal_Int32 nWidth = 0;
--	mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLWID ) ) ) >>= nWidth;	
--	return Millimeter::getInPoints( nWidth );
--    }
--    void UserFormGeometryHelper::setWidth( double nWidth)
--    {
--	mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 	SC_UNONAME_CELLWID ) ), uno::makeAny(  Millimeter::getInHundredthsOfOneMillimeter( nWidth ) ) );
--    }
--} // openoffice
--} //org
-diff --git sc/source/ui/vba/vbahelper.hxx sc/source/ui/vba/vbahelper.hxx
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaLabel::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Label" ) );
+-	}
+-	return aServiceNames;
+-}
+diff --git sc/source/ui/vba/vbalabel.hxx sc/source/ui/vba/vbalabel.hxx
 deleted file mode 100644
-index 6ba5f16..0000000
---- sc/source/ui/vba/vbahelper.hxx
+index d6846a4..0000000
+--- sc/source/ui/vba/vbalabel.hxx
 +++ /dev/null
-@@ -1,344 +0,0 @@
+@@ -1,56 +0,0 @@
 -/*************************************************************************
 - *
 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -2929,8 +5399,8 @@
 - *
 - * OpenOffice.org - a multi-platform office productivity suite
 - *
-- * $RCSfile: vbahelper.hxx,v $
-- * $Revision: 1.5.32.1 $
+- * $RCSfile: vbalabel.hxx,v $
+- * $Revision: 1.3 $
 - *
 - * This file is part of OpenOffice.org.
 - *
@@ -2950,573 +5420,821 @@
 - * for a copy of the LGPLv3 License.
 - *
 - ************************************************************************/
--#ifndef SC_VBA_HELPER_HXX
--#define SC_VBA_HELPER_HXX
--
--#include <com/sun/star/drawing/XShape.hpp>
--#include <com/sun/star/beans/XIntrospectionAccess.hpp>
--#include <com/sun/star/script/BasicErrorException.hpp>
--#include <com/sun/star/script/XTypeConverter.hpp>
--#include <com/sun/star/lang/IllegalArgumentException.hpp>
--#include <com/sun/star/awt/XControl.hpp>
--#include <com/sun/star/awt/XDevice.hpp>
--#include <basic/sberrors.hxx>
+-#ifndef SC_VBA_LABEL_HXX
+-#define SC_VBA_LABEL_HXX
 -#include <cppuhelper/implbase1.hxx>
--#include <com/sun/star/frame/XModel.hpp>
--#include <docsh.hxx>
--#include <sfx2/dispatch.hxx>
--#include <ooo/vba/msforms/XShape.hpp>
+-#include <ooo/vba/msforms/XLabel.hpp>
 -
--namespace css = ::com::sun::star;
+-#include "vbacontrol.hxx"
+-#include "vbahelper.hxx"
+-#include <cppuhelper/implbase2.hxx>
 -
--namespace ooo 
--{
--	namespace vba 
--	{
--		template < class T > 
--		css::uno::Reference< T > getXSomethingFromArgs( css::uno::Sequence< css::uno::Any > const & args, sal_Int32 nPos, bool bCanBeNull = true ) throw (css::lang::IllegalArgumentException)
--		{
--			if ( args.getLength() < ( nPos + 1) )
--				throw css::lang::IllegalArgumentException();
--			css::uno::Reference< T > aSomething( args[ nPos ], css::uno::UNO_QUERY );
--			if ( !bCanBeNull && !aSomething.is() )
--				throw css::lang::IllegalArgumentException();
--			return aSomething;
--		}
--		css::uno::Reference< css::beans::XIntrospectionAccess > getIntrospectionAccess( const css::uno::Any& aObject ) throw (css::uno::RuntimeException);
--		css::uno::Reference< css::script::XTypeConverter > getTypeConverter( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
+-typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XLabel, css::script::XDefaultProperty  > LabelImpl_BASE;
 -
--		void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl) ;
--		void dispatchRequests (css::uno::Reference< css::frame::XModel>& xModel,rtl::OUString & aUrl, css::uno::Sequence< css::beans::PropertyValue >& sProps ) ;
--		void dispatchExecute(css::uno::Reference< css::frame::XModel>& xModel, USHORT nSlot, SfxCallMode nCall = SFX_CALLMODE_SYNCHRON );
--		void implnCopy();
--		void implnPaste();
--		void implnCut();
--		void implnPasteSpecial(sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose);
--		css::uno::Reference< css::frame::XModel >
--			getCurrentDocument() throw (css::uno::RuntimeException);
--		ScTabViewShell* getBestViewShell( css::uno::Reference< css::frame::XModel>& xModel ) ;
--		ScDocShell* getDocShell( css::uno::Reference< css::frame::XModel>& xModel ) ;
--		ScTabViewShell* getCurrentBestViewShell();
--		SfxViewFrame* getCurrentViewFrame();
--		sal_Int32 OORGBToXLRGB( sal_Int32 );
--		sal_Int32 XLRGBToOORGB( sal_Int32 );
--		css::uno::Any OORGBToXLRGB( const css::uno::Any& );
--		css::uno::Any XLRGBToOORGB( const css::uno::Any& );
--		// provide a NULL object that can be passed as variant so that 
--		// the object when passed to IsNull will return true. aNULL 
--		// contains an empty object reference
--		const css::uno::Any& aNULL();
--		void PrintOutHelper( const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, css::uno::Reference< css::frame::XModel >& xModel, sal_Bool bSelection  );
--		void PrintPreviewHelper( const css::uno::Any& EnableChanges, css::uno::Reference< css::frame::XModel >& xModel );
+-class ScVbaLabel : public LabelImpl_BASE
+-{
+-public:
+-    ScVbaLabel( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper  );
+-   // Attributes
+-    virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-    virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-    // XDefaultProperty
+-    rtl::OUString SAL_CALL getDefaultPropertyName(  ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+-};
+-#endif //SC_VBA_LABEL_HXX
+diff --git sc/source/ui/vba/vbalineformat.hxx sc/source/ui/vba/vbalineformat.hxx
+index edfa47a..a6287e4 100644
+--- sc/source/ui/vba/vbalineformat.hxx
++++ sc/source/ui/vba/vbalineformat.hxx
+@@ -33,7 +33,7 @@
+ #include <com/sun/star/drawing/XShape.hpp>
+ #include <com/sun/star/beans/XPropertySet.hpp>
+ #include <ooo/vba/msforms/XLineFormat.hpp>
+-#include "vbahelperinterface.hxx"
++#include <vbahelper/vbahelperinterface.hxx>
+ 
+ typedef InheritedHelperInterfaceImpl1< ov::msforms::XLineFormat > ScVbaLineFormat_BASE;
+ 
+diff --git sc/source/ui/vba/vbalistbox.cxx sc/source/ui/vba/vbalistbox.cxx
+deleted file mode 100644
+index a0fd7ce..0000000
+--- sc/source/ui/vba/vbalistbox.cxx
++++ /dev/null
+@@ -1,287 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbalistbox.cxx,v $
+- * $Revision: 1.4 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#include <com/sun/star/form/validation/XValidatableFormComponent.hpp>
 -
--		rtl::OUString getAnyAsString( const css::uno::Any& pvargItem ) throw ( css::uno::RuntimeException );
--		rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike = false); // needs to be in an uno service ( already this code is duplicated in basic )
--	double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical);
--	double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical);
--	double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPoints, sal_Bool bVertical);
+-#include "vbalistbox.hxx"
+-#include "vbapropvalue.hxx"
+-#include <vector>
+-#include <comphelper/anytostring.hxx>
+-#include <com/sun/star/script/ArrayWrapper.hpp>
 -
--class Millimeter
--{
--//Factor to translate between points and hundredths of millimeters:
--private:
--	static const double factor;
--    
--	double m_nMillimeter;
+-using namespace com::sun::star;
+-using namespace ooo::vba;
 -
--public:
--	Millimeter():m_nMillimeter(0) {}
--    
--	Millimeter(double mm):m_nMillimeter(mm) {}
--    
--	void set(double mm) { m_nMillimeter = mm; }
--	void setInPoints(double points) 
--	{ 
--		m_nMillimeter = points * 0.352777778; 
--		// 25.4mm / 72 
--	}
--      
--	void setInHundredthsOfOneMillimeter(double hmm)
--	{
--		m_nMillimeter = hmm / 100;
--	}
--    
--	double get()
--	{
--		return m_nMillimeter;
--	}
--	double getInHundredthsOfOneMillimeter()
--	{
--		return m_nMillimeter * 100;
--	}
--	double getInPoints()
--	{
--		return m_nMillimeter * 2.834645669; // 72 / 25.4mm
--	}    
+-const static rtl::OUString TEXT( RTL_CONSTASCII_USTRINGPARAM("Text") );
+-const static rtl::OUString SELECTEDITEMS( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") );
+-const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") );
 -
--	static sal_Int32 getInHundredthsOfOneMillimeter(double points)
--	{
--		sal_Int32 mm = static_cast<sal_Int32>(points * factor);
--		return mm;
--	}
--    
--	static double getInPoints(int _hmm)
--	{
--		double points = double( static_cast<double>(_hmm) / factor);
--		return points;
--	}
--};
 -
--class AbstractGeometryAttributes // probably should replace the ShapeHelper below
+-ScVbaListBox::ScVbaListBox( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ListBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
 -{
--public:
--    virtual ~AbstractGeometryAttributes() {}
--    virtual double getLeft() = 0;
--    virtual void setLeft( double ) = 0;
--    virtual double getTop() = 0;
--    virtual void setTop( double ) = 0;
--    virtual double getHeight() = 0;
--    virtual void setHeight( double ) = 0;
--    virtual double getWidth() = 0;
--    virtual void setWidth( double ) = 0;
--};
+-    mpListHelper.reset( new ListControlHelper( m_xProps ) );
+-}
 -
--class ConcreteXShapeGeometryAttributes : public AbstractGeometryAttributes
+-// Attributes
+-void SAL_CALL 
+-ScVbaListBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeException)
 -{
--public:
--    css::uno::Reference< ooo::vba::msforms::XShape > m_xShape; 
--    ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape );
--    virtual double getLeft()
--    {
--        return m_xShape->getLeft();
--    }
--    virtual void setLeft( double nLeft )
--    {
--        m_xShape->setLeft( nLeft );
--    }
--    virtual double getTop()
--    {
--        return m_xShape->getTop();
+-    sal_Int32 nIndex = 0;
+-    _value >>= nIndex;
+-    Selected( nIndex );
+-}
+-
+-uno::Any SAL_CALL 
+-ScVbaListBox::getListIndex() throw (uno::RuntimeException)
+-{
+-    uno::Sequence< sal_Int16 > sSelection;
+-    m_xProps->getPropertyValue( SELECTEDITEMS ) >>= sSelection;
+-    if ( sSelection.getLength() == 0 )
+-        return uno::Any( sal_Int32( -1 ) );
+-    return uno::Any( sSelection[ 0 ] );
+-}
+-
+-uno::Any SAL_CALL 
+-ScVbaListBox::getValue() throw (uno::RuntimeException)
+-{
+-    uno::Sequence< sal_Int16 > sSelection;
+-    uno::Sequence< rtl::OUString > sItems;
+-    m_xProps->getPropertyValue( SELECTEDITEMS ) >>= sSelection;
+-    m_xProps->getPropertyValue( ITEMS ) >>= sItems;
+-    if( getMultiSelect() )
+-        throw uno::RuntimeException( rtl::OUString::createFromAscii(
+-                    "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
+-    uno::Any aRet;
+-    if ( sSelection.getLength() )
+-        aRet = uno::makeAny( sItems[ sSelection[ 0 ] ] ); 
+-    return aRet;
+-}
+-
+-void SAL_CALL 
+-ScVbaListBox::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
+-{
+-    if( getMultiSelect() )
+-    {	
+-        throw uno::RuntimeException( rtl::OUString::createFromAscii(
+-                    "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
 -    }
--    virtual void setTop( double nTop )
+-    rtl::OUString sValue = getAnyAsString( _value );
+-    uno::Sequence< rtl::OUString > sList;
+-    m_xProps->getPropertyValue( ITEMS ) >>= sList;
+-    uno::Sequence< sal_Int16 > nList;
+-    sal_Int16 nLength = static_cast<sal_Int16>( sList.getLength() );
+-    sal_Int16 nValue = -1;
+-    sal_Int16 i = 0;
+-    for( i = 0; i < nLength; i++ )
 -    {
--        m_xShape->setTop( nTop );
+-        if( sList[i].equals( sValue ) )
+-        {
+-            nValue = i; 
+-            break;
+-        }
 -    }
+-    if( nValue == -1 )
+-        throw uno::RuntimeException( rtl::OUString::createFromAscii(
+-                    "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
+-
+-    uno::Sequence< sal_Int16 > nSelectedIndices(1);
+-    nSelectedIndices[ 0 ] = nValue;
+-    m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nSelectedIndices ) ); 
+-    m_xProps->setPropertyValue( TEXT, uno::makeAny( sValue ) ); 
+-}
 -
--    virtual double getHeight()
--    {
--        return m_xShape->getHeight();
--    }
--    virtual void setHeight( double nHeight )
+-::rtl::OUString SAL_CALL 
+-ScVbaListBox::getText() throw (uno::RuntimeException)
+-{
+-	rtl::OUString result;
+-	getValue() >>= result;
+-	return result;
+-}
+-
+-void SAL_CALL 
+-ScVbaListBox::setText( const ::rtl::OUString& _text ) throw (uno::RuntimeException)
+-{
+-	setValue( uno::makeAny( _text ) ); // seems the same
+-}
+-
+-sal_Bool SAL_CALL 
+-ScVbaListBox::getMultiSelect() throw (css::uno::RuntimeException)
+-{
+-    sal_Bool bMultiSelect = sal_False;
+-    m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ) ) >>= bMultiSelect;
+-    return bMultiSelect;
+-}
+-
+-void SAL_CALL 
+-ScVbaListBox::setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ), uno::makeAny( _multiselect ) );
+-}
+-
+-css::uno::Any SAL_CALL 
+-ScVbaListBox::Selected( sal_Int32 index ) throw (css::uno::RuntimeException)
+-{
+-    uno::Sequence< rtl::OUString > sList;
+-    m_xProps->getPropertyValue( ITEMS ) >>= sList;
+-    sal_Int16 nLength = static_cast< sal_Int16 >( sList.getLength() );
+-    sal_Int16 nIndex( index );
+-    if( nIndex < 0 || nIndex >= nLength )
+-        throw uno::RuntimeException( rtl::OUString::createFromAscii(
+-                    "Error Number." ), uno::Reference< uno::XInterface >() );
+-    m_nIndex = static_cast< sal_Int16 >( index );
+-    return uno::makeAny( uno::Reference< XPropValue > ( new ScVbaPropValue( this ) ) );
+-}
+-
+-// Methods
+-void SAL_CALL 
+-ScVbaListBox::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) throw (uno::RuntimeException)
+-{
+-	mpListHelper->AddItem( pvargItem, pvargIndex );
+-		}
+-
+-void SAL_CALL 
+-ScVbaListBox::removeItem( const uno::Any& index ) throw (uno::RuntimeException)
+-		{
+-	mpListHelper->removeItem( index );
+-		}
+-
+-void SAL_CALL 
+-ScVbaListBox::Clear(  ) throw (uno::RuntimeException)
+-{
+-	mpListHelper->Clear();
+-}
+-
+-// this is called when something like the following vba code is used
+-// to set the selected state of particular entries in the Listbox
+-// ListBox1.Selected( 3 ) = false
+-//PropListener
+-void 
+-ScVbaListBox::setValueEvent( const uno::Any& value )
+-{
+-    sal_Bool bValue = sal_False;
+-    if( !(value >>= bValue) )
+-        throw uno::RuntimeException( rtl::OUString::createFromAscii(
+-                    "Invalid type\n. need boolean." ), uno::Reference< uno::XInterface >() );
+-    uno::Sequence< sal_Int16 > nList;
+-    m_xProps->getPropertyValue( SELECTEDITEMS ) >>= nList;
+-    sal_Int16 nLength = static_cast<sal_Int16>( nList.getLength() );
+-    sal_Int16 nIndex = m_nIndex;
+-    for( sal_Int16 i = 0; i < nLength; i++ )
 -    {
--        m_xShape->setHeight( nHeight );
+-        if( nList[i] == nIndex )
+-        {
+-            if( bValue )
+-                return;
+-            else
+-            {
+-                for( ; i < nLength - 1; i++ )
+-                {
+-                    nList[i] = nList[i + 1];
+-                }
+-                nList.realloc( nLength - 1 );
+-                //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
+-		m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nList ) );
+-                return;
+-            }
+-        }
 -    }
--    virtual double getWidth()
+-    if( bValue )
 -    {
--        return m_xShape->getWidth();
+-        if( getMultiSelect() )
+-        {
+-            nList.realloc( nLength + 1 );
+-            nList[nLength] = nIndex;
+-        }
+-        else
+-        {
+-            nList.realloc( 1 );
+-            nList[0] = nIndex;
+-        }
+-        m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
 -    }
--    virtual void setWidth( double nWidth)
+-}
+-
+-// this is called when something like the following vba code is used
+-// to determine the selected state of particular entries in the Listbox
+-// msgbox ListBox1.Selected( 3 )
+-
+-css::uno::Any 
+-ScVbaListBox::getValueEvent()
+-{
+-    uno::Sequence< sal_Int16 > nList;
+-    m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) ) ) >>= nList;
+-    sal_Int32 nLength = nList.getLength();
+-    sal_Int32 nIndex = m_nIndex;
+-    
+-    for( sal_Int32 i = 0; i < nLength; i++ )
 -    {
--        m_xShape->setHeight( nWidth );
+-        if( nList[i] == nIndex )
+-            return uno::makeAny( sal_True );
 -    }
 -
--   
--};
--#define VBA_LEFT "PositionX"
--#define VBA_TOP "PositionY"
--class UserFormGeometryHelper : public AbstractGeometryAttributes
+-    return uno::makeAny( sal_False );
+-}
+-
+-void SAL_CALL
+-ScVbaListBox::setRowSource( const rtl::OUString& _rowsource ) throw (uno::RuntimeException)
 -{
+-	ScVbaControl::setRowSource( _rowsource );
+-	mpListHelper->setRowSource( _rowsource );
+-}
 -
--    css::uno::Reference< css::beans::XPropertySet > mxModel;
--public:
--    UserFormGeometryHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::awt::XControl >& xControl );
--    virtual double getLeft();
--    virtual void setLeft( double nLeft );
--    virtual double getTop();
--    virtual void setTop( double nTop );
--    virtual double getHeight();
--    virtual void setHeight( double nHeight );
--    virtual double getWidth();
--    virtual void setWidth( double nWidth);
--};
+-sal_Int32 SAL_CALL
+-ScVbaListBox::getListCount() throw (uno::RuntimeException)
+-{
+-	return mpListHelper->getListCount();
+-}
 -
--class ShapeHelper
+-uno::Any SAL_CALL 
+-ScVbaListBox::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn ) throw (uno::RuntimeException)
 -{
--protected:
--	css::uno::Reference< css::drawing::XShape > xShape;
--public:
--	ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xShape) throw (css::script::BasicErrorException ) : xShape( _xShape )
--	{ 
--		if( !xShape.is() ) 
--			throw css::uno::RuntimeException( rtl::OUString::createFromAscii("No valid shape for helper"), css::uno::Reference< css::uno::XInterface >() );
--	}
--    
--	double getHeight()
--	{
--        	return  Millimeter::getInPoints(xShape->getSize().Height);
--    	}
+-	return mpListHelper->List( pvargIndex, pvarColumn );
+-}
 -
+-rtl::OUString& 
+-ScVbaListBox::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaListBox") );
+-	return sImplName;
+-}
 -
--    	void setHeight(double _fheight) throw ( css::script::BasicErrorException )
+-uno::Sequence< rtl::OUString > 
+-ScVbaListBox::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
 -	{
--		try
--		{
--			css::awt::Size aSize = xShape->getSize();
--			aSize.Height = Millimeter::getInHundredthsOfOneMillimeter(_fheight);
--			xShape->setSize(aSize);
--		}
--		catch ( css::uno::Exception& /*e*/)
--		{
--			throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
--    		}
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ScVbaListBox" ) );
 -	}
+-	return aServiceNames;
+-}
+diff --git sc/source/ui/vba/vbalistbox.hxx sc/source/ui/vba/vbalistbox.hxx
+deleted file mode 100644
+index 1848ba6..0000000
+--- sc/source/ui/vba/vbalistbox.hxx
++++ /dev/null
+@@ -1,90 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbalistbox.hxx,v $
+- * $Revision: 1.3 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_LISTBOX_HXX
+-#define SC_VBA_LISTBOX_HXX
+-#include <cppuhelper/implbase2.hxx>
+-#include <com/sun/star/uno/XComponentContext.hpp>
+-#include <com/sun/star/script/XDefaultProperty.hpp>
+-#include <ooo/vba/msforms/XListBox.hpp>
+-#include <com/sun/star/beans/PropertyAttribute.hpp>
+-
+-#include "vbacontrol.hxx"
+-#include "vbapropvalue.hxx"
+-#include "vbalistcontrolhelper.hxx"
+-#include "vbahelper.hxx"
+-
+-typedef cppu::ImplInheritanceHelper2<ScVbaControl, ov::msforms::XListBox, css::script::XDefaultProperty > ListBoxImpl_BASE;
+-class ScVbaListBox : public ListBoxImpl_BASE
+-    ,public PropListener
+-{		
+-	std::auto_ptr< ListControlHelper > mpListHelper;
+-	rtl::OUString sSourceName; 
+-	rtl::OUString msDftPropName;
+-
+-    sal_Int16 m_nIndex;
+-	
+-public:
+-	ScVbaListBox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+-
+-	// Attributes
+-	virtual css::uno::Any SAL_CALL getListIndex() throw (css::uno::RuntimeException);
+-	virtual void SAL_CALL setListIndex( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-	virtual ::sal_Int32 SAL_CALL getListCount() throw (css::uno::RuntimeException);
+-	virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+-	virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-	virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
+-	virtual void SAL_CALL setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException);
+-    virtual sal_Bool SAL_CALL getMultiSelect() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setMultiSelect( sal_Bool _multiselect ) throw (css::uno::RuntimeException);
+-    virtual css::uno::Any SAL_CALL Selected( ::sal_Int32 index ) throw (css::uno::RuntimeException);
+-
+-	// Methods
+-	virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+-	virtual void SAL_CALL Clear(  ) throw (css::uno::RuntimeException);
+-	virtual css::uno::Any SAL_CALL List( const css::uno::Any& pvargIndex, const css::uno::Any& pvarColumn ) throw (css::uno::RuntimeException);
+-	// XControl
+-    virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
+-
+-	// XDefaultProperty
+-    rtl::OUString SAL_CALL getDefaultPropertyName(  ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
 -    
--    
--	double getWidth()
--	{ 
--		return Millimeter::getInPoints(xShape->getSize().Width);
--    	}
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();    
+-
+-    //PropListener
+-    virtual void setValueEvent( const css::uno::Any& value );
+-    virtual css::uno::Any getValueEvent();
 -
--	void setWidth(double _fWidth) throw ( css::script::BasicErrorException )
+-
+-};
+-
+-#endif //
+diff --git sc/source/ui/vba/vbalistcontrolhelper.cxx sc/source/ui/vba/vbalistcontrolhelper.cxx
+deleted file mode 100644
+index 620734a..0000000
+--- sc/source/ui/vba/vbalistcontrolhelper.cxx
++++ /dev/null
+@@ -1,145 +0,0 @@
+-#include <vbalistcontrolhelper.hxx>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-const static rtl::OUString ITEMS( RTL_CONSTASCII_USTRINGPARAM("StringItemList") );
+-
+-void SAL_CALL 
+-ListControlHelper::AddItem( const uno::Any& pvargItem, const uno::Any& pvargIndex ) throw (uno::RuntimeException)
+-{
+-	if ( pvargItem.hasValue()  )
 -	{
--		try
+-		uno::Sequence< rtl::OUString > sList;
+-		m_xProps->getPropertyValue( ITEMS ) >>= sList;
+-
+-		sal_Int32 nIndex = sList.getLength();
+-
+-		if ( pvargIndex.hasValue() )
+-			pvargIndex >>= nIndex;
+-
+-		rtl::OUString sString = getAnyAsString( pvargItem );
+-
+-		// if no index specified or item is to be appended to end of 
+-		// list just realloc the array and set the last item
+-		if ( nIndex  == sList.getLength() )
 -		{
--			css::awt::Size aSize = xShape->getSize();
--			aSize.Width = Millimeter::getInHundredthsOfOneMillimeter(_fWidth);
--			xShape->setSize(aSize);
+-			sal_Int32 nOldSize = sList.getLength();
+-			sList.realloc( nOldSize + 1 );
+-			sList[ nOldSize ] = sString; 
 -		}
--		catch (css::uno::Exception& /*e*/)
+-		else
 -		{
--			throw css::script::BasicErrorException( rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, rtl::OUString() );
+-			// just copy those elements above the one to be inserted
+-			std::vector< rtl::OUString > sVec;
+-			// reserve just the amount we need to copy
+-			sVec.reserve( sList.getLength() - nIndex );
+-
+-			// point at first element to copy
+-			rtl::OUString* pString = sList.getArray() + nIndex;
+-			const rtl::OUString* pEndString = sList.getArray() + sList.getLength();
+-			// insert the new element
+-			sVec.push_back( sString );
+-			// copy elements	
+-			for ( ; pString != pEndString; ++pString )
+-				sVec.push_back( *pString );
+-		
+-			sList.realloc(  sList.getLength() + 1 );
+-
+-			// point at first element to be overwritten
+-			pString = sList.getArray() + nIndex;
+-			pEndString = sList.getArray() + sList.getLength();
+-			std::vector< rtl::OUString >::iterator it = sVec.begin();
+-			for ( ; pString != pEndString; ++pString, ++it)
+-				*pString = *it;	
+-			//
 -		}
--	}
--    
--    
--	double getLeft()
--	{
--		return Millimeter::getInPoints(xShape->getPosition().X);
--	}
 -
--    
--	void setLeft(double _fLeft)
--	{
--		css::awt::Point aPoint = xShape->getPosition();
--		aPoint.X = Millimeter::getInHundredthsOfOneMillimeter(_fLeft);
--		xShape->setPosition(aPoint);
+-		m_xProps->setPropertyValue( ITEMS, uno::makeAny( sList ) );
+-		
 -	}
--    
+-}
 -
--	double getTop()
--	{
--        	return Millimeter::getInPoints(xShape->getPosition().Y);
--	}
+-void SAL_CALL 
+-ListControlHelper::removeItem( const uno::Any& index ) throw (uno::RuntimeException)
+-{
+-    sal_Int32 nIndex = 0;
+-    // for int index
+-	if ( index >>= nIndex  )
+-	{
+-		uno::Sequence< rtl::OUString > sList;
+-		m_xProps->getPropertyValue( ITEMS ) >>= sList;
+-        if( nIndex < 0 || nIndex > ( sList.getLength() - 1 ) )
+-            throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid index" ), uno::Reference< uno::XInterface > () );
+-        if( sList.hasElements() )
+-        {
+-            if( sList.getLength() == 1 )
+-            {
+-                Clear();
+-                return;
+-            }
+-            for( sal_Int32 i = nIndex; i < ( sList.getLength()-1 ); i++ )
+-            {
+-                sList[i] = sList[i+1];
+-            }
+-			sList.realloc(  sList.getLength() - 1 );
+-		}
 -
--    
--	void setTop(double _fTop)
--	{
--		css::awt::Point aPoint = xShape->getPosition();
--		aPoint.Y = Millimeter::getInHundredthsOfOneMillimeter(_fTop);
--		xShape->setPosition(aPoint);
+-		m_xProps->setPropertyValue( ITEMS, uno::makeAny( sList ) );
 -	}
--    
--};
+-}
 -
--class ContainerUtilities
+-void SAL_CALL 
+-ListControlHelper::Clear(  ) throw (uno::RuntimeException)
 -{
+-	// urk, setValue doesn't seem to work !!
+-	//setValue( uno::makeAny( sal_Int16() ) );
+-	m_xProps->setPropertyValue( ITEMS, uno::makeAny( uno::Sequence< rtl::OUString >() ) );
+-}
 -
--public: 
--	static rtl::OUString getUniqueName( const css::uno::Sequence< ::rtl::OUString >&  _slist, const rtl::OUString& _sElementName, const ::rtl::OUString& _sSuffixSeparator);
--	static rtl::OUString getUniqueName( const css::uno::Sequence< rtl::OUString >& _slist, const rtl::OUString _sElementName, const rtl::OUString& _sSuffixSeparator, sal_Int32 _nStartSuffix );
+-void SAL_CALL
+-ListControlHelper::setRowSource( const rtl::OUString& _rowsource ) throw (uno::RuntimeException)
+-{
+-	if ( _rowsource.getLength() == 0 )
+-		Clear();
+-}
+-
+-sal_Int32 SAL_CALL
+-ListControlHelper::getListCount() throw (uno::RuntimeException)
+-{
+-    uno::Sequence< rtl::OUString > sList;
+-    m_xProps->getPropertyValue( ITEMS ) >>= sList;
+-    return sList.getLength();
+-}
+-
+-uno::Any SAL_CALL 
+-ListControlHelper::List( const ::uno::Any& pvargIndex, const uno::Any& pvarColumn ) throw (uno::RuntimeException)
+-{
+-    uno::Sequence< rtl::OUString > sList;
+-    m_xProps->getPropertyValue( ITEMS ) >>= sList;
+-    sal_Int16 nLength = static_cast< sal_Int16 >( sList.getLength() );
+-    uno::Any aRet;
+-    if ( pvargIndex.hasValue() )
+-    {
+-        sal_Int16 nIndex = -1;
+-        pvargIndex >>= nIndex;
+-        if( nIndex < 0 || nIndex >= nLength )
+-            throw uno::RuntimeException( rtl::OUString::createFromAscii(
+-                    "Bad row Index" ), uno::Reference< uno::XInterface >() );       
+-        aRet <<= sList[ nIndex ];
+-    }
+-    else if ( pvarColumn.hasValue() ) // pvarColumn on its own would be bad
+-            throw uno::RuntimeException( rtl::OUString::createFromAscii(
+-                    "Bad column Index" ), uno::Reference< uno::XInterface >() );       
+-    else // List() ( e.g. no args )
+-    {
+-        uno::Sequence< uno::Sequence< rtl::OUString > > sReturnArray( nLength );
+-        for ( sal_Int32 i = 0; i < nLength; ++i )
+-        {
+-            sReturnArray[ i ].realloc( 10 );
+-            sReturnArray[ i ][ 0 ] = sList[ i ];
+-        }        
+-        aRet = uno::makeAny( sReturnArray );
+-    }
+-    return aRet;
+-}
+diff --git sc/source/ui/vba/vbalistcontrolhelper.hxx sc/source/ui/vba/vbalistcontrolhelper.hxx
+deleted file mode 100644
+index 5e4684c..0000000
+--- sc/source/ui/vba/vbalistcontrolhelper.hxx
++++ /dev/null
+@@ -1,20 +0,0 @@
+-#ifndef SC_VBA_LISTCONTROLHELPER
+-#define SC_VBA_LISTCONTROLHELPER
 -
--	static sal_Int32 FieldInList( const css::uno::Sequence< rtl::OUString >& SearchList, const rtl::OUString& SearchString );
--};
+-#include "vbahelper.hxx"
 -
--// really just a a place holder to ease the porting pain
--class DebugHelper
+-class ListControlHelper
 -{
--public:
--	static void exception( const rtl::OUString&  DetailedMessage, const css::uno::Exception& ex,  int err, const rtl::OUString& /*additionalArgument*/ ) throw( css::script::BasicErrorException )
--	{
--		// #TODO #FIXME ( do we want to support additionalArg here )
--		throw css::script::BasicErrorException( DetailedMessage.concat( rtl::OUString::createFromAscii(" ") ).concat( ex.Message ), css::uno::Reference< css::uno::XInterface >(), err, rtl::OUString() );
--	}
+-	css::uno::Reference< css::beans::XPropertySet > m_xProps;
 -
--	static void exception( int err,  const rtl::OUString& additionalArgument ) throw( css::script::BasicErrorException )
--	{
--		exception( rtl::OUString(), css::uno::Exception(), err, additionalArgument );
--	}
+-public:
+-	ListControlHelper( const css::uno::Reference< css::beans::XPropertySet >& rxControl ) : m_xProps( rxControl ){}
 -
--	static void exception( css::uno::Exception& ex ) throw( css::script::BasicErrorException )
--	{
--		exception( rtl::OUString(), ex, SbERR_INTERNAL_ERROR, rtl::OUString() );
--	}
+-	virtual void SAL_CALL AddItem( const css::uno::Any& pvargItem, const css::uno::Any& pvargIndex ) throw (css::uno::RuntimeException);
+-	virtual void SAL_CALL removeItem( const css::uno::Any& index ) throw (css::uno::RuntimeException);   
+-    	virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
+-	virtual ::sal_Int32 SAL_CALL getListCount() throw (css::uno::RuntimeException);
+-	virtual css::uno::Any SAL_CALL List( const css::uno::Any& pvargIndex, const css::uno::Any& pvarColumn ) throw (css::uno::RuntimeException);
+-	virtual void SAL_CALL Clear(  ) throw (css::uno::RuntimeException);
 -};
--	} // openoffice
--} // org
--
--namespace ov = ooo::vba;
--
--#ifdef DEBUG
--#  define SC_VBA_FIXME(a) OSL_TRACE( a )
--#  define SC_VBA_STUB() SC_VBA_FIXME(( "%s - stubbed\n", __FUNCTION__ ))
--#else
--#  define SC_VBA_FIXME(a)
--#  define SC_VBA_STUB()
--#endif
--
 -#endif
-diff --git sc/source/ui/vba/vbahelperinterface.hxx sc/source/ui/vba/vbahelperinterface.hxx
+diff --git sc/source/ui/vba/vbamultipage.cxx sc/source/ui/vba/vbamultipage.cxx
 deleted file mode 100644
-index 693706e..0000000
---- sc/source/ui/vba/vbahelperinterface.hxx
+index 118e005..0000000
+--- sc/source/ui/vba/vbamultipage.cxx
 +++ /dev/null
-@@ -1,116 +0,0 @@
+@@ -1,132 +0,0 @@
 -/*************************************************************************
 - *
-- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- * 
-- * Copyright 2008 by Sun Microsystems, Inc.
+- *  OpenOffice.org - a multi-platform office productivity suite
 - *
-- * OpenOffice.org - a multi-platform office productivity suite
+- *  $RCSfile$
 - *
-- * $RCSfile: vbahelperinterface.hxx,v $
-- * $Revision: 1.3 $
+- *  $Revision$
 - *
-- * This file is part of OpenOffice.org.
+- *  last change: $Author$ $Date$
 - *
-- * OpenOffice.org is free software: you can redistribute it and/or modify
-- * it under the terms of the GNU Lesser General Public License version 3
-- * only, as published by the Free Software Foundation.
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
 - *
-- * OpenOffice.org is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- * GNU Lesser General Public License version 3 for more details
-- * (a copy is included in the LICENSE file that accompanied this code).
 - *
-- * You should have received a copy of the GNU Lesser General Public License
-- * version 3 along with OpenOffice.org.  If not, see
-- * <http://www.openoffice.org/license.html>
-- * for a copy of the LGPLv3 License.
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
 - *
 - ************************************************************************/
--#ifndef SC_VBA_HELPERINTERFACE_HXX
--#define SC_VBA_HELPERINTERFACE_HXX
+-#include "vbamultipage.hxx"
+-#include <ooo/vba/XCollection.hpp>
+-#include "vbapages.hxx"
+-#include <vector>
 -
--#include <cppuhelper/implbase1.hxx>
--#include <ooo/vba/XHelperInterface.hpp>
--#include "vbahelper.hxx"
--#include "vbaglobals.hxx"
+-using namespace com::sun::star;
+-using namespace ooo::vba;
 -
--// use this class when you have an a object like
--// interface  XAnInterface which contains XHelperInterface in its inheritance hierarchy
--// interface XAnInterface
--// { 
--//     interface XHelperInterface;
--//     [attribute, string] name;
--// }
--// or
--// interface XAnInterface : XHelperInterface;
--// { 
--//     [attribute, string] name;
--// }
--//
--// then this class can provide a default implementation of XHelperInterface,
--// you can use it like this
--// typedef InheritedHelperInterfaceImpl< XAnInterface > > AnInterfaceImpl_BASE;
--// class AnInterfaceImpl : public AnInterfaceImpl_BASE
--// {
--// public:
--//     AnInterface( const Reference< HelperInterface >& xParent ) : AnInterfaceImpl_BASE( xParent ) {}
--//     // implement XAnInterface methods only, no need to implement the XHelperInterface 
--//     // methods
--//     virtual void setName( const OUString& );  
--//     virtual OUString getName();  
--// }
--//
--const ::rtl::OUString sHelperServiceName( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.HelperServiceBase" ) );
+-// uno servicename com.sun.star.awt.UnoControlProgressBarMode
+-const rtl::OUString SVALUE( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") );
+-const rtl::OUString SVALUEMAX( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") );
+-const rtl::OUString SSTEP( RTL_CONSTASCII_USTRINGPARAM("Step") );
 -
--template< typename Ifc1 >
--class InheritedHelperInterfaceImpl : public Ifc1
+-typedef cppu::WeakImplHelper1< container::XIndexAccess > PagesImpl_Base;
+-class PagesImpl : public PagesImpl_Base
 -{
--protected: 
--	css::uno::WeakReference< ov::XHelperInterface > mxParent;
--	css::uno::Reference< css::uno::XComponentContext > mxContext;
+-	sal_Int32 mnPages;
 -public:
--	InheritedHelperInterfaceImpl() {}
--	InheritedHelperInterfaceImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : mxParent( xParent ), mxContext( xContext ) {}
--	virtual rtl::OUString& getServiceImplName() = 0;
--	virtual css::uno::Sequence<rtl::OUString> getServiceNames() = 0;
--
--	// XHelperInterface Methods
--	virtual ::sal_Int32 SAL_CALL getCreator() throw (css::script::BasicErrorException, css::uno::RuntimeException)
+-	PagesImpl( sal_Int32 nPages ) : mnPages( nPages ) {}
+-	virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException) { return mnPages; }
+-	virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, ::uno::RuntimeException)
+-	{
+-		if ( Index < 0 || Index > mnPages )
+-			throw lang::IndexOutOfBoundsException();
+-		return uno::makeAny( uno::Reference< uno::XInterface >() );
+-	}
+-	// XElementAccess
+-	virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException)
 -	{
--		return 0x53756E4F;
+-		// no Pages object yet #FIXME
+-		//return msforms::XPage::static_type(0);
+-		return uno::XInterface::static_type(0);
 -	}
--	virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return mxParent; }
--	
--	virtual css::uno::Any SAL_CALL Application(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return  css::uno::makeAny( ScVbaGlobals::getGlobalsImpl( mxContext )->getApplication() ); }
+-	virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException)
+-	{
+-		return ( mnPages > 0 );
+-	}
+-};
+-uno::Reference< container::XIndexAccess > 
+-ScVbaMultiPage::getPages( sal_Int32 nPages )
+-{
+-	return new PagesImpl( nPages );
+-}
 -
+-ScVbaMultiPage::ScVbaMultiPage( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper, const uno::Reference< uno::XInterface >& xDialog ) : MultiPageImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+-{
+-    mxDialogProps.set( xDialog, uno::UNO_QUERY_THROW );
+-    // set dialog step to value of multipage pseudo model
+-    setValue(getValue());
+-}
 -
--	// XServiceInfo Methods
--	virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (css::uno::RuntimeException) { return getServiceImplName(); }
--	virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (css::uno::RuntimeException) 
--	{ 
--		css::uno::Sequence< rtl::OUString > sServices = getSupportedServiceNames();
--		const rtl::OUString* pStart = sServices.getConstArray();
--		const rtl::OUString* pEnd = pStart + sServices.getLength();
--		for ( ; pStart != pEnd ; ++pStart )
--			if ( (*pStart).equals( ServiceName ) )
--				return sal_True;
--		return sal_False;	
--	}
--	virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (css::uno::RuntimeException) 
--	{ 
--		css::uno::Sequence< rtl::OUString > aNames = getServiceNames();;
--		return aNames;
--	}
-- };
+-// Attributes
+-sal_Int32 SAL_CALL 
+-ScVbaMultiPage::getValue() throw (css::uno::RuntimeException)
+-{
+-    sal_Int32 nValue = 0;
+-    m_xProps->getPropertyValue( SVALUE ) >>= nValue;
+-    return nValue;
+-}
+-
+-void SAL_CALL 
+-ScVbaMultiPage::setValue( const sal_Int32 _value ) throw (::com::sun::star::uno::RuntimeException)
+-{
+-    // track change in dialog ( dialog value is 1 based, 0 is a special value )
+-    m_xProps->setPropertyValue( SVALUE, uno::makeAny( _value ) );
+-    mxDialogProps->setPropertyValue( SSTEP, uno::makeAny( _value + 1) );
+-}
 -
--template< typename Ifc1 >
--class InheritedHelperInterfaceImpl1 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > >
 -
+-rtl::OUString& 
+-ScVbaMultiPage::getServiceImplName()
 -{
--typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > > Base;
--public:
--	InheritedHelperInterfaceImpl1< Ifc1 > ( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {}	
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMultiPage") );
+-	return sImplName;
+-}
 -
--};
--#endif
-diff --git sc/source/ui/vba/vbahyperlink.cxx sc/source/ui/vba/vbahyperlink.cxx
-index 4b95eb7..1b30151 100644
---- sc/source/ui/vba/vbahyperlink.cxx
-+++ sc/source/ui/vba/vbahyperlink.cxx
-@@ -32,7 +32,7 @@
-  *    MA  02111-1307  USA
-  *
-  ************************************************************************/
--#include "helperdecl.hxx"
-+#include <vbahelper/helperdecl.hxx>
- #include "vbahyperlink.hxx"
- #include <com/sun/star/container/XIndexAccess.hpp>
- #include <com/sun/star/text/XTextFieldsSupplier.hpp> 
-diff --git sc/source/ui/vba/vbahyperlink.hxx sc/source/ui/vba/vbahyperlink.hxx
-index aad0a87..ee33a33 100644
---- sc/source/ui/vba/vbahyperlink.hxx
-+++ sc/source/ui/vba/vbahyperlink.hxx
-@@ -40,7 +40,7 @@
- #include <com/sun/star/beans/XPropertySet.hpp>
- #include <ooo/vba/excel/XRange.hpp>
- 
--#include "vbahelperinterface.hxx"
-+#include <vbahelper/vbahelperinterface.hxx>
- 
- typedef InheritedHelperInterfaceImpl1< ov::excel::XHyperlink > HyperlinkImpl_BASE;
- 
-diff --git sc/source/ui/vba/vbaimage.hxx sc/source/ui/vba/vbaimage.hxx
-index 2a8ba10..d64f1c3 100644
---- sc/source/ui/vba/vbaimage.hxx
-+++ sc/source/ui/vba/vbaimage.hxx
-@@ -33,7 +33,7 @@
- #include <ooo/vba/msforms/XImage.hpp>
- 
- #include "vbacontrol.hxx"
--#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- 
- typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XImage > ImageImpl_BASE;
- 
-diff --git sc/source/ui/vba/vbainterior.hxx sc/source/ui/vba/vbainterior.hxx
-index ee8175f..847af6b 100644
---- sc/source/ui/vba/vbainterior.hxx
-+++ sc/source/ui/vba/vbainterior.hxx
-@@ -34,9 +34,10 @@
- #include <com/sun/star/uno/XComponentContext.hpp>
- #include <com/sun/star/beans/XPropertySet.hpp>
- #include <com/sun/star/container/XIndexAccess.hpp>
-+#include <com/sun/star/container/XNameContainer.hpp>
- 
- #include <com/sun/star/script/XInvocation.hpp>
--#include "vbahelperinterface.hxx"
-+#include <vbahelper/vbahelperinterface.hxx>
- 
- class ScDocument;
- 
-diff --git sc/source/ui/vba/vbalabel.hxx sc/source/ui/vba/vbalabel.hxx
-index d6846a4..3afd652 100644
---- sc/source/ui/vba/vbalabel.hxx
-+++ sc/source/ui/vba/vbalabel.hxx
-@@ -33,7 +33,7 @@
- #include <ooo/vba/msforms/XLabel.hpp>
- 
- #include "vbacontrol.hxx"
--#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- #include <cppuhelper/implbase2.hxx>
- 
- typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XLabel, css::script::XDefaultProperty  > LabelImpl_BASE;
-diff --git sc/source/ui/vba/vbalineformat.hxx sc/source/ui/vba/vbalineformat.hxx
-index edfa47a..a6287e4 100644
---- sc/source/ui/vba/vbalineformat.hxx
-+++ sc/source/ui/vba/vbalineformat.hxx
-@@ -33,7 +33,7 @@
- #include <com/sun/star/drawing/XShape.hpp>
- #include <com/sun/star/beans/XPropertySet.hpp>
- #include <ooo/vba/msforms/XLineFormat.hpp>
--#include "vbahelperinterface.hxx"
-+#include <vbahelper/vbahelperinterface.hxx>
- 
- typedef InheritedHelperInterfaceImpl1< ov::msforms::XLineFormat > ScVbaLineFormat_BASE;
- 
-diff --git sc/source/ui/vba/vbalistbox.hxx sc/source/ui/vba/vbalistbox.hxx
-index 1848ba6..265f89d 100644
---- sc/source/ui/vba/vbalistbox.hxx
-+++ sc/source/ui/vba/vbalistbox.hxx
-@@ -38,7 +38,7 @@
- #include "vbacontrol.hxx"
- #include "vbapropvalue.hxx"
- #include "vbalistcontrolhelper.hxx"
--#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- 
- typedef cppu::ImplInheritanceHelper2<ScVbaControl, ov::msforms::XListBox, css::script::XDefaultProperty > ListBoxImpl_BASE;
- class ScVbaListBox : public ListBoxImpl_BASE
-diff --git sc/source/ui/vba/vbalistcontrolhelper.cxx sc/source/ui/vba/vbalistcontrolhelper.cxx
-index 620734a..8582821 100644
---- sc/source/ui/vba/vbalistcontrolhelper.cxx
-+++ sc/source/ui/vba/vbalistcontrolhelper.cxx
-@@ -1,4 +1,5 @@
- #include <vbalistcontrolhelper.hxx>
-+#include <vector>
- 
- using namespace com::sun::star;
- using namespace ooo::vba;
-diff --git sc/source/ui/vba/vbalistcontrolhelper.hxx sc/source/ui/vba/vbalistcontrolhelper.hxx
-index 5e4684c..53f369f 100644
---- sc/source/ui/vba/vbalistcontrolhelper.hxx
-+++ sc/source/ui/vba/vbalistcontrolhelper.hxx
-@@ -1,7 +1,7 @@
- #ifndef SC_VBA_LISTCONTROLHELPER
- #define SC_VBA_LISTCONTROLHELPER
- 
--#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- 
- class ListControlHelper
- {
+-uno::Any SAL_CALL 
+-ScVbaMultiPage::Pages( const uno::Any& index ) throw (uno::RuntimeException)
+-{
+-	sal_Int32 nValue = 0;
+-	m_xProps->getPropertyValue( SVALUEMAX ) >>= nValue;
+-	uno::Reference< XCollection > xColl( new ScVbaPages( this, mxContext, getPages( nValue ) ) );
+-	if ( !index.hasValue() )
+-		return uno::makeAny( xColl );
+-	return xColl->Item( uno::makeAny( index ), uno::Any() );
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaMultiPage::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.MultiPage" ) );
+-	}
+-	return aServiceNames;
+-}
 diff --git sc/source/ui/vba/vbamultipage.hxx sc/source/ui/vba/vbamultipage.hxx
-index 3c83d6c..05d0775 100644
+deleted file mode 100644
+index 3c83d6c..0000000
 --- sc/source/ui/vba/vbamultipage.hxx
-+++ sc/source/ui/vba/vbamultipage.hxx
-@@ -39,7 +39,7 @@
- #include <com/sun/star/container/XIndexAccess.hpp>
- 
- #include "vbacontrol.hxx"
++++ /dev/null
+@@ -1,65 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_MULTIPAGE_HXX
+-#define SC_VBA_MULTIPAGE_HXX
+-#include <cppuhelper/implbase1.hxx>
+-#include <ooo/vba/msforms/XMultiPage.hpp>
+-#include <com/sun/star/container/XIndexAccess.hpp>
+-
+-#include "vbacontrol.hxx"
 -#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- //#include <cppuhelper/implbase2.hxx>
- #include <cppuhelper/implbase1.hxx>
- 
+-//#include <cppuhelper/implbase2.hxx>
+-#include <cppuhelper/implbase1.hxx>
+-
+-typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XMultiPage > MultiPageImpl_BASE;
+-
+-class ScVbaMultiPage : public MultiPageImpl_BASE
+-{
+-    css::uno::Reference< css::container::XIndexAccess > getPages( sal_Int32 nPages );
+-    css::uno::Reference< css::beans::XPropertySet > mxDialogProps;
+-public:
+-    ScVbaMultiPage( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper, const css::uno::Reference< css::uno::XInterface >& xDialog );
+-   // Attributes
+-    virtual sal_Int32 SAL_CALL getValue() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setValue( const sal_Int32 _value ) throw (css::uno::RuntimeException);
+-    virtual css::uno::Any SAL_CALL Pages( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+-
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-    // XDefaultProperty
+-    rtl::OUString SAL_CALL getDefaultPropertyName(  ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+-};
+-#endif //SC_VBA_LABEL_HXX
 diff --git sc/source/ui/vba/vbaname.cxx sc/source/ui/vba/vbaname.cxx
 index 3fdc003..3e7b713 100644
 --- sc/source/ui/vba/vbaname.cxx
@@ -3644,30 +6362,162 @@
  typedef CollTestImplHelper< ov::excel::XHPageBreaks > ScVbaHPageBreaks_BASE;
  
 diff --git sc/source/ui/vba/vbapages.cxx sc/source/ui/vba/vbapages.cxx
-index 658bf06..db28086 100644
+deleted file mode 100644
+index 658bf06..0000000
 --- sc/source/ui/vba/vbapages.cxx
-+++ sc/source/ui/vba/vbapages.cxx
-@@ -36,7 +36,6 @@
- 
- using namespace ::ooo::vba;
- using namespace ::com::sun::star;
++++ /dev/null
+@@ -1,81 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#include "vbapages.hxx"
+-
+-using namespace ::ooo::vba;
+-using namespace ::com::sun::star;
 -using namespace ::vos;
- 
- ScVbaPages::ScVbaPages( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xPages ) throw( lang::IllegalArgumentException ) : ScVbaPages_BASE( xParent, xContext, xPages )
- {
+-
+-ScVbaPages::ScVbaPages( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xPages ) throw( lang::IllegalArgumentException ) : ScVbaPages_BASE( xParent, xContext, xPages )
+-{
+-}
+-
+-uno::Type SAL_CALL 
+-ScVbaPages::getElementType() throw (uno::RuntimeException)
+-{
+-	// return msforms::XPage::static_type(0); 
+-	return uno::XInterface::static_type(0); 
+-}
+-
+-uno::Any 
+-ScVbaPages::createCollectionObject( const css::uno::Any& aSource )
+-{
+-	return aSource;
+-}
+-
+-rtl::OUString& 
+-ScVbaPages::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaPages") );
+-	return sImplName;
+-}
+-
+-uno::Reference< container::XEnumeration > SAL_CALL 
+-ScVbaPages::createEnumeration() throw (uno::RuntimeException)
+-{
+-	return uno::Reference< container::XEnumeration >();
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaPages::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msform.Pages" ) );
+-	}
+-	return aServiceNames;
+-}
 diff --git sc/source/ui/vba/vbapages.hxx sc/source/ui/vba/vbapages.hxx
-index 6c7b23e..c1755f5 100644
+deleted file mode 100644
+index 6c7b23e..0000000
 --- sc/source/ui/vba/vbapages.hxx
-+++ sc/source/ui/vba/vbapages.hxx
-@@ -42,7 +42,7 @@
- #include <cppuhelper/implbase2.hxx>
- #include <cppuhelper/implbase1.hxx>
- 
++++ /dev/null
+@@ -1,64 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_PAGES_HXX
+-#define SC_VBA_PAGES_HXX
+-
+-#include <ooo/vba/office/MsoShapeType.hpp>
+-#include <com/sun/star/lang/XEventListener.hpp>
+-#include <com/sun/star/beans/XPropertySet.hpp>
+-#include <ooo/vba/msforms/XPages.hpp>
+-#include <cppuhelper/implbase2.hxx>
+-#include <cppuhelper/implbase1.hxx>
+-
 -#include "vbacollectionimpl.hxx"
-+#include <vbahelper/vbacollectionimpl.hxx>
- typedef CollTestImplHelper< 
- ov::msforms::XPages > ScVbaPages_BASE;
- 
+-typedef CollTestImplHelper< 
+-ov::msforms::XPages > ScVbaPages_BASE;
+-
+-class ScVbaPages : public ScVbaPages_BASE
+-{
+-protected:
+-	virtual rtl::OUString& getServiceImplName();
+-	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-public:
+-    ScVbaPages( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xPages ) throw ( css::lang::IllegalArgumentException );
+-    virtual ~ScVbaPages() {}
+-        // XEnumerationAccess
+-    virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
+-    virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
+-     // ScVbaPages_BASE
+-     virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
+-
+-};
+-#endif//SC_VBA_SHAPE_HXX
 diff --git sc/source/ui/vba/vbapagesetup.cxx sc/source/ui/vba/vbapagesetup.cxx
 index 33d3128..c8974a6 100644
 --- sc/source/ui/vba/vbapagesetup.cxx
@@ -3777,19 +6627,155 @@
  
  
  typedef CollTestImplHelper< ov::excel::XPivotTables > ScVbaPivotTables_BASE;
+diff --git sc/source/ui/vba/vbaprogressbar.cxx sc/source/ui/vba/vbaprogressbar.cxx
+deleted file mode 100644
+index 77f3eca..0000000
+--- sc/source/ui/vba/vbaprogressbar.cxx
++++ /dev/null
+@@ -1,78 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#include "vbaprogressbar.hxx"
+-#include <vector>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-// uno servicename com.sun.star.awt.UnoControlProgressBarMode
+-const rtl::OUString SVALUE( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") );
+-
+-ScVbaProgressBar::ScVbaProgressBar( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ProgressBarImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+-{
+-}
+-
+-// Attributes
+-uno::Any SAL_CALL 
+-ScVbaProgressBar::getValue() throw (css::uno::RuntimeException)
+-{
+-    return m_xProps->getPropertyValue( SVALUE );
+-}
+-
+-void SAL_CALL 
+-ScVbaProgressBar::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( SVALUE,  _value );
+-}
+-
+-rtl::OUString& 
+-ScVbaProgressBar::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaProgressBar") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaProgressBar::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Label" ) );
+-	}
+-	return aServiceNames;
+-}
 diff --git sc/source/ui/vba/vbaprogressbar.hxx sc/source/ui/vba/vbaprogressbar.hxx
-index d040f08..86cbae4 100644
+deleted file mode 100644
+index d040f08..0000000
 --- sc/source/ui/vba/vbaprogressbar.hxx
-+++ sc/source/ui/vba/vbaprogressbar.hxx
-@@ -38,7 +38,7 @@
- #include <ooo/vba/msforms/XProgressBar.hpp>
- 
- #include "vbacontrol.hxx"
++++ /dev/null
+@@ -1,59 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_PROGRESSBAR_HXX
+-#define SC_VBA_PROGRESSBAR_HXX
+-#include <cppuhelper/implbase1.hxx>
+-#include <ooo/vba/msforms/XProgressBar.hpp>
+-
+-#include "vbacontrol.hxx"
 -#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- #include <cppuhelper/implbase2.hxx>
- 
- typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XProgressBar, css::script::XDefaultProperty  > ProgressBarImpl_BASE;
+-#include <cppuhelper/implbase2.hxx>
+-
+-typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XProgressBar, css::script::XDefaultProperty  > ProgressBarImpl_BASE;
+-
+-class ScVbaProgressBar : public ProgressBarImpl_BASE
+-{
+-public:
+-    ScVbaProgressBar( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+-   // Attributes
+-    virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-    // XDefaultProperty
+-    rtl::OUString SAL_CALL getDefaultPropertyName(  ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+-};
+-#endif //SC_VBA_LABEL_HXX
 diff --git sc/source/ui/vba/vbapropvalue.hxx sc/source/ui/vba/vbapropvalue.hxx
 index d7ca6ad..cd566e8 100644
 --- sc/source/ui/vba/vbapropvalue.hxx
@@ -3803,19 +6789,180 @@
  
  typedef ::cppu::WeakImplHelper1< ov::XPropValue > PropValueImpl_BASE;
  
+diff --git sc/source/ui/vba/vbaradiobutton.cxx sc/source/ui/vba/vbaradiobutton.cxx
+deleted file mode 100644
+index 5aa9d20..0000000
+--- sc/source/ui/vba/vbaradiobutton.cxx
++++ /dev/null
+@@ -1,107 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbaradiobutton.cxx,v $
+- * $Revision: 1.3 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#include "vbaradiobutton.hxx"
+-#include <vector>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-
+-const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+-const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") );
+-ScVbaRadioButton::ScVbaRadioButton( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : RadioButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+-{
+-}
+-
+-// Attributes
+-rtl::OUString SAL_CALL 
+-ScVbaRadioButton::getCaption() throw (css::uno::RuntimeException)
+-{
+-    rtl::OUString Label;
+-    m_xProps->getPropertyValue( LABEL ) >>= Label;
+-    return Label;
+-}
+-
+-void SAL_CALL 
+-ScVbaRadioButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+-}
+-
+-uno::Any SAL_CALL 
+-ScVbaRadioButton::getValue() throw (css::uno::RuntimeException)
+-{
+-    sal_Int16 nValue = -1;
+-    m_xProps->getPropertyValue( STATE ) >>= nValue;
+-    if( nValue != 0 )
+-        nValue = -1;
+-//    return uno::makeAny( nValue ); 
+-// I must be missing something MSO says value should be -1 if selected, 0 if not
+-// selected
+-    return uno::makeAny( ( nValue == -1 ) ? sal_True : sal_False ); 
+-
+-}
+-
+-void SAL_CALL 
+-ScVbaRadioButton::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
+-{
+-    sal_Int16 nValue = 0;
+-    sal_Bool bValue = sal_False;
+-    if( _value >>= nValue )
+-    {
+-        if( nValue == -1)
+-        nValue = 1;
+-    }
+-    else if ( _value >>= bValue )
+-    {
+-        if ( bValue )
+-            nValue = 1;
+-    }
+-    m_xProps->setPropertyValue( STATE, uno::makeAny( nValue ) );
+-}
+-
+-rtl::OUString& 
+-ScVbaRadioButton::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaRadioButton") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaRadioButton::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.RadioButton" ) );
+-	}
+-	return aServiceNames;
+-}
 diff --git sc/source/ui/vba/vbaradiobutton.hxx sc/source/ui/vba/vbaradiobutton.hxx
-index 7203aed..9a09dff 100644
+deleted file mode 100644
+index 7203aed..0000000
 --- sc/source/ui/vba/vbaradiobutton.hxx
-+++ sc/source/ui/vba/vbaradiobutton.hxx
-@@ -31,7 +31,7 @@
- #define SC_VBA_RADIOBUTTON_HXX
- #include <ooo/vba/msforms/XRadioButton.hpp>
- #include "vbacontrol.hxx"
++++ /dev/null
+@@ -1,55 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbaradiobutton.hxx,v $
+- * $Revision: 1.3 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_RADIOBUTTON_HXX
+-#define SC_VBA_RADIOBUTTON_HXX
+-#include <ooo/vba/msforms/XRadioButton.hpp>
+-#include "vbacontrol.hxx"
 -#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- #include <cppuhelper/implbase2.hxx>
- 
- typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XRadioButton, css::script::XDefaultProperty > RadioButtonImpl_BASE;
+-#include <cppuhelper/implbase2.hxx>
+-
+-typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XRadioButton, css::script::XDefaultProperty > RadioButtonImpl_BASE;
+-
+-class ScVbaRadioButton : public RadioButtonImpl_BASE
+-{
+-public:
+-    ScVbaRadioButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+-   // Attributes
+-    virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+-    virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setValue(const com::sun::star::uno::Any&) throw (css::uno::RuntimeException);
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-    // XDefaultProperty
+-    rtl::OUString SAL_CALL getDefaultPropertyName(  ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+-
+-};
+-#endif //SC_VBA_RADIOBUTTON_HXX
 diff --git sc/source/ui/vba/vbarange.cxx sc/source/ui/vba/vbarange.cxx
 index 6b510ff..e243410 100644
 --- sc/source/ui/vba/vbarange.cxx
@@ -3868,19 +7015,223 @@
  
  //typedef InheritedHelperInterfaceImpl1< ov::excel::XRange >  ScVbaRange_BASE;
  typedef ScVbaFormat< ov::excel::XRange > ScVbaRange_BASE;
+diff --git sc/source/ui/vba/vbascrollbar.cxx sc/source/ui/vba/vbascrollbar.cxx
+deleted file mode 100644
+index e754903..0000000
+--- sc/source/ui/vba/vbascrollbar.cxx
++++ /dev/null
+@@ -1,139 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#include "vbascrollbar.hxx"
+-#include <vector>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-
+-const static rtl::OUString LARGECHANGE( RTL_CONSTASCII_USTRINGPARAM("BlockIncrement") );
+-const static rtl::OUString SMALLCHANGE( RTL_CONSTASCII_USTRINGPARAM("LineIncrement") );
+-const static rtl::OUString ORIENTATION( RTL_CONSTASCII_USTRINGPARAM("Orientation") );
+-const static rtl::OUString SCROLLVALUE( RTL_CONSTASCII_USTRINGPARAM("ScrollValue") );
+-const static rtl::OUString SCROLLMAX( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMax") );
+-const static rtl::OUString SCROLLMIN( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMin") );
+-
+-ScVbaScrollBar::ScVbaScrollBar(  const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ScrollBarImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+-{
+-}
+-
+-// Attributes
+-uno::Any SAL_CALL 
+-ScVbaScrollBar::getValue() throw (css::uno::RuntimeException)
+-{
+-    return  m_xProps->getPropertyValue( SCROLLVALUE );
+-}
+-
+-void SAL_CALL 
+-ScVbaScrollBar::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( SCROLLVALUE, _value );
+-}
+-
+-::sal_Int32 SAL_CALL 
+-ScVbaScrollBar::getMax() throw (uno::RuntimeException)
+-{
+-    sal_Int32 nMax = 0;
+-    m_xProps->getPropertyValue( SCROLLMAX ) >>= nMax;
+-    return nMax;
+-}
+-
+-void SAL_CALL 
+-ScVbaScrollBar::setMax( sal_Int32 nVal ) throw (uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( SCROLLMAX, uno::makeAny( nVal ) ); 
+-}
+-
+-::sal_Int32 SAL_CALL 
+-ScVbaScrollBar::getMin() throw (uno::RuntimeException)
+-{
+-    sal_Int32 nVal = 0;
+-    m_xProps->getPropertyValue( SCROLLMIN ) >>= nVal;
+-    return nVal;
+-}
+-
+-void SAL_CALL 
+-ScVbaScrollBar::setMin( sal_Int32 nVal ) throw (uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( SCROLLMIN, uno::makeAny( nVal ) ); 
+-}
+-
+-void SAL_CALL 
+-ScVbaScrollBar::setLargeChange( ::sal_Int32 _largechange ) throw (uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( LARGECHANGE, uno::makeAny( _largechange ) );
+-}
+-
+-::sal_Int32 SAL_CALL 
+-ScVbaScrollBar::getLargeChange() throw (uno::RuntimeException)
+-{
+-    sal_Int32 nVal = 0;
+-    m_xProps->getPropertyValue( LARGECHANGE ) >>= nVal;
+-    return nVal;
+-}
+-
+-::sal_Int32 SAL_CALL 
+-ScVbaScrollBar::getSmallChange() throw (uno::RuntimeException)
+-{
+-    sal_Int32 nSmallChange = 0;
+-    m_xProps->getPropertyValue( SMALLCHANGE ) >>= nSmallChange;
+-    return nSmallChange;
+-}
+-
+-void SAL_CALL 
+-ScVbaScrollBar::setSmallChange( ::sal_Int32 _smallchange ) throw (uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( SMALLCHANGE, uno::makeAny( _smallchange ) );
+-}
+-
+-rtl::OUString& 
+-ScVbaScrollBar::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaScrollBar") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaScrollBar::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) );
+-	}
+-	return aServiceNames;
+-}
 diff --git sc/source/ui/vba/vbascrollbar.hxx sc/source/ui/vba/vbascrollbar.hxx
-index 04c4853..459f610 100644
+deleted file mode 100644
+index 04c4853..0000000
 --- sc/source/ui/vba/vbascrollbar.hxx
-+++ sc/source/ui/vba/vbascrollbar.hxx
-@@ -38,7 +38,7 @@
- #include <ooo/vba/msforms/XScrollBar.hpp>
- 
- #include "vbacontrol.hxx"
++++ /dev/null
+@@ -1,66 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_SCROLLBAR_HXX
+-#define SC_VBA_SCROLLBAR_HXX
+-#include <cppuhelper/implbase1.hxx>
+-#include <ooo/vba/msforms/XScrollBar.hpp>
+-
+-#include "vbacontrol.hxx"
 -#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- 
- typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XScrollBar > ScrollBarImpl_BASE;
- 
+-
+-typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XScrollBar > ScrollBarImpl_BASE;
+-
+-class ScVbaScrollBar : public ScrollBarImpl_BASE
+-{
+-public:
+-    ScVbaScrollBar( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper  );
+-   // Attributes
+-    virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-    virtual ::sal_Int32 SAL_CALL getMax() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setMax( ::sal_Int32 _max ) throw (css::uno::RuntimeException);
+-    virtual ::sal_Int32 SAL_CALL getMin() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setMin( ::sal_Int32 _min ) throw (css::uno::RuntimeException);
+-    virtual ::sal_Int32 SAL_CALL getLargeChange() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setLargeChange( ::sal_Int32 _largechange ) throw (css::uno::RuntimeException);
+-    virtual ::sal_Int32 SAL_CALL getSmallChange() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setSmallChange( ::sal_Int32 _smallchange ) throw (css::uno::RuntimeException);
+-
+-
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-};
+-#endif //SC_VBA_LABEL_HXX
 diff --git sc/source/ui/vba/vbaseriescollection.hxx sc/source/ui/vba/vbaseriescollection.hxx
 index 52c57e6..48450ac 100644
 --- sc/source/ui/vba/vbaseriescollection.hxx
@@ -3964,19 +7315,188 @@
  
  typedef CollTestImplHelper< ov::msforms::XShapes > ScVbaShapes_BASE;
  
+diff --git sc/source/ui/vba/vbaspinbutton.cxx sc/source/ui/vba/vbaspinbutton.cxx
+deleted file mode 100644
+index 05b6777..0000000
+--- sc/source/ui/vba/vbaspinbutton.cxx
++++ /dev/null
+@@ -1,109 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#include "vbaspinbutton.hxx"
+-#include <vector>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-
+-const static rtl::OUString ORIENTATION( RTL_CONSTASCII_USTRINGPARAM("Orientation") );
+-const static rtl::OUString SPINVALUE( RTL_CONSTASCII_USTRINGPARAM("SpinValue") );
+-const static rtl::OUString SPINMAX( RTL_CONSTASCII_USTRINGPARAM("SpinValueMax") );
+-const static rtl::OUString SPINMIN( RTL_CONSTASCII_USTRINGPARAM("SpinValueMin") );
+-
+-ScVbaSpinButton::ScVbaSpinButton(  const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : SpinButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+-{
+-}
+-
+-// Attributes
+-uno::Any SAL_CALL 
+-ScVbaSpinButton::getValue() throw (css::uno::RuntimeException)
+-{
+-    return  m_xProps->getPropertyValue( SPINVALUE );
+-}
+-
+-void SAL_CALL 
+-ScVbaSpinButton::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( SPINVALUE, _value );
+-}
+-
+-::sal_Int32 SAL_CALL 
+-ScVbaSpinButton::getMax() throw (uno::RuntimeException)
+-{
+-    sal_Int32 nMax = 0;
+-    m_xProps->getPropertyValue( SPINMAX ) >>= nMax;
+-    return nMax;
+-}
+-
+-void SAL_CALL 
+-ScVbaSpinButton::setMax( sal_Int32 nVal ) throw (uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( SPINMAX, uno::makeAny( nVal ) ); 
+-}
+-
+-::sal_Int32 SAL_CALL 
+-ScVbaSpinButton::getMin() throw (uno::RuntimeException)
+-{
+-    sal_Int32 nVal = 0;
+-    m_xProps->getPropertyValue( SPINMIN ) >>= nVal;
+-    return nVal;
+-}
+-
+-void SAL_CALL 
+-ScVbaSpinButton::setMin( sal_Int32 nVal ) throw (uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( SPINMIN, uno::makeAny( nVal ) ); 
+-}
+-
+-rtl::OUString& 
+-ScVbaSpinButton::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaSpinButton") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaSpinButton::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) );
+-	}
+-	return aServiceNames;
+-}
 diff --git sc/source/ui/vba/vbaspinbutton.hxx sc/source/ui/vba/vbaspinbutton.hxx
-index 338d71f..8f1d6e3 100644
+deleted file mode 100644
+index 338d71f..0000000
 --- sc/source/ui/vba/vbaspinbutton.hxx
-+++ sc/source/ui/vba/vbaspinbutton.hxx
-@@ -38,7 +38,7 @@
- #include <ooo/vba/msforms/XSpinButton.hpp>
- 
- #include "vbacontrol.hxx"
++++ /dev/null
+@@ -1,61 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_SPINBUTTON_HXX
+-#define SC_VBA_SPINBUTTON_HXX
+-#include <cppuhelper/implbase1.hxx>
+-#include <ooo/vba/msforms/XSpinButton.hpp>
+-
+-#include "vbacontrol.hxx"
 -#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- 
- typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XSpinButton > SpinButtonImpl_BASE;
- 
+-
+-typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XSpinButton > SpinButtonImpl_BASE;
+-
+-class ScVbaSpinButton : public SpinButtonImpl_BASE
+-{
+-public:
+-    ScVbaSpinButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper  );
+-   // Attributes
+-    virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-    virtual ::sal_Int32 SAL_CALL getMax() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setMax( ::sal_Int32 _max ) throw (css::uno::RuntimeException);
+-    virtual ::sal_Int32 SAL_CALL getMin() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setMin( ::sal_Int32 _min ) throw (css::uno::RuntimeException);
+-
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-};
+-#endif //SC_VBA_SPINBUTTON_HXX
 diff --git sc/source/ui/vba/vbastyles.cxx sc/source/ui/vba/vbastyles.cxx
 index 253cd8c..2404c5e 100644
 --- sc/source/ui/vba/vbastyles.cxx
@@ -4002,19 +7522,212 @@
  
  typedef CollTestImplHelper< ov::excel::XStyles > ScVbaStyles_BASE;
  class ScVbaStyles: public ScVbaStyles_BASE
+diff --git sc/source/ui/vba/vbatextbox.cxx sc/source/ui/vba/vbatextbox.cxx
+deleted file mode 100644
+index d246970..0000000
+--- sc/source/ui/vba/vbatextbox.cxx
++++ /dev/null
+@@ -1,137 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbatextbox.cxx,v $
+- * $Revision: 1.3 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#include <com/sun/star/text/XTextRange.hpp>
+-
+-#include "vbatextbox.hxx"
+-#include <vector>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-
+-
+-ScVbaTextBox::ScVbaTextBox( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper, bool bDialog ) : TextBoxImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ), mbDialog( bDialog )
+-{
+-}
+-
+-// Attributes
+-uno::Any SAL_CALL 
+-ScVbaTextBox::getValue() throw (css::uno::RuntimeException)
+-{
+-	return uno::makeAny( getText() );
+-}
+-
+-void SAL_CALL 
+-ScVbaTextBox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeException)
+-{
+-	rtl::OUString sVal = getAnyAsString( _value );
+-	setText( sVal );
+-}
+-
+-//getString() will cause some imfo lose.
+-rtl::OUString SAL_CALL 
+-ScVbaTextBox::getText() throw (css::uno::RuntimeException)
+-{
+-    uno::Any aValue;
+-    aValue = m_xProps->getPropertyValue
+-            (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) ) );
+-    rtl::OUString sString;
+-    aValue >>= sString;
+-    return sString;
+-}
+-
+-void SAL_CALL 
+-ScVbaTextBox::setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException)
+-{
+-    if ( !mbDialog )
+-    {
+-    uno::Reference< text::XTextRange > xTextRange( m_xProps, uno::UNO_QUERY_THROW );
+-    xTextRange->setString( _text );
+-}
+-    else
+-        m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), uno::makeAny( _text ) ); 
+-}
+-
+-sal_Int32 SAL_CALL 
+-ScVbaTextBox::getMaxLength() throw (css::uno::RuntimeException)
+-{
+-    uno::Any aValue;
+-    aValue = m_xProps->getPropertyValue
+-            (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxTextLen" ) ) );
+-    sal_Int32 nMaxLength = 0;
+-    aValue >>= nMaxLength;
+-    return nMaxLength;
+-}
+-
+-void SAL_CALL 
+-ScVbaTextBox::setMaxLength( sal_Int32 _maxlength ) throw (css::uno::RuntimeException)
+-{
+-    uno::Any aValue( _maxlength );
+-    m_xProps->setPropertyValue
+-            (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MaxTextLen" ) ), aValue);
+-}
+-
+-sal_Bool SAL_CALL 
+-ScVbaTextBox::getMultiline() throw (css::uno::RuntimeException)
+-{
+-    uno::Any aValue;
+-    aValue = m_xProps->getPropertyValue
+-            (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ) );
+-    sal_Bool bRet = false;
+-    aValue >>= bRet;
+-    return bRet;
+-}
+-
+-void SAL_CALL 
+-ScVbaTextBox::setMultiline( sal_Bool _multiline ) throw (css::uno::RuntimeException)
+-{
+-    uno::Any aValue( _multiline );
+-    m_xProps->setPropertyValue
+-            (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ), aValue);
+-}
+-
+-rtl::OUString& 
+-ScVbaTextBox::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaTextBox") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaTextBox::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.TextBox" ) );
+-	}
+-	return aServiceNames;
+-}
 diff --git sc/source/ui/vba/vbatextbox.hxx sc/source/ui/vba/vbatextbox.hxx
-index 5767251..3abe491 100644
+deleted file mode 100644
+index 5767251..0000000
 --- sc/source/ui/vba/vbatextbox.hxx
-+++ sc/source/ui/vba/vbatextbox.hxx
-@@ -32,7 +32,7 @@
- #include <cppuhelper/implbase1.hxx>
- #include <ooo/vba/msforms/XTextBox.hpp>
- #include "vbacontrol.hxx"
++++ /dev/null
+@@ -1,57 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile: vbatextbox.hxx,v $
+- * $Revision: 1.3 $
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_TEXTBOX_HXX
+-#define SC_VBA_TEXTBOX_HXX
+-#include <cppuhelper/implbase1.hxx>
+-#include <ooo/vba/msforms/XTextBox.hpp>
+-#include "vbacontrol.hxx"
 -#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- 
- typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XTextBox > TextBoxImpl_BASE;
- 
+-
+-typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XTextBox > TextBoxImpl_BASE;
+-
+-class ScVbaTextBox : public TextBoxImpl_BASE
+-{
+-    bool mbDialog;
+-public:
+-    ScVbaTextBox( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper, bool bDialog = false );
+-   // Attributes
+-    virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-    virtual rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException);
+-    virtual sal_Int32 SAL_CALL getMaxLength() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setMaxLength( sal_Int32 _maxlength ) throw (css::uno::RuntimeException);
+-    virtual sal_Bool SAL_CALL getMultiline() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setMultiline( sal_Bool _multiline ) throw (css::uno::RuntimeException);
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-};
+-#endif //SC_VBA_TEXTBOX_HXX
 diff --git sc/source/ui/vba/vbatextboxshape.hxx sc/source/ui/vba/vbatextboxshape.hxx
 index 8a3b62b..c923329 100644
 --- sc/source/ui/vba/vbatextboxshape.hxx
@@ -4056,66 +7769,507 @@
  #include "vbainterior.hxx"
  #include "vbafont.hxx"
  #include "vbapalette.hxx"
+diff --git sc/source/ui/vba/vbatogglebutton.cxx sc/source/ui/vba/vbatogglebutton.cxx
+deleted file mode 100644
+index f938ad1..0000000
+--- sc/source/ui/vba/vbatogglebutton.cxx
++++ /dev/null
+@@ -1,108 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#include "vbatogglebutton.hxx"
+-#include <vector>
+-
+-using namespace com::sun::star;
+-using namespace ooo::vba;
+-
+-
+-const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
+-const static rtl::OUString TOGGLE( RTL_CONSTASCII_USTRINGPARAM("Toggle") );
+-const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") );
+-ScVbaToggleButton::ScVbaToggleButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : ToggleButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
+-{
+-    OSL_TRACE("ScVbaToggleButton(ctor)");
+-    m_xProps->setPropertyValue( TOGGLE, uno::makeAny( sal_True ) );
+-}
+-
+-ScVbaToggleButton::~ScVbaToggleButton()
+-{
+-    OSL_TRACE("~ScVbaToggleButton(dtor)");
+-}
+-
+-// Attributes
+-rtl::OUString SAL_CALL 
+-ScVbaToggleButton::getCaption() throw (css::uno::RuntimeException)
+-{
+-    rtl::OUString Label;
+-    m_xProps->getPropertyValue( LABEL ) >>= Label;
+-    return Label;
+-}
+-
+-void SAL_CALL 
+-ScVbaToggleButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
+-}
+-
+-uno::Any SAL_CALL 
+-ScVbaToggleButton::getValue() throw (uno::RuntimeException)
+-{
+-	sal_Int16 nState = 0;
+-    	m_xProps->getPropertyValue( STATE ) >>= nState;
+- 	return uno::makeAny( nState ? sal_Int16( -1 ) : sal_Int16( 0 ) );
+-}
+-
+-void SAL_CALL 
+-ScVbaToggleButton::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
+-{
+-	sal_Int16 nState = 0;
+-	_value >>= nState;
+-        OSL_TRACE( "nState - %d", nState );
+-	nState = ( nState == -1 ) ?  1 : 0;
+-        OSL_TRACE( "nState - %d", nState );
+-	m_xProps->setPropertyValue( STATE, uno::makeAny(  nState ) );
+-}
+-
+-rtl::OUString& 
+-ScVbaToggleButton::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaToggleButton") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaToggleButton::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.ToggleButton" ) );
+-	}
+-	return aServiceNames;
+-}
+-
 diff --git sc/source/ui/vba/vbatogglebutton.hxx sc/source/ui/vba/vbatogglebutton.hxx
-index 326f0a9..dfa5c1c 100644
+deleted file mode 100644
+index 326f0a9..0000000
 --- sc/source/ui/vba/vbatogglebutton.hxx
-+++ sc/source/ui/vba/vbatogglebutton.hxx
-@@ -38,7 +38,7 @@
- #include <ooo/vba/msforms/XToggleButton.hpp>
- 
- #include "vbacontrol.hxx"
++++ /dev/null
+@@ -1,63 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_TOGGLEBUTTON_HXX
+-#define SC_VBA_TOGGLEBUTTON_HXX
+-#include <cppuhelper/implbase2.hxx>
+-#include <ooo/vba/msforms/XToggleButton.hpp>
+-
+-#include "vbacontrol.hxx"
 -#include "vbahelper.hxx"
-+#include <vbahelper/vbahelper.hxx>
- 
- typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XToggleButton, css::script::XDefaultProperty  > ToggleButtonImpl_BASE;
- 
+-
+-typedef cppu::ImplInheritanceHelper2< ScVbaControl, ov::msforms::XToggleButton, css::script::XDefaultProperty  > ToggleButtonImpl_BASE;
+-
+-class ScVbaToggleButton : public ToggleButtonImpl_BASE
+-{
+-	rtl::OUString msDftPropName;
+-public:
+-    ScVbaToggleButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper );
+-    ~ScVbaToggleButton();
+-   // Attributes
+-    virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setValue( const css::uno::Any& _value ) throw (css::uno::RuntimeException);
+-
+-    virtual rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL setCaption( const rtl::OUString& _caption ) throw (css::uno::RuntimeException);
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-    // XDefaultProperty
+-    rtl::OUString SAL_CALL getDefaultPropertyName(  ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
+-};
+-#endif //SC_VBA_TOGGLEBUTTON_HXX
 diff --git sc/source/ui/vba/vbauserform.cxx sc/source/ui/vba/vbauserform.cxx
-index 8d27e5c..1ba9e3c 100644
+deleted file mode 100644
+index 8d27e5c..0000000
 --- sc/source/ui/vba/vbauserform.cxx
-+++ sc/source/ui/vba/vbauserform.cxx
-@@ -32,7 +32,7 @@
-  *    MA  02111-1307  USA
-  *
-  ************************************************************************/
++++ /dev/null
+@@ -1,228 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
 -#include "helperdecl.hxx"
-+#include <vbahelper/helperdecl.hxx>
- #include "vbauserform.hxx"
- #include <com/sun/star/awt/XControl.hpp>
- #include <com/sun/star/awt/XControlContainer.hpp>
-@@ -56,11 +56,10 @@ using namespace ::com::sun::star;
- //     the models in ControlModels can be accessed by name
- // also the XDialog is a XControl ( to access the model above
- 
+-#include "vbauserform.hxx"
+-#include <com/sun/star/awt/XControl.hpp>
+-#include <com/sun/star/awt/XControlContainer.hpp>
+-#include <com/sun/star/beans/PropertyConcept.hpp>
+-#include <basic/sbx.hxx>
+-#include <basic/sbstar.hxx>
+-#include <basic/sbmeth.hxx>
+-#include "unonames.hxx"
+-#include "vbacontrols.hxx"
+-
+-using namespace ::ooo::vba;
+-using namespace ::com::sun::star;
+-
+-// some little notes
+-// XDialog implementation has the following interesting bits
+-// a Controls property ( which is an array of the container controls )
+-//   each item in the controls array is a XControl, where the model is 
+-//   basically a property bag
+-// additionally the XDialog instance has itself a model
+-//     this model has a ControlModels ( array of models ) property
+-//     the models in ControlModels can be accessed by name
+-// also the XDialog is a XControl ( to access the model above
+-
 -ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& xContext ) throw ( lang::IllegalArgumentException ) :  ScVbaUserForm_BASE( getXSomethingFromArgs< XHelperInterface >( aArgs, 0 ), xContext, getXSomethingFromArgs< uno::XInterface >( aArgs, 1 ), getXSomethingFromArgs< frame::XModel >( aArgs, 2 ), static_cast< ooo::vba::AbstractGeometryAttributes* >(0) ), m_pDocShell( 0 ), mbDispose( true )
-+ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& xContext ) throw ( lang::IllegalArgumentException ) :  ScVbaUserForm_BASE( getXSomethingFromArgs< XHelperInterface >( aArgs, 0 ), xContext, getXSomethingFromArgs< uno::XInterface >( aArgs, 1 ), getXSomethingFromArgs< frame::XModel >( aArgs, 2 ), static_cast< ooo::vba::AbstractGeometryAttributes* >(0) ),  mbDispose( true )
- {
-     m_xDialog.set( m_xControl, uno::UNO_QUERY_THROW );
-     uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
+-{
+-    m_xDialog.set( m_xControl, uno::UNO_QUERY_THROW );
+-    uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
 -    m_pDocShell = getDocShell( m_xModel );
-     m_xProps.set( xControl->getModel(), uno::UNO_QUERY_THROW );
-     setGeometryHelper( new UserFormGeometryHelper( xContext, xControl ) );
- }
+-    m_xProps.set( xControl->getModel(), uno::UNO_QUERY_THROW );
+-    setGeometryHelper( new UserFormGeometryHelper( xContext, xControl ) );
+-}
+-
+-ScVbaUserForm::~ScVbaUserForm()
+-{
+-}
+-
+-void SAL_CALL 
+-ScVbaUserForm::Show(  ) throw (uno::RuntimeException)
+-{
+-	OSL_TRACE("ScVbaUserForm::Show(  )");
+-	short aRet = 0;
+-	if ( m_xDialog.is() )
+-		aRet = m_xDialog->execute();
+-	OSL_TRACE("ScVbaUserForm::Show() execute returned %d", aRet);
+-	if ( mbDispose )
+-	{
+-		try
+-		{
+-			uno::Reference< lang::XComponent > xComp( m_xDialog, uno::UNO_QUERY_THROW );
+-			m_xDialog = NULL;
+-			xComp->dispose();
+-			mbDispose = false; 
+-		}
+-		catch( uno::Exception& )
+-		{
+-		}
+-	}
+-}
+-
+-rtl::OUString SAL_CALL 
+-ScVbaUserForm::getCaption() throw (::com::sun::star::uno::RuntimeException)
+-{
+-    rtl::OUString sCaption;
+-    m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ) ) >>= sCaption;
+-    return sCaption;
+-}
+-void
+-ScVbaUserForm::setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
+-{
+-    m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ), uno::makeAny( _caption ) );
+-}
+-
+-void SAL_CALL 
+-ScVbaUserForm::Hide(  ) throw (uno::RuntimeException)
+-{
+-	mbDispose = false;  // hide not dispose
+-	if ( m_xDialog.is() )
+-		m_xDialog->endExecute();
+-}
+-
+-void SAL_CALL 
+-ScVbaUserForm::RePaint(  ) throw (uno::RuntimeException)
+-{
+-	// do nothing
+-}
+-
+-void SAL_CALL 
+-ScVbaUserForm::UnloadObject(  ) throw (uno::RuntimeException)
+-{
+-	mbDispose = true;
+-	if ( m_xDialog.is() )
+-		m_xDialog->endExecute();
+-}
+-
+-rtl::OUString& 
+-ScVbaUserForm::getServiceImplName()
+-{
+-	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaUserForm") );
+-	return sImplName;
+-}
+-
+-uno::Sequence< rtl::OUString > 
+-ScVbaUserForm::getServiceNames()
+-{
+-	static uno::Sequence< rtl::OUString > aServiceNames;
+-	if ( aServiceNames.getLength() == 0 )
+-	{
+-		aServiceNames.realloc( 1 );
+-		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.UserForm" ) );
+-	}
+-	return aServiceNames;
+-}
+-
+-uno::Reference< beans::XIntrospectionAccess > SAL_CALL 
+-ScVbaUserForm::getIntrospection(  ) throw (uno::RuntimeException)
+-{
+-	return uno::Reference< beans::XIntrospectionAccess >();
+-}
+-
+-uno::Any SAL_CALL 
+-ScVbaUserForm::invoke( const ::rtl::OUString& /*aFunctionName*/, const uno::Sequence< uno::Any >& /*aParams*/, uno::Sequence< ::sal_Int16 >& /*aOutParamIndex*/, uno::Sequence< uno::Any >& /*aOutParam*/ ) throw (lang::IllegalArgumentException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException)
+-{
+-	throw uno::RuntimeException(); // unsupported operation
+-}
+-
+-void SAL_CALL 
+-ScVbaUserForm::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException)
+-{
+-	uno::Any aObject = getValue( aPropertyName );
+-	// The Object *must* support XDefaultProperty here because getValue will
+-	// only return properties that are Objects ( e.g. controls )
+-	// e.g. Userform1.aControl = something
+-	// 'aControl' has to support XDefaultProperty to make sense here
+-	uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW );
+-	rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName();
+-	uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) );
+-	uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW );
+-	xPropSet->setPropertyValue( aDfltPropName, aValue );
+-}
+-
+-uno::Any SAL_CALL 
+-ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+-{
+-	uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
+-	uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW );
+-	uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName );
+-	ScVbaControlFactory aFac( mxContext, xControl, m_xModel );
+-        uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) );
+-        ScVbaControl* pControl  = dynamic_cast< ScVbaControl* >( xVBAControl.get() );
+-        pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) );
+-	return uno::makeAny( xVBAControl );
+-}
+-
+-::sal_Bool SAL_CALL 
+-ScVbaUserForm::hasMethod( const ::rtl::OUString& /*aName*/ ) throw (uno::RuntimeException)
+-{
+-	return sal_False;
+-}
+-uno::Any SAL_CALL 
+-ScVbaUserForm::Controls( const uno::Any& index ) throw (uno::RuntimeException)
+-{
+-	uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
+-	uno::Reference< XCollection > xControls( new ScVbaControls( this, mxContext, xDialogControl ) );
+-	if ( index.hasValue() )
+-		return uno::makeAny( xControls->Item( index, uno::Any() ) );
+-	return uno::makeAny( xControls );
+-}
+-
+-::sal_Bool SAL_CALL 
+-ScVbaUserForm::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
+-{
+-	uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY );
+-	OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is() );
+-	if ( xControl.is() )
+-	{
+-		uno::Reference< container::XNameAccess > xNameAccess( xControl->getModel(), uno::UNO_QUERY_THROW );	
+-		sal_Bool bRes =  xNameAccess->hasByName( aName );
+-	OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d ---> %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is(), bRes );
+-		return bRes;
+-	}
+-	return sal_False;
+-}
+-
+-namespace userform
+-{
+-namespace sdecl = comphelper::service_decl;
+-sdecl::vba_service_class_<ScVbaUserForm, sdecl::with_args<true> > serviceImpl;
+-extern sdecl::ServiceDecl const serviceDecl(
+-    serviceImpl,
+-    "ScVbaUserForm",
+-    "ooo.vba.excel.UserForm" );
+-}
+-
 diff --git sc/source/ui/vba/vbauserform.hxx sc/source/ui/vba/vbauserform.hxx
-index 2c8a1b7..be93dc7 100644
+deleted file mode 100644
+index 2c8a1b7..0000000
 --- sc/source/ui/vba/vbauserform.hxx
-+++ sc/source/ui/vba/vbauserform.hxx
-@@ -40,7 +40,7 @@
- #include <com/sun/star/awt/XDialog.hpp>
- #include <com/sun/star/frame/XModel.hpp>
- 
++++ /dev/null
+@@ -1,78 +0,0 @@
+-/*************************************************************************
+- *
+- *  OpenOffice.org - a multi-platform office productivity suite
+- *
+- *  $RCSfile$
+- *
+- *  $Revision$
+- *
+- *  last change: $Author$ $Date$
+- *
+- *  The Contents of this file are made available subject to
+- *  the terms of GNU Lesser General Public License Version 2.1.
+- *
+- *
+- *    GNU Lesser General Public License Version 2.1
+- *    =============================================
+- *    Copyright 2005 by Sun Microsystems, Inc.
+- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+- *
+- *    This library is free software; you can redistribute it and/or
+- *    modify it under the terms of the GNU Lesser General Public
+- *    License version 2.1, as published by the Free Software Foundation.
+- *
+- *    This library is distributed in the hope that it will be useful,
+- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+- *    Lesser General Public License for more details.
+- *
+- *    You should have received a copy of the GNU Lesser General Public
+- *    License along with this library; if not, write to the Free Software
+- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+- *    MA  02111-1307  USA
+- *
+- ************************************************************************/
+-#ifndef SC_VBA_USERFORM_HXX
+-#define SC_VBA_USERFORM_HXX
+-
+-#include <cppuhelper/implbase1.hxx>
+-#include <ooo/vba/msforms/XUserForm.hpp>
+-#include <com/sun/star/awt/XDialog.hpp>
+-#include <com/sun/star/frame/XModel.hpp>
+-
 -#include "vbahelperinterface.hxx"
-+#include <vbahelper/vbahelperinterface.hxx>
- #include "vbacontrol.hxx"
- 
- //typedef InheritedHelperInterfaceImpl1< ov::msforms::XUserForm > ScVbaUserForm_BASE;
-@@ -50,7 +50,6 @@ class ScVbaUserForm : public ScVbaUserForm_BASE
- {
- private:
-     css::uno::Reference< css::awt::XDialog > m_xDialog;
+-#include "vbacontrol.hxx"
+-
+-//typedef InheritedHelperInterfaceImpl1< ov::msforms::XUserForm > ScVbaUserForm_BASE;
+-typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XUserForm > ScVbaUserForm_BASE;
+-
+-class ScVbaUserForm : public ScVbaUserForm_BASE
+-{
+-private:
+-    css::uno::Reference< css::awt::XDialog > m_xDialog;
 -    ScDocShell* m_pDocShell;
-     bool mbDispose;
- protected:
- public:
+-    bool mbDispose;
+-protected:
+-public:
+-    ScVbaUserForm( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException );
+-    virtual ~ScVbaUserForm();
+-    // XUserForm
+-    virtual void SAL_CALL RePaint(  ) throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL Show(  ) throw (css::uno::RuntimeException);
+-    // XIntrospection
+-    virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection(  ) throw (css::uno::RuntimeException);
+-    virtual css::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
+-    virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw (css::beans::UnknownPropertyException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
+-    virtual css::uno::Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
+-    virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
+-    virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
+-    virtual ::rtl::OUString SAL_CALL getCaption() throw (::com::sun::star::uno::RuntimeException);
+-    virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException);
+-    virtual void SAL_CALL Hide(  ) throw (css::uno::RuntimeException);
+-    virtual void SAL_CALL UnloadObject(  ) throw (css::uno::RuntimeException);
+-    virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+-    //XHelperInterface
+-    virtual rtl::OUString& getServiceImplName();
+-    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
+-};
+-#endif
 diff --git sc/source/ui/vba/vbavalidation.hxx sc/source/ui/vba/vbavalidation.hxx
 index fff6b8a..445a249 100644
 --- sc/source/ui/vba/vbavalidation.hxx
@@ -4281,7 +8435,7 @@
  
  class ScModelObj;
 diff --git sc/source/ui/vba/vbaworksheet.cxx sc/source/ui/vba/vbaworksheet.cxx
-index d687610..60b8f4b 100644
+index d687610..05ed019 100644
 --- sc/source/ui/vba/vbaworksheet.cxx
 +++ sc/source/ui/vba/vbaworksheet.cxx
 @@ -27,7 +27,7 @@
@@ -4292,8 +8446,39 @@
 +#include <vbahelper/helperdecl.hxx>
  #include <cppuhelper/queryinterface.hxx>
  
- #include <com/sun/star/beans/XPropertySet.hpp>
-@@ -947,7 +947,7 @@ ScVbaWorksheet::PrintOut( const uno::Any& From, const uno::Any& To, const uno::A
+ #include <com/sun/star/beans/XPropertySet.hpp>
+@@ -59,6 +59,7 @@
+ #include <com/sun/star/form/FormComponentType.hpp>
+ #include <com/sun/star/form/XFormsSupplier.hpp>
+ #include <ooo/vba/excel/XlEnableSelection.hpp>
++#include <ooo/vba/XControlProvider.hpp>
+ 
+ #include <comphelper/processfactory.hxx>
+ 
+@@ -83,7 +84,6 @@
+ #include "vbaworksheet.hxx"
+ #include "vbachartobjects.hxx"
+ #include "vbapivottables.hxx"
+-#include "vbacombobox.hxx"
+ #include "vbaoleobject.hxx"
+ #include "vbaoleobjects.hxx"
+ #include "vbashapes.hxx"
+@@ -762,9 +762,11 @@ uno::Any SAL_CALL
+ ScVbaWorksheet::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+ {
+     uno::Reference< drawing::XControlShape > xControlShape( getControlShape( aPropertyName ), uno::UNO_QUERY_THROW );
+-    ScVbaControlFactory controlFactory( mxContext, xControlShape, getModel() );
+-    uno::Reference< msforms::XControl > xControl( controlFactory.createControl( getModel() ) );
+-	return uno::makeAny( xControl );
++    
++    uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
++    uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.ControlProvider" ) ), mxContext ), uno::UNO_QUERY_THROW );
++    uno::Reference< msforms::XControl > xControl( xControlProvider->createControl(  xControlShape, getModel() ) );
++    return uno::makeAny( xControl );
+ }
+ 
+ ::sal_Bool SAL_CALL 
+@@ -947,10 +949,9 @@ ScVbaWorksheet::PrintOut( const uno::Any& From, const uno::Any& To, const uno::A
  		bSelection = sal_True;
  
      uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW );  
@@ -4301,7 +8486,10 @@
 +	PrintOutHelper( getBestViewShell( xModel ), From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName, bSelection );
  }
  
- 
+-
+ namespace worksheet
+ {
+ namespace sdecl = comphelper::service_decl;
 diff --git sc/source/ui/vba/vbaworksheet.hxx sc/source/ui/vba/vbaworksheet.hxx
 index e70b282..d6637bb 100644
 --- sc/source/ui/vba/vbaworksheet.hxx
@@ -5996,10 +10184,10 @@
 +#endif
 diff --git vbahelper/inc/vbahelper/vbahelperinterface.hxx vbahelper/inc/vbahelper/vbahelperinterface.hxx
 new file mode 100644
-index 0000000..2c67ba4
+index 0000000..389a825
 --- /dev/null
 +++ vbahelper/inc/vbahelper/vbahelperinterface.hxx
-@@ -0,0 +1,117 @@
+@@ -0,0 +1,121 @@
 +/*************************************************************************
 + *
 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6035,6 +10223,7 @@
 +#include <cppuhelper/implbase1.hxx>
 +#include <ooo/vba/XHelperInterface.hpp>
 +#include <vbahelper/vbahelper.hxx>
++#include <com/sun/star/container/XNameAccess.hpp>
 +
 +// use this class when you have an a object like
 +// interface  XAnInterface which contains XHelperInterface in its inheritance hierarchy
@@ -6084,8 +10273,11 @@
 +	virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { return mxParent; }
 +	
 +	virtual css::uno::Any SAL_CALL Application(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException) { 
-+	// #FIXME - we need some reasonable way to pass back the application
-+	return  css::uno::Any(); }
++            // The application could certainly be passed around in the context - seems
++            // to make sense
++            css::uno::Reference< css::container::XNameAccess > xNameAccess( mxContext, css::uno::UNO_QUERY_THROW );
++            return xNameAccess->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Application" ) ) );
++	}
 +
 +
 +	// XServiceInfo Methods
@@ -6183,10 +10375,6 @@
 +
 +};
 +#endif //SC_VBA_PROPVALULE_HXX
-diff --git vbahelper/prj/.build.lst.swp vbahelper/prj/.build.lst.swp
-new file mode 100644
-index 0000000..87a3475
-Binary files /dev/null and vbahelper/prj/.build.lst.swp differ
 diff --git vbahelper/prj/build.lst vbahelper/prj/build.lst
 new file mode 100644
 index 0000000..a38a6dc
@@ -6216,10 +10404,10 @@
 +..\inc\vbahelper\vbadllapi.h %_DEST%\inc%_EXT%\vbahelper\vbadllapi.h
 diff --git vbahelper/source/msforms/makefile.mk vbahelper/source/msforms/makefile.mk
 new file mode 100644
-index 0000000..8c231ec
+index 0000000..ad5e7b4
 --- /dev/null
 +++ vbahelper/source/msforms/makefile.mk
-@@ -0,0 +1,76 @@
+@@ -0,0 +1,78 @@
 +#*************************************************************************
 +#
 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6263,6 +10451,7 @@
 +
 +SLOFILES=\
 +    $(SLO)$/vbacontrol.obj \
++    $(SLO)$/vbacontrols.obj \
 +    $(SLO)$/vbabutton.obj \
 +    $(SLO)$/vbacombobox.obj \
 +    $(SLO)$/vbalabel.obj \
@@ -6279,6 +10468,7 @@
 +    $(SLO)$/vbaspinbutton.obj \
 +    $(SLO)$/vbaimage.obj \
 +    $(SLO)$/vbapages.obj \
++    $(SLO)$/vbauserform.obj \
 +    $(SLO)$/service.obj \
 +
 +# #FIXME vbapropvalue needs to move to vbahelper
@@ -6298,10 +10488,10 @@
 +
 diff --git vbahelper/source/msforms/service.cxx vbahelper/source/msforms/service.cxx
 new file mode 100644
-index 0000000..8d20031
+index 0000000..3215944
 --- /dev/null
 +++ vbahelper/source/msforms/service.cxx
-@@ -0,0 +1,78 @@
+@@ -0,0 +1,83 @@
 +/*************************************************************************
 + *
 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -6350,6 +10540,11 @@
 +extern sdecl::ServiceDecl const serviceDecl;
 +}
 +
++namespace  userform
++{
++extern sdecl::ServiceDecl const serviceDecl;
++}
++
 +extern "C"
 +{
 +    void SAL_CALL component_getImplementationEnvironment( 
@@ -6366,7 +10561,7 @@
 +
 +	// Component registration
 +         return component_writeInfoHelper( pServiceManager, pRegistryKey, 
-+		controlprovider::serviceDecl );
++		controlprovider::serviceDecl, userform::serviceDecl );
 +    }
 +
 +    void * SAL_CALL component_getFactory( 
@@ -6375,7 +10570,7 @@
 +    {
 +		OSL_TRACE("In component_getFactory for %s", pImplName );
 +	void* pRet =  component_getFactoryHelper(
-+        	pImplName, pServiceManager, pRegistryKey, controlprovider::serviceDecl  );
++        	pImplName, pServiceManager, pRegistryKey, controlprovider::serviceDecl, userform::serviceDecl );
 +	OSL_TRACE("Ret is 0x%x", pRet);
 +	return pRet;
 +    }
@@ -7539,80 +11734,386 @@
 +#include <com/sun/star/script/XDefaultProperty.hpp>
 +#include <com/sun/star/drawing/XControlShape.hpp>
 +#include <com/sun/star/awt/XControl.hpp>
-+#include <com/sun/star/awt/XWindowPeer.hpp>
-+#include <ooo/vba/msforms/XControl.hpp>
++#include <com/sun/star/awt/XWindowPeer.hpp>
++#include <ooo/vba/msforms/XControl.hpp>
++
++#include <vbahelper/vbahelper.hxx>
++#include <vbahelper/vbahelperinterface.hxx>
++#include <memory>
++
++//typedef ::cppu::WeakImplHelper1< ov::msforms::XControl > ControlImpl_BASE;
++typedef InheritedHelperInterfaceImpl1< ov::msforms::XControl > ControlImpl_BASE;
++
++class ScVbaControl : public ControlImpl_BASE
++{
++private:
++    com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > m_xEventListener;
++protected:
++    std::auto_ptr< ov::AbstractGeometryAttributes > mpGeometryHelper;
++    css::uno::Reference< css::beans::XPropertySet > m_xProps;
++    css::uno::Reference< css::uno::XInterface > m_xControl;
++    css::uno::Reference< css::frame::XModel > m_xModel;
++
++    virtual css::uno::Reference< css::awt::XWindowPeer > getWindowPeer() throw (css::uno::RuntimeException);
++public:
++    ScVbaControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, 
++                    const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pHelper );
++    virtual ~ScVbaControl();
++    // This class will own the helper, so make sure it is allocated from 
++    // the heap
++    void setGeometryHelper( ov::AbstractGeometryAttributes* pHelper );
++    // XControl
++    virtual sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
++    virtual void SAL_CALL setEnabled( sal_Bool _enabled ) throw (css::uno::RuntimeException);
++    virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
++    virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
++    virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException);
++    virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException);
++    virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException);
++    virtual void SAL_CALL setWidth( double _width ) throw (css::uno::RuntimeException);
++    virtual double SAL_CALL getLeft() throw (css::uno::RuntimeException);
++    virtual void SAL_CALL setLeft( double _left ) throw (css::uno::RuntimeException);
++    virtual double SAL_CALL getTop() throw (css::uno::RuntimeException);
++    virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException);
++    virtual void SAL_CALL SetFocus(  ) throw (css::uno::RuntimeException);
++
++    virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getObject() throw (css::uno::RuntimeException);
++    virtual rtl::OUString SAL_CALL getControlSource() throw (css::uno::RuntimeException);
++    virtual void SAL_CALL setControlSource( const rtl::OUString& _controlsource ) throw (css::uno::RuntimeException);
++    virtual rtl::OUString SAL_CALL getRowSource() throw (css::uno::RuntimeException);
++    virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
++    virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
++    virtual void SAL_CALL setName( const rtl::OUString& _name ) throw (css::uno::RuntimeException);
++    //remove resouce because ooo.vba.excel.XControl is a wrapper of com.sun.star.drawing.XControlShape
++    virtual void removeResouce() throw( css::uno::RuntimeException );
++    //XHelperInterface
++    virtual rtl::OUString& getServiceImplName();
++    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++
++
++class ScVbaControlFactory
++{
++public:
++    ScVbaControlFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext, 
++                    const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel );
++    ScVbaControl* createControl()  throw ( css::uno::RuntimeException );
++    ScVbaControl* createControl( const css::uno::Reference< css::uno::XInterface >& xParent )  throw ( css::uno::RuntimeException );
++private:
++    ScVbaControl* createControl( const css::uno::Reference< css::awt::XControl >&, const css::uno::Reference< css::uno::XInterface >&  )  throw ( css::uno::RuntimeException );
++    ScVbaControl* createControl( const css::uno::Reference< css::drawing::XControlShape >&, const css::uno::Reference< css::uno::XInterface >& )  throw ( css::uno::RuntimeException );
++    css::uno::Reference< css::uno::XComponentContext > m_xContext;
++    css::uno::Reference< css::uno::XInterface > m_xControl;
++    css::uno::Reference< css::frame::XModel > m_xModel;
++};
++
++#endif//SC_VBA_CONTROL_HXX
+diff --git vbahelper/source/msforms/vbacontrols.cxx vbahelper/source/msforms/vbacontrols.cxx
+new file mode 100644
+index 0000000..82fdfc0
+--- /dev/null
++++ vbahelper/source/msforms/vbacontrols.cxx
+@@ -0,0 +1,232 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ * $Revision$
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++#include "vbacontrols.hxx"
++#include <cppuhelper/implbase2.hxx>
++#include <com/sun/star/awt/XControlContainer.hpp>
++#include <ooo/vba//XControlProvider.hpp>
++#include <hash_map>
++
++using namespace com::sun::star;
++using namespace ooo::vba;
++
++
++typedef ::cppu::WeakImplHelper2< container::XNameAccess, container::XIndexAccess > ArrayWrapImpl;
++
++typedef  std::hash_map< rtl::OUString, sal_Int32, ::rtl::OUStringHash,
++    ::std::equal_to< ::rtl::OUString >  > ControlIndexMap;
++typedef  std::vector< uno::Reference< awt::XControl > > ControlVec;
++
++class ControlArrayWrapper : public ArrayWrapImpl
++{
++    uno::Reference< awt::XControlContainer > mxDialog;
++    uno::Sequence< ::rtl::OUString > msNames;
++    ControlVec mControls;
++    ControlIndexMap mIndices;
++
++    rtl::OUString getControlName( const uno::Reference< awt::XControl >& xCtrl )
++    {
++        uno::Reference< beans::XPropertySet > xProp( xCtrl->getModel(), uno::UNO_QUERY );
++        rtl::OUString sName;
++        xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= sName;
++        return sName;
++    }
++
++public:
++
++    ControlArrayWrapper( const uno::Reference< awt::XControl >& xDialog )
++    {
++        mxDialog.set( xDialog, uno::UNO_QUERY_THROW );
++        uno::Sequence< uno::Reference< awt::XControl > > sXControls = mxDialog->getControls();
++    
++        msNames.realloc( sXControls.getLength() );
++        for ( sal_Int32 i = 0; i < sXControls.getLength(); ++i )
++        {
++            uno::Reference< awt::XControl > xCtrl = sXControls[ i ];
++            msNames[ i ] = getControlName( xCtrl );
++            mControls.push_back( xCtrl );
++            mIndices[ msNames[ i ] ] = i;
++        }
++    }
++    
++    // XElementAccess
++    virtual uno::Type SAL_CALL getElementType(  ) throw (uno::RuntimeException)
++    {
++        return awt::XControl::static_type(0);
++    }
++    
++    virtual ::sal_Bool SAL_CALL hasElements(  ) throw (uno::RuntimeException) 
++    {
++        return mControls.size();
++    }
++    
++    // XNameAcess 
++    virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
++    {
++        if ( !hasByName( aName ) )
++            throw container::NoSuchElementException();
++        return getByIndex( mIndices[ aName ] );
++    }
++    
++    virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames(  ) throw (uno::RuntimeException)
++    {
++        return msNames;
++    }
++    
++    virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException)
++    {
++        ControlIndexMap::iterator it = mIndices.find( aName );
++        return it != mIndices.end();
++    }
++    
++    // XElementAccess
++    virtual ::sal_Int32 SAL_CALL getCount(  ) throw (css::uno::RuntimeException)
++    {
++        return mControls.size();
++    }
++    
++    virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
++    {
++        if ( Index < 0 || Index >= static_cast< sal_Int32 >( mControls.size() ) )
++            throw lang::IndexOutOfBoundsException();
++        return uno::makeAny( mControls[ Index ] );
++    }
++};
++
++
++class ControlsEnumWrapper : public EnumerationHelper_BASE
++{
++    uno::Reference<XHelperInterface > m_xParent;
++    uno::Reference<uno::XComponentContext > m_xContext;
++    uno::Reference<container::XIndexAccess > m_xIndexAccess;
++    uno::Reference<awt::XControl > m_xDlg;
++    sal_Int32 nIndex;
++
++public:
++
++    ControlsEnumWrapper(  const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess, const uno::Reference< awt::XControl >& xDlg ) :  m_xParent( xParent ), m_xContext( xContext), m_xIndexAccess( xIndexAccess ), m_xDlg( xDlg ), nIndex( 0 ) {}
++
++    virtual ::sal_Bool SAL_CALL hasMoreElements(  ) throw (uno::RuntimeException)
++    {
++        return ( nIndex < m_xIndexAccess->getCount() );
++    }
++
++    virtual uno::Any SAL_CALL nextElement(  ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
++    {
++        if ( nIndex < m_xIndexAccess->getCount() )
++        {
++            uno::Reference< frame::XModel > xModel;
++            uno::Reference< awt::XControl > xControl;
++            m_xIndexAccess->getByIndex( nIndex++ ) >>= xControl;
++
++	uno::Reference<lang::XMultiComponentFactory > xServiceManager( m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
++	uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.ControlProvider" ) ), m_xContext ), uno::UNO_QUERY_THROW );
++
++	uno::Reference< msforms::XControl > xVBAControl( xControlProvider->createUserformControl(  xControl, m_xDlg, xModel ) );
++            return uno::makeAny( xVBAControl );
++        }
++        throw container::NoSuchElementException();
++    }
++
++};
++
++
++uno::Reference<container::XIndexAccess >
++lcl_controlsWrapper( const uno::Reference< awt::XControl >& xDlg )
++{
++    return new ControlArrayWrapper( xDlg );
++}
++
++ScVbaControls::ScVbaControls( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext,
++                const css::uno::Reference< awt::XControl >& xDialog )
++            : ControlsImpl_BASE( xParent, xContext, lcl_controlsWrapper( xDialog  ) )
++{
++    mxDialog.set( xDialog, uno::UNO_QUERY_THROW );
++}
++
++uno::Reference< container::XEnumeration >
++ScVbaControls::createEnumeration() throw (uno::RuntimeException)
++{
++    uno::Reference< container::XEnumeration > xEnum( new ControlsEnumWrapper( mxParent, mxContext, m_xIndexAccess, mxDialog ) );
++    if ( !xEnum.is() )
++        throw uno::RuntimeException();
++    return xEnum;
++}
++
++uno::Any
++ScVbaControls::createCollectionObject( const css::uno::Any& aSource )
++{
++    // Create control from awt::XControl
++    uno::Reference< awt::XControl > xControl;
++    aSource >>= xControl;
++    uno::Reference< frame::XModel > xModel;
++    uno::Reference<lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
++    uno::Reference< XControlProvider > xControlProvider( xServiceManager->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.ControlProvider" ) ), mxContext ), uno::UNO_QUERY_THROW );
++
++    uno::Reference< msforms::XControl > xVBAControl( xControlProvider->createUserformControl(  xControl, mxDialog, xModel ) );
++
++    return uno::makeAny( xVBAControl );
++}
++
++void SAL_CALL 
++ScVbaControls::Move( double cx, double cy ) throw (uno::RuntimeException)
++{
++    uno::Reference< container::XEnumeration > xEnum( createEnumeration() );
++    while ( xEnum->hasMoreElements() )
++    {
++        uno::Reference< msforms::XControl > xControl( xEnum->nextElement(), uno::UNO_QUERY_THROW );
++        xControl->setLeft( xControl->getLeft() + cx );
++        xControl->setTop( xControl->getTop() + cy ); 
++    }
++}
++
++uno::Type
++ScVbaControls::getElementType() throw (uno::RuntimeException)
++{
++    return ooo::vba::msforms::XControl::static_type(0);
++}
++rtl::OUString& 
++ScVbaControls::getServiceImplName()
++{
++	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaControls") );
++	return sImplName;
++}
++
++uno::Sequence< rtl::OUString > 
++ScVbaControls::getServiceNames()
++{
++	static uno::Sequence< rtl::OUString > aServiceNames;
++	if ( aServiceNames.getLength() == 0 )
++	{
++		aServiceNames.realloc( 1 );
++		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Controls" ) );
++	}
++	return aServiceNames;
++}
+diff --git vbahelper/source/msforms/vbacontrols.hxx vbahelper/source/msforms/vbacontrols.hxx
+new file mode 100644
+index 0000000..461c360
+--- /dev/null
++++ vbahelper/source/msforms/vbacontrols.hxx
+@@ -0,0 +1,62 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ * $Revision$
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++#ifndef SC_VBA_CONTROLS_HXX
++#define SC_VBA_CONTROLS_HXX
++
++#include <cppuhelper/implbase1.hxx>
++#include <ooo/vba/msforms/XControls.hpp>
++#include <com/sun/star/awt/XControl.hpp>
 +
++#include <vbahelper/vbacollectionimpl.hxx>
 +#include <vbahelper/vbahelper.hxx>
-+#include <vbahelper/vbahelperinterface.hxx>
-+#include <memory>
 +
-+//typedef ::cppu::WeakImplHelper1< ov::msforms::XControl > ControlImpl_BASE;
-+typedef InheritedHelperInterfaceImpl1< ov::msforms::XControl > ControlImpl_BASE;
++typedef CollTestImplHelper< ov::msforms::XControls > ControlsImpl_BASE;
 +
-+class ScVbaControl : public ControlImpl_BASE
++class ScVbaControls : public ControlsImpl_BASE
 +{
-+private:
-+    com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > m_xEventListener;
++	css::uno::Reference< css::awt::XControl > mxDialog;
 +protected:
-+    std::auto_ptr< ov::AbstractGeometryAttributes > mpGeometryHelper;
-+    css::uno::Reference< css::beans::XPropertySet > m_xProps;
-+    css::uno::Reference< css::uno::XInterface > m_xControl;
-+    css::uno::Reference< css::frame::XModel > m_xModel;
-+
-+    virtual css::uno::Reference< css::awt::XWindowPeer > getWindowPeer() throw (css::uno::RuntimeException);
++	virtual rtl::OUString& getServiceImplName();
++	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
 +public:
-+    ScVbaControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, 
-+                    const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pHelper );
-+    virtual ~ScVbaControl();
-+    // This class will own the helper, so make sure it is allocated from 
-+    // the heap
-+    void setGeometryHelper( ov::AbstractGeometryAttributes* pHelper );
-+    // XControl
-+    virtual sal_Bool SAL_CALL getEnabled() throw (css::uno::RuntimeException);
-+    virtual void SAL_CALL setEnabled( sal_Bool _enabled ) throw (css::uno::RuntimeException);
-+    virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
-+    virtual void SAL_CALL setVisible( sal_Bool _visible ) throw (css::uno::RuntimeException);
-+    virtual double SAL_CALL getHeight() throw (css::uno::RuntimeException);
-+    virtual void SAL_CALL setHeight( double _height ) throw (css::uno::RuntimeException);
-+    virtual double SAL_CALL getWidth() throw (css::uno::RuntimeException);
-+    virtual void SAL_CALL setWidth( double _width ) throw (css::uno::RuntimeException);
-+    virtual double SAL_CALL getLeft() throw (css::uno::RuntimeException);
-+    virtual void SAL_CALL setLeft( double _left ) throw (css::uno::RuntimeException);
-+    virtual double SAL_CALL getTop() throw (css::uno::RuntimeException);
-+    virtual void SAL_CALL setTop( double _top ) throw (css::uno::RuntimeException);
-+    virtual void SAL_CALL SetFocus(  ) throw (css::uno::RuntimeException);
-+
-+    virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getObject() throw (css::uno::RuntimeException);
-+    virtual rtl::OUString SAL_CALL getControlSource() throw (css::uno::RuntimeException);
-+    virtual void SAL_CALL setControlSource( const rtl::OUString& _controlsource ) throw (css::uno::RuntimeException);
-+    virtual rtl::OUString SAL_CALL getRowSource() throw (css::uno::RuntimeException);
-+    virtual void SAL_CALL setRowSource( const rtl::OUString& _rowsource ) throw (css::uno::RuntimeException);
-+    virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
-+    virtual void SAL_CALL setName( const rtl::OUString& _name ) throw (css::uno::RuntimeException);
-+    //remove resouce because ooo.vba.excel.XControl is a wrapper of com.sun.star.drawing.XControlShape
-+    virtual void removeResouce() throw( css::uno::RuntimeException );
-+    //XHelperInterface
-+    virtual rtl::OUString& getServiceImplName();
-+    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
-+};
-+
++    ScVbaControls( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, 
++                    const css::uno::Reference< css::awt::XControl >& xDialog );
++    // XControls
++     virtual void SAL_CALL Move( double cx, double cy ) throw (css::uno::RuntimeException);
++    // XEnumerationAccess
++    virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
++    virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
 +
-+class ScVbaControlFactory
-+{
-+public:
-+    ScVbaControlFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext, 
-+                    const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel );
-+    ScVbaControl* createControl()  throw ( css::uno::RuntimeException );
-+    ScVbaControl* createControl( const css::uno::Reference< css::uno::XInterface >& xParent )  throw ( css::uno::RuntimeException );
-+private:
-+    ScVbaControl* createControl( const css::uno::Reference< css::awt::XControl >&, const css::uno::Reference< css::uno::XInterface >&  )  throw ( css::uno::RuntimeException );
-+    ScVbaControl* createControl( const css::uno::Reference< css::drawing::XControlShape >&, const css::uno::Reference< css::uno::XInterface >& )  throw ( css::uno::RuntimeException );
-+    css::uno::Reference< css::uno::XComponentContext > m_xContext;
-+    css::uno::Reference< css::uno::XInterface > m_xControl;
-+    css::uno::Reference< css::frame::XModel > m_xModel;
++    // ScVbaCollectionBaseImpl
++    virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
++    
 +};
++#endif //SC_VBA_OLEOBJECTS_HXX
 +
-+#endif//SC_VBA_CONTROL_HXX
 diff --git vbahelper/source/msforms/vbaframe.cxx vbahelper/source/msforms/vbaframe.cxx
 new file mode 100644
 index 0000000..b2827d0
@@ -10093,6 +14594,321 @@
 +    rtl::OUString SAL_CALL getDefaultPropertyName(  ) throw (css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("Value"); }
 +};
 +#endif //SC_VBA_TOGGLEBUTTON_HXX
+diff --git vbahelper/source/msforms/vbauserform.cxx vbahelper/source/msforms/vbauserform.cxx
+new file mode 100644
+index 0000000..a1116e3
+--- /dev/null
++++ vbahelper/source/msforms/vbauserform.cxx
+@@ -0,0 +1,226 @@
++/*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  $RCSfile$
++ *
++ *  $Revision$
++ *
++ *  last change: $Author$ $Date$
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2005 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library is distributed in the hope that it will be useful,
++ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *    Lesser General Public License for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++#include <vbahelper/helperdecl.hxx>
++#include "vbauserform.hxx"
++#include <com/sun/star/awt/XControl.hpp>
++#include <com/sun/star/awt/XControlContainer.hpp>
++#include <com/sun/star/beans/PropertyConcept.hpp>
++#include <basic/sbx.hxx>
++#include <basic/sbstar.hxx>
++#include <basic/sbmeth.hxx>
++#include "vbacontrols.hxx"
++
++using namespace ::ooo::vba;
++using namespace ::com::sun::star;
++
++// some little notes
++// XDialog implementation has the following interesting bits
++// a Controls property ( which is an array of the container controls )
++//   each item in the controls array is a XControl, where the model is 
++//   basically a property bag
++// additionally the XDialog instance has itself a model
++//     this model has a ControlModels ( array of models ) property
++//     the models in ControlModels can be accessed by name
++// also the XDialog is a XControl ( to access the model above
++
++ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& xContext ) throw ( lang::IllegalArgumentException ) :  ScVbaUserForm_BASE( getXSomethingFromArgs< XHelperInterface >( aArgs, 0 ), xContext, getXSomethingFromArgs< uno::XInterface >( aArgs, 1 ), getXSomethingFromArgs< frame::XModel >( aArgs, 2 ), static_cast< ooo::vba::AbstractGeometryAttributes* >(0) ),  mbDispose( true )
++{
++    m_xDialog.set( m_xControl, uno::UNO_QUERY_THROW );
++    uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
++    m_xProps.set( xControl->getModel(), uno::UNO_QUERY_THROW );
++    setGeometryHelper( new UserFormGeometryHelper( xContext, xControl ) );
++}
++
++ScVbaUserForm::~ScVbaUserForm()
++{
++}
++
++void SAL_CALL 
++ScVbaUserForm::Show(  ) throw (uno::RuntimeException)
++{
++	OSL_TRACE("ScVbaUserForm::Show(  )");
++	short aRet = 0;
++	if ( m_xDialog.is() )
++		aRet = m_xDialog->execute();
++	OSL_TRACE("ScVbaUserForm::Show() execute returned %d", aRet);
++	if ( mbDispose )
++	{
++		try
++		{
++			uno::Reference< lang::XComponent > xComp( m_xDialog, uno::UNO_QUERY_THROW );
++			m_xDialog = NULL;
++			xComp->dispose();
++			mbDispose = false; 
++		}
++		catch( uno::Exception& )
++		{
++		}
++	}
++}
++
++rtl::OUString SAL_CALL 
++ScVbaUserForm::getCaption() throw (::com::sun::star::uno::RuntimeException)
++{
++    rtl::OUString sCaption;
++    m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ) ) >>= sCaption;
++    return sCaption;
++}
++void
++ScVbaUserForm::setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
++{
++    m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ), uno::makeAny( _caption ) );
++}
++
++void SAL_CALL 
++ScVbaUserForm::Hide(  ) throw (uno::RuntimeException)
++{
++	mbDispose = false;  // hide not dispose
++	if ( m_xDialog.is() )
++		m_xDialog->endExecute();
++}
++
++void SAL_CALL 
++ScVbaUserForm::RePaint(  ) throw (uno::RuntimeException)
++{
++	// do nothing
++}
++
++void SAL_CALL 
++ScVbaUserForm::UnloadObject(  ) throw (uno::RuntimeException)
++{
++	mbDispose = true;
++	if ( m_xDialog.is() )
++		m_xDialog->endExecute();
++}
++
++rtl::OUString& 
++ScVbaUserForm::getServiceImplName()
++{
++	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaUserForm") );
++	return sImplName;
++}
++
++uno::Sequence< rtl::OUString > 
++ScVbaUserForm::getServiceNames()
++{
++	static uno::Sequence< rtl::OUString > aServiceNames;
++	if ( aServiceNames.getLength() == 0 )
++	{
++		aServiceNames.realloc( 1 );
++		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.UserForm" ) );
++	}
++	return aServiceNames;
++}
++
++uno::Reference< beans::XIntrospectionAccess > SAL_CALL 
++ScVbaUserForm::getIntrospection(  ) throw (uno::RuntimeException)
++{
++	return uno::Reference< beans::XIntrospectionAccess >();
++}
++
++uno::Any SAL_CALL 
++ScVbaUserForm::invoke( const ::rtl::OUString& /*aFunctionName*/, const uno::Sequence< uno::Any >& /*aParams*/, uno::Sequence< ::sal_Int16 >& /*aOutParamIndex*/, uno::Sequence< uno::Any >& /*aOutParam*/ ) throw (lang::IllegalArgumentException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException)
++{
++	throw uno::RuntimeException(); // unsupported operation
++}
++
++void SAL_CALL 
++ScVbaUserForm::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException)
++{
++	uno::Any aObject = getValue( aPropertyName );
++	// The Object *must* support XDefaultProperty here because getValue will
++	// only return properties that are Objects ( e.g. controls )
++	// e.g. Userform1.aControl = something
++	// 'aControl' has to support XDefaultProperty to make sense here
++	uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW );
++	rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName();
++	uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) );
++	uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW );
++	xPropSet->setPropertyValue( aDfltPropName, aValue );
++}
++
++uno::Any SAL_CALL 
++ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
++{
++	uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
++	uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW );
++	uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName );
++	ScVbaControlFactory aFac( mxContext, xControl, m_xModel );
++        uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) );
++        ScVbaControl* pControl  = dynamic_cast< ScVbaControl* >( xVBAControl.get() );
++        pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) );
++	return uno::makeAny( xVBAControl );
++}
++
++::sal_Bool SAL_CALL 
++ScVbaUserForm::hasMethod( const ::rtl::OUString& /*aName*/ ) throw (uno::RuntimeException)
++{
++	return sal_False;
++}
++uno::Any SAL_CALL 
++ScVbaUserForm::Controls( const uno::Any& index ) throw (uno::RuntimeException)
++{
++	uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW );
++	uno::Reference< XCollection > xControls( new ScVbaControls( this, mxContext, xDialogControl ) );
++	if ( index.hasValue() )
++		return uno::makeAny( xControls->Item( index, uno::Any() ) );
++	return uno::makeAny( xControls );
++}
++
++::sal_Bool SAL_CALL 
++ScVbaUserForm::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
++{
++	uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY );
++	OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is() );
++	if ( xControl.is() )
++	{
++		uno::Reference< container::XNameAccess > xNameAccess( xControl->getModel(), uno::UNO_QUERY_THROW );	
++		sal_Bool bRes =  xNameAccess->hasByName( aName );
++	OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d ---> %d", rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is(), bRes );
++		return bRes;
++	}
++	return sal_False;
++}
++
++namespace userform
++{
++namespace sdecl = comphelper::service_decl;
++sdecl::vba_service_class_<ScVbaUserForm, sdecl::with_args<true> > serviceImpl;
++extern sdecl::ServiceDecl const serviceDecl(
++    serviceImpl,
++    "ScVbaUserForm",
++    "ooo.vba.excel.UserForm" );
++}
++
+diff --git vbahelper/source/msforms/vbauserform.hxx vbahelper/source/msforms/vbauserform.hxx
+new file mode 100644
+index 0000000..be93dc7
+--- /dev/null
++++ vbahelper/source/msforms/vbauserform.hxx
+@@ -0,0 +1,77 @@
++/*************************************************************************
++ *
++ *  OpenOffice.org - a multi-platform office productivity suite
++ *
++ *  $RCSfile$
++ *
++ *  $Revision$
++ *
++ *  last change: $Author$ $Date$
++ *
++ *  The Contents of this file are made available subject to
++ *  the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ *    GNU Lesser General Public License Version 2.1
++ *    =============================================
++ *    Copyright 2005 by Sun Microsystems, Inc.
++ *    901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *    This library is free software; you can redistribute it and/or
++ *    modify it under the terms of the GNU Lesser General Public
++ *    License version 2.1, as published by the Free Software Foundation.
++ *
++ *    This library is distributed in the hope that it will be useful,
++ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *    Lesser General Public License for more details.
++ *
++ *    You should have received a copy of the GNU Lesser General Public
++ *    License along with this library; if not, write to the Free Software
++ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *    MA  02111-1307  USA
++ *
++ ************************************************************************/
++#ifndef SC_VBA_USERFORM_HXX
++#define SC_VBA_USERFORM_HXX
++
++#include <cppuhelper/implbase1.hxx>
++#include <ooo/vba/msforms/XUserForm.hpp>
++#include <com/sun/star/awt/XDialog.hpp>
++#include <com/sun/star/frame/XModel.hpp>
++
++#include <vbahelper/vbahelperinterface.hxx>
++#include "vbacontrol.hxx"
++
++//typedef InheritedHelperInterfaceImpl1< ov::msforms::XUserForm > ScVbaUserForm_BASE;
++typedef cppu::ImplInheritanceHelper1< ScVbaControl, ov::msforms::XUserForm > ScVbaUserForm_BASE;
++
++class ScVbaUserForm : public ScVbaUserForm_BASE
++{
++private:
++    css::uno::Reference< css::awt::XDialog > m_xDialog;
++    bool mbDispose;
++protected:
++public:
++    ScVbaUserForm( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException );
++    virtual ~ScVbaUserForm();
++    // XUserForm
++    virtual void SAL_CALL RePaint(  ) throw (css::uno::RuntimeException);
++    virtual void SAL_CALL Show(  ) throw (css::uno::RuntimeException);
++    // XIntrospection
++    virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection(  ) throw (css::uno::RuntimeException);
++    virtual css::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
++    virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw (css::beans::UnknownPropertyException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
++    virtual css::uno::Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
++    virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
++    virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
++    virtual ::rtl::OUString SAL_CALL getCaption() throw (::com::sun::star::uno::RuntimeException);
++    virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException);
++    virtual void SAL_CALL Hide(  ) throw (css::uno::RuntimeException);
++    virtual void SAL_CALL UnloadObject(  ) throw (css::uno::RuntimeException);
++    virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& index ) throw (css::uno::RuntimeException);
++    //XHelperInterface
++    virtual rtl::OUString& getServiceImplName();
++    virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif
 diff --git vbahelper/source/vbahelper/makefile.mk vbahelper/source/vbahelper/makefile.mk
 new file mode 100644
 index 0000000..8d939b9
@@ -11054,10 +15870,6 @@
 +{
 +    m_pListener->setValueEvent( _value );
 +}
-diff --git vbahelper/util/.makefile.mk.swp vbahelper/util/.makefile.mk.swp
-new file mode 100644
-index 0000000..bf20844
-Binary files /dev/null and vbahelper/util/.makefile.mk.swp differ
 diff --git vbahelper/util/makefile.mk vbahelper/util/makefile.mk
 new file mode 100644
 index 0000000..b5553aa



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]