ooo-build r12306 - trunk/patches/test/vba
- From: noelpwer svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12306 - trunk/patches/test/vba
- Date: Wed, 23 Apr 2008 15:36:09 +0100 (BST)
Author: noelpwer
Date: Wed Apr 23 14:36:09 2008
New Revision: 12306
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12306&view=rev
Log:
remove api bits - these will follow with a new version of
cws-npower.diff
Modified:
trunk/patches/test/vba/UserFormObjectModuleEventsSuperBigPatch.diff
Modified: trunk/patches/test/vba/UserFormObjectModuleEventsSuperBigPatch.diff
==============================================================================
--- trunk/patches/test/vba/UserFormObjectModuleEventsSuperBigPatch.diff (original)
+++ trunk/patches/test/vba/UserFormObjectModuleEventsSuperBigPatch.diff Wed Apr 23 14:36:09 2008
@@ -1181,1878 +1181,1165 @@
# --- Files --------------------------------------------------------
SLO1FILES = \
$(SLO)$/docuno.obj \
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/makefile.mk 2008-04-08 12:28:10.000000000 +0100
-+++ sc/source/ui/vba/makefile.mk 2008-04-06 16:10:39.000000000 +0100
-@@ -121,6 +121,14 @@ SLOFILES= \
- $(SLO)$/vbacommandbarcontrols.obj \
- $(SLO)$/vbacommandbar.obj \
- $(SLO)$/vbacommandbars.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)$/service.obj \
-
-
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/service.cxx sc/source/ui/vba/service.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/service.cxx 2007-12-07 10:42:52.000000000 +0000
-+++ sc/source/ui/vba/service.cxx 2008-03-28 10:30:33.000000000 +0000
-@@ -62,7 +62,10 @@ namespace globals
- {
- extern sdecl::ServiceDecl const serviceDecl;
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/view/viewfun2.cxx sc/source/ui/view/viewfun2.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/view/viewfun2.cxx 2008-03-29 23:08:24.000000000 +0000
++++ sc/source/ui/view/viewfun2.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -62,6 +62,11 @@
+ #include <vcl/sound.hxx>
+ #include <vcl/waitobj.hxx>
+
++#include <basic/sbstar.hxx>
++#include <com/sun/star/container/XNameContainer.hpp>
++#include <com/sun/star/script/XLibraryContainer.hpp>
++using namespace com::sun::star;
++
+ #include "viewfunc.hxx"
+
+ #include "sc.hrc"
+@@ -2095,15 +2100,42 @@ BOOL ScViewFunc::DeleteTable( SCTAB nTab
+ return bSuccess;
}
--
-+namespace userform
+
++void lcl_DeleteModule( ScDocShell* rDocSh, String& sModuleName )
+{
-+extern sdecl::ServiceDecl const serviceDecl;
++ SFX_APP()->EnterBasicCall();
++ uno::Reference< script::XLibraryContainer > xLibContainer = rDocSh->GetBasicContainer();
++ DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
++
++ uno::Reference< container::XNameContainer > xLib;
++ if( xLibContainer.is() )
++ {
++ String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
++ uno::Any aLibAny = xLibContainer->getByName( aLibName );
++ aLibAny >>= xLib;
++ }
++ if( xLib.is() )
++ {
++ if( xLib->hasByName( sModuleName ) )
++ {
++ xLib->removeByName( sModuleName );
++ }
++ }
++ SFX_APP()->LeaveBasicCall();
+}
++
+ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord )
+ {
+ ScDocShell* pDocSh = GetViewData()->GetDocShell();
+ ScDocument* pDoc = pDocSh->GetDocument();
++ StarBASIC* pStarBASIC = pDocSh->GetBasic();
++ BOOL bVbaEnabled = pStarBASIC->isVBAEnabled();
+ SCTAB nNewTab = TheTabs[0];
+ int i;
+ WaitObject aWait( GetFrameWin() );
+ if (bRecord && !pDoc->IsUndoEnabled())
+ bRecord = FALSE;
++ if ( bVbaEnabled )
++ bRecord = FALSE;
+ while ( nNewTab > 0 && !pDoc->IsVisible( nNewTab ) )
+ --nNewTab;
+@@ -2170,9 +2202,18 @@ BOOL ScViewFunc::DeleteTables(const SvSh
- extern "C"
-@@ -81,7 +84,7 @@ extern "C"
-
- // Component registration
- if ( component_writeInfoHelper( pServiceManager, pRegistryKey,
-- range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl ) )
-+ range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl ) )
+ for(i=TheTabs.Count()-1;i>=0;i--)
+ {
++ String sCodeName;
++ BOOL bHasCodeName = pDoc->GetCodeName( TheTabs[sal::static_int_cast<USHORT>(i)], sCodeName );
+ if (pDoc->DeleteTab( TheTabs[sal::static_int_cast<USHORT>(i)], pUndoDoc ))
{
- // Singleton registration
- try
-@@ -109,7 +112,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 );
-+ pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, userform::serviceDecl );
- OSL_TRACE("Ret is 0x%x", pRet);
- return pRet;
- }
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbabutton.cxx sc/source/ui/vba/vbabutton.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbabutton.cxx 2007-12-07 10:44:58.000000000 +0000
-+++ sc/source/ui/vba/vbabutton.cxx 2008-03-28 18:21:50.000000000 +0000
-@@ -40,7 +40,7 @@ using namespace org::openoffice;
+ bDelDone = TRUE;
++ if( bVbaEnabled )
++ {
++ if( bHasCodeName )
++ {
++ lcl_DeleteModule( pDocSh, sCodeName );
++ }
++ }
+ pDocSh->Broadcast( ScTablesHint( SC_TAB_DELETED, TheTabs[sal::static_int_cast<USHORT>(i)] ) );
+ }
+ }
+@@ -2200,6 +2241,7 @@ BOOL ScViewFunc::DeleteTables(const SvSh
+ pDocSh->PostPaintExtras();
+ pDocSh->SetDocumentModified();
++
+ SfxApplication* pSfxApp = SFX_APP(); // Navigator
+ pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+ pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basides1.cxx basctl/source/basicide/basides1.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basides1.cxx 2008-01-14 16:00:33.000000000 +0000
++++ basctl/source/basicide/basides1.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -1229,10 +1229,16 @@ IDEBaseWindow* BasicIDEShell::FindWindow
+ // return any non-suspended window
+ return pWin;
+ }
+- else if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName && pWin->GetName() == rName &&
++ else if ( pWin->IsDocument( rDocument ) )
++ {
++ OSL_TRACE("FindWindow pWin->GetLibName() %s rLibName %s",
++ rtl::OUStringToOString( pWin->GetLibName(), RTL_TEXTENCODING_UTF8 ).getStr(),
++ rtl::OUStringToOString( rLibName, RTL_TEXTENCODING_UTF8 ).getStr() );
++ OSL_TRACE("pWin->pWin->IsA( TYPE( ModulWindow ) %d && nType %d = BASICIDE_TYPE_MODULE %d", pWin->IsA( TYPE( ModulWindow ) ), nType, BASICIDE_TYPE_MODULE );
++ OSL_TRACE("pWin->pWin->IsA( TYPE( DialogWindow ) %d && nType %d = BASICIDE_TYPE_DIALOG %d", pWin->IsA( TYPE( DialogWindow ) ), nType, BASICIDE_TYPE_DIALOG );
++ if ( pWin->GetLibName() == rLibName && pWin->GetName() == rName &&
+ ( ( pWin->IsA( TYPE( ModulWindow ) ) && nType == BASICIDE_TYPE_MODULE ) ||
+ ( pWin->IsA( TYPE( DialogWindow ) ) && nType == BASICIDE_TYPE_DIALOG ) ) )
+- {
+ return pWin;
+ }
+ }
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basides2.cxx basctl/source/basicide/basides2.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basides2.cxx 2007-11-21 16:37:21.000000000 +0000
++++ basctl/source/basicide/basides2.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -252,9 +252,12 @@ ModulWindow* BasicIDEShell::CreateBasWin
- const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
--ScVbaButton::ScVbaButton( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : ButtonImpl_BASE( xContext, xControlShape )
-+ScVbaButton::ScVbaButton( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl ) : ButtonImpl_BASE( xContext, xControl )
- {
- }
+ if ( bSuccess )
+ {
+- // new module window
+- pWin = new ModulWindow( pModulLayout, rDocument, aLibName, aModName, aModule );
+- nKey = InsertWindowInTable( pWin );
++ pWin = FindBasWin( rDocument, aLibName, aModName, FALSE, TRUE );
++ if( !pWin )
++ { // new module window
++ pWin = new ModulWindow( pModulLayout, rDocument, aLibName, aModName, aModule );
++ nKey = InsertWindowInTable( pWin );
++ }
+ }
+ }
+ else
+@@ -269,7 +272,8 @@ ModulWindow* BasicIDEShell::CreateBasWin
+ }
+ DBG_ASSERT( nKey, "CreateBasWin: Kein Key- Fenster nicht gefunden!" );
+ }
+- pTabBar->InsertPage( (USHORT)nKey, aModName );
++ if( nKey )
++ pTabBar->InsertPage( (USHORT)nKey, aModName );
+ pTabBar->Sort();
+ pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar );
+ if ( !pCurWin )
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basidesh.cxx basctl/source/basicide/basidesh.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basidesh.cxx 2008-01-14 16:00:46.000000000 +0000
++++ basctl/source/basicide/basidesh.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -97,6 +97,9 @@
+ #ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+ #include <com/sun/star/container/XNameContainer.hpp>
+ #endif
++#include <com/sun/star/container/XContainer.hpp>
++#include <com/sun/star/container/XContainerListener.hpp>
++#include <com/sun/star/script/XLibraryContainer.hpp>
-@@ -58,3 +58,22 @@ ScVbaButton::setCaption( const rtl::OUSt
- {
- 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("org.openoffice.msforms.Button" ) );
-+ }
-+ return aServiceNames;
-+}
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbabutton.hxx sc/source/ui/vba/vbabutton.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbabutton.hxx 2007-12-07 10:45:09.000000000 +0000
-+++ sc/source/ui/vba/vbabutton.hxx 2008-03-28 18:08:06.000000000 +0000
-@@ -46,9 +46,12 @@ class ScVbaButton : public ButtonImpl_BA
- {
- public:
- ScVbaButton( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
-+ const css::uno::Reference< css::uno::XInterface >& xControl );
- // 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
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbacombobox.cxx 2008-04-03 11:33:30.000000000 +0100
-+++ sc/source/ui/vba/vbacombobox.cxx 2008-04-02 17:21:31.000000000 +0100
-@@ -39,34 +39,93 @@ using namespace com::sun::star;
- using namespace org::openoffice;
-
-
--const static rtl::OUString CONTROLSOURCEPROP( RTL_CONSTASCII_USTRINGPARAM("DataFieldProperty") );
-+//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") );
+ #include <svx/xmlsecctrl.hxx>
--ScVbaComboBox::ScVbaComboBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : ComboBoxImpl_BASE( xContext, xControlShape )
-+ScVbaComboBox::ScVbaComboBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, bool bDialogType ) : ComboBoxImpl_BASE( xContext, xControl ), mbDialogType( bDialogType )
- {
-- // grab the default value property name
-- m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
-+ if ( !mbDialogType )
-+ // grab the default value property name
-+ m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
- }
+@@ -104,6 +107,71 @@ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star;
+ using ::rtl::OUString;
--ScVbaComboBox::ScVbaComboBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< beans::XPropertySet >& xPropSet, const css::uno::Reference< css::drawing::XControlShape > xControlShape ) : ComboBoxImpl_BASE( xContext, xPropSet, xControlShape )
-+// Attributes
++static const rtl::OUString sStandardLibName( rtl::OUString::createFromAscii("Standard") );
+
++typedef ::cppu::WeakImplHelper1< container::XContainerListener > ContainerListenerBASE;
+
-+// 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)
- {
-- m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
-+ if ( mbDialogType )
-+ return m_xProps->getPropertyValue( TEXT );
-+ else
-+ return m_xProps->getPropertyValue( sSourceName );
- }
-
-+void SAL_CALL
-+ScVbaComboBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeException)
++class ContainerListenerImpl : public ContainerListenerBASE
+{
-+// #TODO Test me please
-+ uno::Sequence< rtl::OUString > sItems;
-+ m_xProps->getPropertyValue( ITEMS ) >>= sItems;
-+ uno::Sequence< sal_Int16 > sSelection(1);
-+ _value >>= sSelection[ 0 ];
-+ if ( mbDialogType )
++ BasicIDEShell* mpShell;
++public:
++
++ ContainerListenerImpl( BasicIDEShell* pShell ) : mpShell( pShell ) {}
++
++ ~ContainerListenerImpl()
+ {
-+ if ( sItems.getLength() == 0 || sSelection[0] < 0 || sSelection[ 0 ] >= sItems.getLength() )
-+ throw uno::RuntimeException( rtl::OUString::createFromAscii("Illegal index"), uno::Reference< uno::XInterface >() );
-+ setValue( uno::makeAny( sItems[ sSelection[ 0 ] ] ) );
+ }
-+ else
++
++ void addContainerListener( const ScriptDocument& rScriptDocument )
+ {
-+ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( sSelection ) );
-+ }
-+}
++ uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, sStandardLibName, FALSE ), uno::UNO_QUERY );
++ if ( rScriptDocument.isDocument() && xContainer.is() )
++ {
++ uno::Reference< container::XContainerListener > xContainerListener( this );
++ try
++ {
++ xContainer->addContainerListener( xContainerListener );
++ }
++ catch( uno::Exception& ) {}
++ }
++ }
++ void removeContainerListener( const ScriptDocument& rScriptDocument )
++ {
++ uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, sStandardLibName, FALSE ), uno::UNO_QUERY );
++ if ( rScriptDocument.isDocument(), xContainer.is() )
++ {
++ uno::Reference< container::XContainerListener > xContainerListener( this );
++ try
++ {
++ xContainer->removeContainerListener( xContainerListener );
++ }
++ catch( uno::Exception& ) {}
++ }
++ }
++
++ // XEventListener
++ virtual void SAL_CALL disposing( const lang::EventObject& ) throw( uno::RuntimeException ) {}
++
++ // XContainerListener
++ virtual void SAL_CALL elementInserted( const container::ContainerEvent& Event ) throw( uno::RuntimeException )
++ {
++ rtl::OUString sModuleName;
++ if( mpShell && ( Event.Accessor >>= sModuleName ) )
++ mpShell->FindBasWin( mpShell->m_aCurDocument, sStandardLibName, sModuleName, TRUE, FALSE );
++ }
++ virtual void SAL_CALL elementReplaced( const container::ContainerEvent& ) throw( com::sun::star::uno::RuntimeException ) { }
++ virtual void SAL_CALL elementRemoved( const container::ContainerEvent& Event ) throw( com::sun::star::uno::RuntimeException )
++ {
++ rtl::OUString sModuleName;
++ if( mpShell && ( Event.Accessor >>= sModuleName ) )
++ {
++ IDEBaseWindow* pWin = mpShell->FindWindow( mpShell->m_aCurDocument, sStandardLibName, sModuleName, BASICIDE_TYPE_MODULE, TRUE );
++ if( pWin )
++ mpShell->RemoveWindow( pWin, FALSE, TRUE );
++ }
++ }
++
++};
--// Attributes
- uno::Any SAL_CALL
--ScVbaComboBox::getValue() throw (uno::RuntimeException)
-+ScVbaComboBox::getListIndex() throw (uno::RuntimeException)
+ TYPEINIT1( BasicIDEShell, SfxViewShell );
+
+@@ -141,6 +209,7 @@ BasicIDEShell::BasicIDEShell( SfxViewFra
+ m_bAppBasicModified( FALSE ),
+ m_aNotifier( *this )
{
-- return m_xProps->getPropertyValue( sSourceName );
-+ 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 ) );
++ m_xLibListener = new ContainerListenerImpl( this );
+ Init();
+ GnBasicIDEShellCount++;
}
-
-+// 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)
+@@ -156,6 +225,7 @@ BasicIDEShell::BasicIDEShell( SfxViewFra
+ m_aNotifier( *this )
{
-- m_xProps->setPropertyValue( sSourceName, _value );
-+ if ( mbDialogType )
-+ m_xProps->setPropertyValue( TEXT, _value );
-+ else
-+ m_xProps->setPropertyValue( sSourceName, _value );
+ DBG_ERROR( "Zweite Ansicht auf Debugger nicht moeglich!" );
++ m_xLibListener = new ContainerListenerImpl( this );
+ GnBasicIDEShellCount++;
}
-+// see Value
-+
- ::rtl::OUString SAL_CALL
- ScVbaComboBox::getText() throw (uno::RuntimeException)
+@@ -170,6 +240,7 @@ BasicIDEShell::BasicIDEShell( SfxViewFra
+ m_aNotifier( *this )
{
-@@ -145,3 +204,22 @@ ScVbaComboBox::Clear( ) throw (uno::Run
- setValue( uno::makeAny( rtl::OUString() ) );
- m_xProps->setPropertyValue( ITEMS, uno::makeAny( uno::Sequence< rtl::OUString >() ) );
+ Init();
++ m_xLibListener = new ContainerListenerImpl( this );
+ GnBasicIDEShellCount++;
}
-+
-+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("org.openoffice.msforms.ComboBox" ) );
-+ }
-+ return aServiceNames;
-+}
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbacombobox.hxx 2008-03-31 15:23:06.000000000 +0100
-+++ sc/source/ui/vba/vbacombobox.hxx 2008-04-01 21:25:19.000000000 +0100
-@@ -49,22 +49,17 @@
- typedef cppu::ImplInheritanceHelper2<ScVbaControl, oo::msforms::XComboBox, css::script::XDefaultProperty > ComboBoxImpl_BASE;
- class ScVbaComboBox : public ComboBoxImpl_BASE
- {
--
-- //css::uno::Reference< css::uno::XComponentContext > m_xContext;
-- //css::uno::Reference< css::beans::XPropertySet > m_xProps;
- rtl::OUString sSourceName;
- rtl::OUString msDftPropName;
--
-+ bool mbDialogType;
-
- public:
- ScVbaComboBox( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
-- ScVbaComboBox( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::beans::XPropertySet >& xProps,
-- const css::uno::Reference< css::drawing::XControlShape> xControlShape );
--
-+ const css::uno::Reference< css::uno::XInterface >& xControl, bool bDialogType = false );
- // 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 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);
-@@ -76,6 +71,9 @@ public:
-
- // 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 //
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbacontrol.cxx 2007-12-07 10:49:52.000000000 +0000
-+++ sc/source/ui/vba/vbacontrol.cxx 2008-04-11 16:04:13.000000000 +0100
-@@ -49,17 +49,25 @@
- #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"
-
-
- using namespace com::sun::star;
- using namespace org::openoffice;
+@@ -258,6 +329,12 @@ __EXPORT BasicIDEShell::~BasicIDEShell()
+ delete pTabBar;
+ delete pObjectCatalog;
+ DestroyModulWindowLayout();
++
++ ContainerListenerImpl* pListener = dynamic_cast< ContainerListenerImpl* >( m_xLibListener.get() );
++ // Destroy all ContainerListeners for Basic Container.
++ if ( pListener )
++ pListener->removeContainerListener( m_aCurDocument );
++
+ // MI: Das gab einen GPF im SDT beim Schliessen da dann der ViewFrame die
+ // ObjSh loslaesst. Es wusste auch keiner mehr wozu das gut war.
+ // GetViewFrame()->GetObjectShell()->Broadcast( SfxSimpleHint( SFX_HINT_DYING ) );
+@@ -275,6 +352,7 @@ sal_Bool BasicIDEShell::HasBasic() const
--sal_Int32 pt2mm( double pt );
--double mm2pt( sal_Int32 mm );
--
- uno::Reference< css::awt::XWindowPeer >
--ScVbaControl::getWindowPeer( const uno::Reference< ::drawing::XControlShape >& xControlShape ) throw (uno::RuntimeException)
-+ScVbaControl::getWindowPeer() throw (uno::RuntimeException)
+ void BasicIDEShell::onDocumentCreated( const ScriptDocument& /*_rDocument*/ )
{
-+ // #FIXME why don't we already have the XModel instead of getting it
-+ // directly from the controlmodel, probablye we thought there was a reason
-+ // at some stage.
-+ uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY );
-+
- uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl(), uno::UNO_QUERY_THROW );
- //init m_xWindowPeer
- uno::Reference< container::XChild > xChild( xControlModel, uno::UNO_QUERY_THROW );
-@@ -67,17 +75,18 @@ ScVbaControl::getWindowPeer( const uno::
- xChild.set( xChild->getParent(), uno::UNO_QUERY_THROW );
- uno::Reference< frame::XModel > xModel( xChild->getParent(), uno::UNO_QUERY_THROW );
- uno::Reference< view::XControlAccess > xControlAccess( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
-- uno::Reference< awt::XControl > xControl;
-+ uno::Reference< css::awt::XWindowPeer > xWinPeer;
- try
- {
-- xControl.set( xControlAccess->getControl( xControlModel ), uno::UNO_QUERY );
-+ 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 xControl->getPeer();
-+ return xWinPeer;
++ // _rDocument is not a valid ScriptDocument.
+ UpdateWindows();
}
- //ScVbaControlListener
-@@ -111,67 +120,49 @@ ScVbaControlListener::disposing( const l
-
- //ScVbaControl
-
--ScVbaControl::ScVbaControl( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ::drawing::XControlShape >& xControlShape ) : m_xContext( xContext ), m_xControlShape( xControlShape )
-+ScVbaControl::ScVbaControl( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ::uno::XInterface >& xControl ) : ControlImpl_BASE( uno::Reference< vba::XHelperInterface >(), xContext ), m_xControl( xControl )
- {
-- //init m_xProps
-- uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl(), uno::UNO_QUERY_THROW );
-- uno::Reference< beans::XPropertySet > xProps( xControlModel, uno::UNO_QUERY_THROW );
-- m_xProps.set( xProps, uno::UNO_QUERY_THROW );
- //add listener
- m_xEventListener.set( new ScVbaControlListener( this ) );
-- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
-+ uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
- xComponent->addEventListener( m_xEventListener );
-+
-+ // The initialisation below is pretty shitty, this should be
-+ // done in the subclass(s) or a virtual ctor as appropriate
-+
-+ //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 );
-+ setGeometryHelper( new ConcreteXShapeGeometryAttributes( xContext, uno::Reference< drawing::XShape >( m_xControl, uno::UNO_QUERY_THROW ) ) );
-+ }
-+ else if ( xUserFormControl.is() ) // userform control
-+ m_xProps.set( xUserFormControl->getModel(), uno::UNO_QUERY_THROW );
+@@ -303,6 +381,8 @@ void BasicIDEShell::onDocumentSaveAsDone
+ // not interested in
}
- ScVbaControl::~ScVbaControl()
++//============================================================================
++
+ void BasicIDEShell::onDocumentClosed( const ScriptDocument& _rDocument )
{
-- if( m_xControlShape.is() )
-+ if( m_xControl.is() )
- {
-- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
-+ uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
- xComponent->removeEventListener( m_xEventListener );
- }
+ if ( !_rDocument.isValid() )
+@@ -402,7 +482,6 @@ void BasicIDEShell::StoreAllWindowData(
+ }
}
--void ScVbaControl::removeResouce() throw( uno::RuntimeException )
--{
-- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
-- xComponent->removeEventListener( m_xEventListener );
-- m_xControlShape = NULL;
-- m_xProps = NULL;
--}
--
-
--ScVbaControl::ScVbaControl( const uno::Reference< uno::XComponentContext >& xContext,
-- const uno::Reference< beans::XPropertySet >& xProps,
-- const uno::Reference< drawing::XControlShape > xControlShape ) : m_xContext( xContext ),
-- m_xProps( xProps ), m_xControlShape( xControlShape )
--{
-- m_xEventListener.set( new ScVbaControlListener( this ) );
-- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
-- xComponent->addEventListener( m_xEventListener );
--}
--
--void ScVbaControl::SetControl( const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< ::drawing::XControlShape > xControlShape )
-+void
-+ScVbaControl::setGeometryHelper( AbstractGeometryAttributes* pHelper )
- {
-- m_xEventListener.set( new ScVbaControlListener( this ) );
-- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
-- m_xContext.set( xContext, uno::UNO_QUERY_THROW );
-- m_xControlShape.set( xControlShape, uno::UNO_QUERY_THROW );
-- //init m_xProps
-- uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl(), uno::UNO_QUERY_THROW );
-- uno::Reference< beans::XPropertySet > xProps( xControlModel, uno::UNO_QUERY_THROW );
-- m_xProps = xProps;
-+ mpGeometryHelper.reset( pHelper );
- }
-
--void ScVbaControl::SetControl( const uno::Reference< uno::XComponentContext > xContext,
-- const uno::Reference< beans::XPropertySet > xProps,
-- const uno::Reference< drawing::XControlShape > xControlShape )
-+void ScVbaControl::removeResouce() throw( uno::RuntimeException )
+ USHORT __EXPORT BasicIDEShell::PrepareClose( BOOL bUI, BOOL bForBrowsing )
{
-- m_xEventListener.set( new ScVbaControlListener( this ) );
-- uno::Reference< lang::XComponent > xComponent( m_xControlShape, uno::UNO_QUERY_THROW );
-- m_xContext.set( xContext, uno::UNO_QUERY_THROW );
-- m_xProps.set( xProps, uno::UNO_QUERY_THROW );
-- m_xControlShape.set( xControlShape, uno::UNO_QUERY_THROW );
-+ uno::Reference< lang::XComponent > xComponent( m_xControl, uno::UNO_QUERY_THROW );
-+ xComponent->removeEventListener( m_xEventListener );
-+ m_xControl= NULL;
-+ m_xProps = NULL;
+ (void)bForBrowsing;
+@@ -600,7 +679,6 @@ void BasicIDEShell::ShowObjectDialog( BO
}
- //In design model has different behavior
-@@ -194,132 +185,169 @@ void SAL_CALL ScVbaControl::setEnabled(
-
- sal_Bool SAL_CALL ScVbaControl::getVisible() throw (uno::RuntimeException)
- {
-- uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer( m_xControlShape ), uno::UNO_QUERY_THROW );
-+ uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW );
- return xWindow2->isVisible();
- }
- void SAL_CALL ScVbaControl::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
- {
-- uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer( m_xControlShape ), uno::UNO_QUERY_THROW );
-+ uno::Reference< awt::XWindow2 > xWindow2( getWindowPeer(), uno::UNO_QUERY_THROW );
- xWindow2->setVisible( bVisible );
- }
- double SAL_CALL ScVbaControl::getHeight() throw (uno::RuntimeException)
+-
+ void __EXPORT BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
+ const SfxHint& rHint, const TypeId& )
{
-- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
-- return mm2pt( xShape->getSize().Height ) / 100;
-+ return mpGeometryHelper->getHeight();
- }
- void SAL_CALL ScVbaControl::setHeight( double _height ) throw (uno::RuntimeException)
+@@ -983,7 +1061,15 @@ void BasicIDEShell::SetCurLib( const Scr
{
-- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
-- awt::Size aSize( xShape->getSize() );
-- aSize.Height = pt2mm( _height ) * 100;
-- xShape->setSize( aSize );
-+ mpGeometryHelper->setHeight( _height );
- }
+ if ( !bCheck || ( rDocument != m_aCurDocument || aLibName != m_aCurLibName ) )
+ {
++ ContainerListenerImpl* pListener = dynamic_cast< ContainerListenerImpl* >( m_xLibListener.get() );
++ if ( pListener )
++ pListener->removeContainerListener( m_aCurDocument );
++
+ m_aCurDocument = rDocument;
++
++ if ( pListener )
++ pListener->addContainerListener( m_aCurDocument );
++
+ m_aCurLibName = aLibName;
+ if ( bUpdateWindows )
+ UpdateWindows();
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/scriptdocument.cxx basctl/source/basicide/scriptdocument.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/scriptdocument.cxx 2007-10-09 16:24:54.000000000 +0100
++++ basctl/source/basicide/scriptdocument.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -61,6 +61,7 @@
+ #include <com/sun/star/frame/XModel2.hpp>
+ #include <com/sun/star/awt/XWindow2.hpp>
+ #include <com/sun/star/document/XEmbeddedScripts.hpp>
++#include <com/sun/star/script/ModuleInfo.hpp>
+ /** === end UNO includes === **/
- double SAL_CALL ScVbaControl::getWidth() throw (uno::RuntimeException)
- {
-- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
-- return mm2pt( xShape->getSize().Width ) / 100;
-+ return mpGeometryHelper->getWidth();
- }
- void SAL_CALL ScVbaControl::setWidth( double _width ) throw (uno::RuntimeException)
- {
-- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
-- awt::Size aSize( xShape->getSize() );
-- aSize.Width = pt2mm( _width ) * 100;
-- xShape->setSize( aSize );
-+ mpGeometryHelper->setWidth( _width );
- }
+ #include <sfx2/objsh.hxx>
+@@ -146,6 +147,7 @@ namespace basctl
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::document::XEventBroadcaster;
+ using ::com::sun::star::document::XEmbeddedScripts;
++ using ::com::sun::star::script::ModuleInfo;
+ /** === end UNO using === **/
+ namespace MacroExecMode = ::com::sun::star::document::MacroExecMode;
+ namespace FrameSearchFlag = ::com::sun::star::frame::FrameSearchFlag;
+@@ -678,6 +680,15 @@ namespace basctl
+ }
- double SAL_CALL
- ScVbaControl::getLeft() throw (uno::RuntimeException)
- {
-- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
-- return mm2pt( xShape->getPosition().X / 100 );
-+ return mpGeometryHelper->getLeft();
- }
+ // insert element by new name in container
++ if ( _eType == E_SCRIPTS )
++ {
++ ModuleInfo sModuleInfo;
++ if ( aElement >>= sModuleInfo )
++ {
++ sModuleInfo.ModuleName = _rNewName;
++ aElement <<= sModuleInfo;
++ }
++ }
+ xLib->insertByName( _rNewName, aElement );
+ return true;
+ }
+@@ -1433,7 +1444,15 @@ namespace basctl
+ Any aCode;
+ if ( !m_pImpl->getModuleOrDialog( E_SCRIPTS, _rLibName, _rModName, aCode ) )
+ return false;
+- OSL_VERIFY( aCode >>= _out_rModuleSource );
++ ModuleInfo sModuleInfo;
++ if ( aCode >>= sModuleInfo )
++ {
++ _out_rModuleSource = sModuleInfo.ModuleSource;
++ }
++ else
++ {
++ OSL_VERIFY( aCode >>= _out_rModuleSource );
++ }
+ return true;
+ }
- void SAL_CALL
- ScVbaControl::setLeft( double _left ) throw (uno::RuntimeException)
- {
-- awt::Point oldPosition;
-- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
-- oldPosition = xShape->getPosition();
-- oldPosition.X = pt2mm( _left ) * 100;
-- xShape->setPosition( oldPosition );
-+ mpGeometryHelper->setLeft( _left );
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/inc/basidesh.hxx basctl/source/inc/basidesh.hxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/inc/basidesh.hxx 2007-10-09 16:25:06.000000000 +0100
++++ basctl/source/inc/basidesh.hxx 2008-03-28 10:30:34.000000000 +0000
+@@ -62,7 +62,7 @@
+ #ifndef _COM_SUN_STAR_IO_XINPUTSTREAMPROVIDER_HXX_
+ #include <com/sun/star/io/XInputStreamProvider.hpp>
+ #endif
+-
++#include <com/sun/star/container/XContainerListener.hpp>
- }
+ //----------------------------------------------------------------------------
- double SAL_CALL
- ScVbaControl::getTop() throw (uno::RuntimeException)
- {
-- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
-- return mm2pt( xShape->getPosition().Y / 100 );
-+ return mpGeometryHelper->getTop();
- }
+@@ -90,13 +90,15 @@ DECLARE_TABLE( IDEWindowTable, IDEBaseWi
+ typedef Table IDEWindowTable;
+ #endif
- void SAL_CALL
- ScVbaControl::setTop( double _top ) throw (uno::RuntimeException)
- {
-- awt::Point oldPosition;
-- uno::Reference< drawing::XShape > xShape( m_xControlShape, uno::UNO_QUERY_THROW );
-- oldPosition = xShape->getPosition();
-- oldPosition.Y = pt2mm( _top ) * 100;;
-- xShape->setPosition( oldPosition );
-+ mpGeometryHelper->setTop( _top );
-+}
++namespace css = ::com::sun::star;
+
-+void SAL_CALL ScVbaControl::SetFocus() throw (uno::RuntimeException)
-+{
-+ uno::Reference< awt::XWindow > xWin( m_xControl, uno::UNO_QUERY_THROW );
-+ xWin->setFocus();
- }
-
- //ScVbaControlFactory
-
--ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XControlShape >& xControlShape ): m_xContext( xContext ), m_xControlShape( xControlShape )
-+ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl ): m_xContext( xContext ), m_xControl( xControl )
- {
-- uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl(), uno::UNO_QUERY_THROW );
-- uno::Reference< beans::XPropertySet > xProps( xControlModel, uno::UNO_QUERY_THROW );
-- m_xProps.set( xProps, uno::UNO_QUERY_THROW );
- }
-
--ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< beans::XPropertySet >& xProps, const uno::Reference< drawing::XControlShape > xControlShape ): m_xContext( xContext ), m_xProps( xProps ), m_xControlShape( xControlShape )
-+ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< uno::XInterface >& xParent ) throw (uno::RuntimeException)
+ class BasicIDEShell :public SfxViewShell
+ ,public ::basctl::DocumentEventListener
{
-+ 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 );
-+
- }
+ friend class JavaDebuggingListenerImpl;
+ friend class LocalizationMgr;
+ friend class BasicIDE;
+-
++friend class ContainerListenerImpl;
+ ObjectCatalog* pObjectCatalog;
--ScVbaControl* ScVbaControlFactory::createControl( const sal_Int16 nClassId ) throw (uno::RuntimeException)
-+ScVbaControl* ScVbaControlFactory::createControl(const uno::Reference< drawing::XControlShape >& xControlShape, const uno::Reference< uno::XInterface >& /*xParent*/ ) throw (uno::RuntimeException)
- {
-+ 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;
- switch( nClassId )
- {
- case form::FormComponentType::COMBOBOX:
-- return new ScVbaComboBox( m_xContext, m_xProps, m_xControlShape );
-+ return new ScVbaComboBox( m_xContext, xControlShape );
- case form::FormComponentType::COMMANDBUTTON:
-- return new ScVbaButton( m_xContext, m_xControlShape );
-+ return new ScVbaButton( m_xContext, xControlShape );
- case form::FormComponentType::FIXEDTEXT:
-- return new ScVbaLabel( m_xContext, m_xControlShape );
-+ return new ScVbaLabel( m_xContext, xControlShape );
- case form::FormComponentType::TEXTFIELD:
-- return new ScVbaTextBox( m_xContext, m_xControlShape );
-+ return new ScVbaTextBox( m_xContext, xControlShape );
- case form::FormComponentType::RADIOBUTTON:
-- return new ScVbaRadioButton( m_xContext, m_xControlShape );
-+ return new ScVbaRadioButton( m_xContext, xControlShape );
- case form::FormComponentType::LISTBOX:
-- return new ScVbaListBox( m_xContext, m_xControlShape );
-+ return new ScVbaListBox( m_xContext, xControlShape );
- default:
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "Donot surpport this Control Type." ), uno::Reference< uno::XInterface >() );
- }
- }
+ IDEWindowTable aIDEWindowTable;
+@@ -116,6 +118,7 @@ friend class BasicIDE;
+ BOOL m_bAppBasicModified;
+ ::basctl::DocumentEventNotifier
+ m_aNotifier;
++ css::uno::Reference< css::container::XContainerListener > m_xLibListener;
--ScVbaControl* ScVbaControlFactory::createControl() throw (uno::RuntimeException)
-+ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< awt::XControl >& xControl, const uno::Reference< uno::XInterface >& xParent ) throw (uno::RuntimeException)
- {
-- sal_Int32 nClassId = -1;
-- const static rtl::OUString sClassId( RTL_CONSTASCII_USTRINGPARAM("ClassId") );
-- m_xProps->getPropertyValue( sClassId ) >>= nClassId;
-- switch( nClassId )
-+ uno::Reference< beans::XPropertySet > xProps( xControl->getModel(), uno::UNO_QUERY_THROW );
-+ uno::Reference< lang::XServiceInfo > xServiceInfo( xProps, uno::UNO_QUERY_THROW );
-+ ScVbaControl* pControl = NULL;
-+ // #FIXME we should ( I guess ) be able to have a single point of creation for
-+ // the controls. I'll clean that up later
-+ if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCheckBoxModel") ) ) )
-+ pControl = new ScVbaCheckbox( m_xContext, xControl );
-+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ) ) )
-+ pControl = new ScVbaRadioButton( m_xContext, xControl );
-+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlEditModel") ) ) )
-+ pControl = new ScVbaTextBox( m_xContext, xControl, true );
-+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlButtonModel") ) ) )
- {
-- case form::FormComponentType::COMBOBOX:
-- return new ScVbaComboBox( m_xContext, m_xControlShape );
-- case form::FormComponentType::COMMANDBUTTON:
-- return new ScVbaButton( m_xContext, m_xControlShape );
-- case form::FormComponentType::FIXEDTEXT:
-- return new ScVbaLabel( m_xContext, m_xControlShape );
-- case form::FormComponentType::TEXTFIELD:
-- return new ScVbaTextBox( m_xContext, m_xControlShape );
-- case form::FormComponentType::RADIOBUTTON:
-- return new ScVbaRadioButton( m_xContext, m_xControlShape );
-- case form::FormComponentType::LISTBOX:
-- return new ScVbaListBox( m_xContext, m_xControlShape );
-- default:
-- throw uno::RuntimeException( rtl::OUString::createFromAscii(
-- "Donot surpport this Control Type." ), uno::Reference< uno::XInterface >() );
-+ sal_Bool bToggle = sal_False;
-+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Toggle") ) ) >>= bToggle;
-+ if ( bToggle )
-+ pControl = new ScVbaToggleButton( m_xContext, xControl );
-+ else
-+ pControl = new ScVbaButton( m_xContext, xControl );
- }
-+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlComboBoxModel") ) ) )
-+ pControl = new ScVbaComboBox( m_xContext, xControl, true );
-+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) ) )
-+ pControl = new ScVbaListBox( m_xContext, xControl );
-+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedTextModel") ) ) )
-+ pControl = new ScVbaLabel( m_xContext, xControl );
-+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlImageControlModel") ) ) )
-+ //pControl = new ScVbaImage( m_xContext, xControl );
-+ throw uno::RuntimeException();
-+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ) )
-+ pControl = new ScVbaProgressBar( m_xContext, xControl );
-+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ) )
-+ pControl = new ScVbaFrame( m_xContext, xControl );
-+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ) ) )
-+ pControl = new ScVbaScrollBar( m_xContext, xControl );
-+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ) )
-+ pControl = new ScVbaMultiPage( m_xContext, xControl, xParent );
-+ 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("ScVbaContro") );
-+ return sImplName;
-+}
-+
-+uno::Sequence< rtl::OUString >
-+ScVbaControl::getServiceNames()
-+{
-+ static uno::Sequence< rtl::OUString > aServiceNames;
-+ if ( aServiceNames.getLength() == 0 )
-+ {
-+ aServiceNames.realloc( 1 );
-+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Control" ) );
-+ }
-+ return aServiceNames;
- }
-+
-+
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbacontrol.hxx 2007-12-07 10:50:07.000000000 +0000
-+++ sc/source/ui/vba/vbacontrol.hxx 2008-04-11 16:03:53.000000000 +0100
-@@ -40,40 +40,33 @@
- #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 <org/openoffice/msforms/XControl.hpp>
+ #if _SOLAR__PRIVATE
+ void Init();
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbdef.hxx basic/inc/basic/sbdef.hxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbdef.hxx 2007-04-11 13:51:38.000000000 +0100
++++ basic/inc/basic/sbdef.hxx 2008-03-28 10:30:34.000000000 +0000
+@@ -100,6 +100,8 @@ void setBasicWatchMode( bool bOn );
- #include "vbahelper.hxx"
-+#include "vbahelperinterface.hxx"
+ #define SBXID_BASIC 0x6273 // sb: StarBASIC
+ #define SBXID_BASICMOD 0x6d62 // bm: StarBASIC-Modul
++#define SBXID_DOCUMENTMOD 0x6d63 // Special document Module
++#define SBXID_USERFORMMOD 0x6d64 // Special userform Module
+ #define SBXID_BASICPROP 0x7262 // pr: StarBASIC-Property
+ #define SBXID_BASICMETHOD 0x6d65 // me: StarBASIC-Methode
+ #define SBXID_JSCRIPTMOD 0x6a62 // jm: JavaScript-Modul
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbstar.hxx basic/inc/basic/sbstar.hxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbstar.hxx 2007-08-30 10:58:14.000000000 +0100
++++ basic/inc/basic/sbstar.hxx 2008-03-28 10:30:34.000000000 +0000
+@@ -51,6 +51,7 @@
--typedef ::cppu::WeakImplHelper1< oo::msforms::XControl > ControlImpl_BASE;
-+//typedef ::cppu::WeakImplHelper1< oo::msforms::XControl > ControlImpl_BASE;
-+typedef InheritedHelperInterfaceImpl1< oo::msforms::XControl > ControlImpl_BASE;
+ #include <basic/sbdef.hxx>
+ #include <basic/sberrors.hxx>
++#include <com/sun/star/script/ModuleInfo.hpp>
- class ScVbaControl : public ControlImpl_BASE
- {
--/* this will cause error when the sheet is invisible.
- private:
-- css::uno::Reference< css::awt::XWindowPeer > m_xWindowPeer;
--*/
--private:
-- css::uno::Reference< css::awt::XWindowPeer > getWindowPeer( const css::uno::Reference< css::drawing::XControlShape >& xControlShape ) throw (css::uno::RuntimeException);
- com::sun::star::uno::Reference< com::sun::star::lang::XEventListener > m_xEventListener;
+ class SbModule; // fertiges Modul
+ class SbiInstance; // Laufzeit-Instanz
+@@ -82,6 +83,7 @@ class StarBASIC : public SbxObject
+ BOOL bNoRtl; // TRUE: RTL nicht durchsuchen
+ BOOL bBreak; // TRUE: Break, sonst Step
+ BOOL bDocBasic;
++ BOOL bVBAEnabled;
+ BasicLibInfo* pLibInfo; // Infoblock fuer Basic-Manager
+ SbLanguageMode eLanguageMode; // LanguageMode des Basic-Objekts
protected:
-- css::uno::Reference< css::uno::XComponentContext > m_xContext;
-+ std::auto_ptr< oo::AbstractGeometryAttributes > mpGeometryHelper;
- css::uno::Reference< css::beans::XPropertySet > m_xProps;
-- css::uno::Reference< css::drawing::XControlShape > m_xControlShape;
--protected:
-- ScVbaControl(){ m_xContext = 0; m_xProps = 0; m_xControlShape = 0; }
-- void SetControl( const css::uno::Reference< css::uno::XComponentContext > xContext,
-- const css::uno::Reference< css::drawing::XControlShape > xControlShape );
-- void SetControl( const css::uno::Reference< css::uno::XComponentContext > xContext,
-- const css::uno::Reference< css::beans::XPropertySet > xProps,
-- const css::uno::Reference< css::drawing::XControlShape > xControlShape );
-+ css::uno::Reference< css::uno::XInterface > m_xControl;
-+
-+ virtual css::uno::Reference< css::awt::XWindowPeer > getWindowPeer() throw (css::uno::RuntimeException);
- public:
- ScVbaControl( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
-- ScVbaControl( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::beans::XPropertySet >& xProps,
-- const css::uno::Reference< css::drawing::XControlShape > xControlShape );
-+ const css::uno::Reference< css::uno::XInterface >& xControl);
- virtual ~ScVbaControl();
-+ // This class will own the helper, so make sure it is allocated from
-+ // the heap
-+ void setGeometryHelper( oo::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);
-@@ -87,9 +80,14 @@ public:
- 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);
-+
-
- //remove resouce because org.openoffice.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();
- };
-
+@@ -124,7 +126,8 @@ public:
-@@ -97,16 +95,13 @@ class ScVbaControlFactory
- {
- public:
- ScVbaControlFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
-- ScVbaControlFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::beans::XPropertySet >& xProps,
-- const css::uno::Reference< css::drawing::XControlShape > xControlShape );
-- ScVbaControl* createControl( const sal_Int16 nClassID ) throw ( css::uno::RuntimeException );
-- ScVbaControl* createControl() throw ( css::uno::RuntimeException );
-+ const css::uno::Reference< css::uno::XInterface >& xControl );
-+ 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::beans::XPropertySet > m_xProps;
-- css::uno::Reference< css::drawing::XControlShape > m_xControlShape;
-+ css::uno::Reference< css::uno::XInterface > m_xControl;
- };
+ // Compiler-Interface
+ SbModule* MakeModule( const String& rName, const String& rSrc );
+- SbModule* MakeModule32( const String& rName, const ::rtl::OUString& rSrc );
++ SbModule* MakeModule32( const String& rName, const ::rtl::OUString& rSrc );
++ SbModule* MakeObjModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo );
+ BOOL Compile( SbModule* );
+ BOOL Disassemble( SbModule*, String& rText );
+ static void Stop();
+@@ -196,6 +199,8 @@ public:
+ ( const String& rName, USHORT& rStatus );
+ static SbMethod* GetActiveMethod( USHORT nLevel = 0 );
+ static SbModule* GetActiveModule();
++ void SetVBAEnabled( BOOL bEnabled );
++ BOOL isVBAEnabled();
- #endif//SC_VBA_CONTROL_HXX
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbahelper.cxx sc/source/ui/vba/vbahelper.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbahelper.cxx 2008-03-29 23:07:54.000000000 +0000
-+++ sc/source/ui/vba/vbahelper.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -42,6 +42,7 @@
- #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>
-
-@@ -62,6 +62,7 @@
- #include "tabvwsh.hxx"
- #include "transobj.hxx"
- #include "scmod.hxx"
-+#include "vbashape.hxx"
+ // #60175 TRUE: SFX-Resource wird bei Basic-Fehlern nicht angezogen
+ static void StaticSuppressSfxResource( BOOL bSuppress );
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbxobj.hxx basic/inc/basic/sbxobj.hxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbxobj.hxx 2007-04-11 13:55:16.000000000 +0100
++++ basic/inc/basic/sbxobj.hxx 2008-03-28 10:30:34.000000000 +0000
+@@ -80,7 +80,7 @@ public:
+ virtual SbxClassType GetClass() const;
+ virtual void Clear();
- using namespace ::com::sun::star;
- using namespace ::org::openoffice;
-@@ -80,6 +81,18 @@ namespace openoffice
+- virtual BOOL IsClass( const String& ) const;
++ virtual BOOL IsClass( const String& );
+ const String& GetClassName() const { return aClassName; }
+ void SetClassName( const String &rNew ) { aClassName = rNew; }
+ // Default-Property
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/basmgr/basmgr.cxx basic/source/basmgr/basmgr.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/basmgr/basmgr.cxx 2007-08-30 10:58:48.000000000 +0100
++++ basic/source/basmgr/basmgr.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -102,6 +102,8 @@
+ #include <com/sun/star/script/XStarBasicDialogInfo.hpp>
+ #include <com/sun/star/script/XStarBasicLibraryInfo.hpp>
+ #include <com/sun/star/script/XLibraryContainerPassword.hpp>
++#include <com/sun/star/script/ModuleInfo.hpp>
++#include <com/sun/star/script/ModuleType.hpp>
- const double Millimeter::factor = 35.27778;
+ #include <cppuhelper/implbase1.hxx>
-+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)
- {
-@@ -770,5 +771,10 @@ double PixelsToPoints( css::uno::Referen
- return (fPixels/fConvertFactor)/POINTTO100THMILLIMETERFACTOR;
- }
+@@ -145,6 +147,7 @@ static const char* szScriptLanguage = "S
+ static const String BasicStreamName( String::CreateFromAscii(szBasicStorage) );
+ static const String ManagerStreamName( String::CreateFromAscii(szManagerStream) );
-+ConcreteXShapeGeometryAttributes::ConcreteXShapeGeometryAttributes( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape )
-+{
-+ m_xShape = new ScVbaShape( xContext, xShape );
-+}
-+
- } // openoffice
- } //org
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbahelper.hxx sc/source/ui/vba/vbahelper.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbahelper.hxx 2008-03-29 23:07:54.000000000 +0000
-+++ sc/source/ui/vba/vbahelper.hxx 2008-03-28 10:30:34.000000000 +0000
-@@ -36,6 +36,7 @@
- #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>
-@@ -45,6 +45,7 @@
- #include <com/sun/star/frame/XModel.hpp>
- #include <docsh.hxx>
- #include <sfx2/dispatch.hxx>
-+#include <org/openoffice/msforms/XShape.hpp>
-
- namespace css = ::com::sun::star;
-
-@@ -63,6 +64,7 @@ namespace org
- throw css::lang::IllegalArgumentException();
- return aSomething;
++//enum ModuleType { Unknown = 0, Normal, Class, Form, Document };
+
+ #define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII))
+
+@@ -280,9 +283,22 @@ void BasMgrContainerListenerImpl::addLib
+ {
+ OUString aModuleName = pNames[ j ];
+ Any aElement = xLibNameAccess->getByName( aModuleName );
++ ModuleInfo mInfo;
+ OUString aMod;
+- aElement >>= aMod;
+- pLib->MakeModule32( aModuleName, aMod );
++ sal_Int16 mType;
++ if ( aElement >>= mInfo )
++ {
++ aMod = mInfo.ModuleSource;
++ mType = mInfo.ModuleType;
++ OSL_TRACE("#1 - aMod");
++ //pLib->MakeModule32( aModuleName, aMod, SBXID_DOCUMENTMOD );
++ pLib->MakeObjModule( aModuleName, mInfo );
++ }
++ else
++ {
++ aElement >>= aMod;
++ pLib->MakeModule32( aModuleName, aMod );
++ }
}
-+ 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) ;
-@@ -145,6 +146,62 @@ public:
- return points;
+@@ -319,8 +335,16 @@ void SAL_CALL BasMgrContainerListenerImp
}
- };
-+
-+class AbstractGeometryAttributes // probably should replace the ShapeHelper below
-+{
-+public:
-+ 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< org::openoffice::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 );
-+ }
-+
-+
-+};
-+
- class ShapeHelper
- {
- protected:
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbalabel.cxx 2008-04-03 11:33:30.000000000 +0100
-+++ sc/source/ui/vba/vbalabel.cxx 2008-04-02 16:52:20.000000000 +0100
-@@ -40,7 +40,7 @@ using namespace org::openoffice;
+ else
+ {
++ ModuleInfo mInfo;
+ OUString aMod;
+- Event.Element >>= aMod;
++ sal_Int16 mType;
++ if( Event.Element >>= mInfo )
++ {
++ aMod = mInfo.ModuleSource;
++ mType = mInfo.ModuleType;
++ }
++ else
++ Event.Element >>= aMod;
+ StarBASIC* pLib = mpMgr->GetLib( maLibName );
+ DBG_ASSERT( pLib, "BasMgrContainerListenerImpl::elementInserted: Unknown lib!");
+@@ -329,7 +353,15 @@ void SAL_CALL BasMgrContainerListenerImp
+ SbModule* pMod = pLib->FindModule( aName );
+ if( !pMod )
+ {
+- pLib->MakeModule32( aName, aMod );
++ if ( mType == ::com::sun::star::script::ModuleType::Document )
++ {
++ //pLib->MakeModule32( aName, aMod, SBXID_DOCUMENTMOD );
++ pLib->MakeObjModule( aName, mInfo );
++ }
++ else
++ {
++ pLib->MakeModule32( aName, aMod );
++ }
+ pLib->SetModified( FALSE );
+ }
+ }
+@@ -356,12 +388,27 @@ void SAL_CALL BasMgrContainerListenerImp
+ if( pLib )
+ {
+ SbModule* pMod = pLib->FindModule( aName );
++ ModuleInfo mInfo;
+ OUString aMod;
++ sal_Int16 mType;
+ Event.Element >>= aMod;
+ if( pMod )
+ pMod->SetSource32( aMod );
+ else
+- pLib->MakeModule32( aName, aMod );
++ {
++ if( Event.Element >>= mInfo )
++ {
++ aMod = mInfo.ModuleSource;
++ mType = mInfo.ModuleType;
++ //pLib->MakeModule32( aName, aMod, SBXID_DOCUMENTMOD );
++ pLib->MakeObjModule( aName, mInfo );
++ }
++ else
++ {
++ Event.Element >>= aMod;
++ pLib->MakeModule32( aName, aMod );
++ }
++ }
- const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
--ScVbaLabel::ScVbaLabel( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : LabelImpl_BASE( xContext, xControlShape )
-+ScVbaLabel::ScVbaLabel( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl ) : LabelImpl_BASE( xContext, xControl )
- {
- }
+ pLib->SetModified( FALSE );
+ }
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/classes/sb.cxx basic/source/classes/sb.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/classes/sb.cxx 2008-03-29 23:08:18.000000000 +0000
++++ basic/source/classes/sb.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -70,6 +70,7 @@
+ #include "disas.hxx"
+ #include "runtime.hxx"
+ #include <basic/sbuno.hxx>
++#include <basic/sbobjmod.hxx>
+ #include "stdobj.hxx"
+ #include "filefmt.hxx"
+ #include "sb.hrc"
+@@ -79,6 +80,10 @@
+ #include <vos/mutex.hxx>
+ #endif
-@@ -58,3 +58,36 @@ ScVbaLabel::setCaption( const rtl::OUStr
- {
- m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
- }
-+uno::Any SAL_CALL
-+ScVbaLabel::getValue() throw (css::uno::RuntimeException)
-+{
-+ return uno::makeAny( getCaption() );
-+}
-+
-+void SAL_CALL
-+ScVbaLabel::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
-+{
-+ rtl::OUString sCaption;
-+ _value >>= sCaption;
-+ setCaption( sCaption );
-+}
-+
-+
-+rtl::OUString&
-+ScVbaLabel::getServiceImplName()
-+{
-+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaLabel") );
-+ return sImplName;
-+}
++#include <com/sun/star/script/ModuleType.hpp>
++#include <com/sun/star/script/ModuleInfo.hpp>
++using namespace ::com::sun::star::script;
+
-+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("org.openoffice.msforms.Label" ) );
-+ }
-+ return aServiceNames;
-+}
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbalabel.hxx 2008-04-03 11:33:30.000000000 +0100
-+++ sc/source/ui/vba/vbalabel.hxx 2008-04-02 16:55:04.000000000 +0100
-@@ -39,16 +39,24 @@
-
- #include "vbacontrol.hxx"
- #include "vbahelper.hxx"
-+#include <cppuhelper/implbase2.hxx>
-
--typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XLabel > LabelImpl_BASE;
-+typedef cppu::ImplInheritanceHelper2< ScVbaControl, oo::msforms::XLabel, css::script::XDefaultProperty > LabelImpl_BASE;
-
- class ScVbaLabel : public LabelImpl_BASE
- {
- public:
- ScVbaLabel( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
-+ const css::uno::Reference< css::uno::XInterface >& xControl );
- // 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
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbalistbox.cxx 2008-04-03 11:33:30.000000000 +0100
-+++ sc/source/ui/vba/vbalistbox.cxx 2008-04-02 17:21:07.000000000 +0100
-@@ -42,31 +42,49 @@
- using namespace com::sun::star;
- using namespace org::openoffice;
-
--const static rtl::OUString CONTROLSOURCEPROP( RTL_CONSTASCII_USTRINGPARAM("DataFieldProperty") );
-+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") );
+ // #pragma SW_SEGMENT_CLASS( SBASIC, SBASIC_CODE )
+ SV_IMPL_VARARR(SbTextPortions,SbTextPortion)
+@@ -667,6 +672,7 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL
+ SetParent( p );
+ pLibInfo = NULL;
+ bNoRtl = bBreak = FALSE;
++ bVBAEnabled = FALSE;
+ pModules = new SbxArray;
--ScVbaListBox::ScVbaListBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : ListBoxImpl_BASE( xContext, xControlShape )
-+ScVbaListBox::ScVbaListBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::uno::XInterface >& xControl ) : ListBoxImpl_BASE( xContext, xControl )
- {
-- // grab the default value property name
-- m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
- }
+ if( !GetSbData()->nInst++ )
+@@ -769,13 +775,36 @@ SbModule* StarBASIC::MakeModule( const S
--ScVbaListBox::ScVbaListBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< beans::XPropertySet >& xPropSet, const css::uno::Reference< css::drawing::XControlShape > xControlShape ) : ListBoxImpl_BASE( xContext, xPropSet, xControlShape )
-+// Attributes
-+void SAL_CALL
-+ScVbaListBox::setListIndex( const uno::Any& _value ) throw (uno::RuntimeException)
+ SbModule* StarBASIC::MakeModule32( const String& rName, const ::rtl::OUString& rSrc )
{
-- m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
-+ sal_Int32 nIndex = 0;
-+ _value >>= nIndex;
-+ Selected( nIndex );
+- SbModule* p = new SbModule( rName );
++ SbModule* p = new SbModule( rName );
+ p->SetSource32( rSrc );
+ p->SetParent( this );
+ pModules->Insert( p, pModules->Count() );
+ SetModified( TRUE );
+ return p;
}
-
-+uno::Any SAL_CALL
-+ScVbaListBox::getListIndex() throw (uno::RuntimeException)
++SbModule* StarBASIC::MakeObjModule( const String& rName, const ModuleInfo& mInfo )
+{
-+ 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 ] );
++
++ SbObjModule* p = NULL;
++ switch ( mInfo.ModuleType )
++ {
++ case ModuleType::Document:
++ p = new SbObjModule( rName, mInfo );
++ break;
++ case ModuleType::Form:
++ p = new SbUserFormModule( rName, mInfo );
++ break;
++ default:
++ break; //
++ }
++ if ( p )
++ {
++ pModules->Insert( p, pModules->Count() );
++ SetModified( TRUE );
++ p->SetParent( this );
++ }
++ return p;
+}
--// Attributes
- 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::Reference< form::validation::XValidatableFormComponent > xValidatableFormComponent( m_xProps, uno::UNO_QUERY_THROW );
-- return xValidatableFormComponent->getCurrentValue();
-+ uno::Any aRet;
-+ if ( sSelection.getLength() )
-+ aRet = uno::makeAny( sItems[ sSelection[ 0 ] ] );
-+ return aRet;
- }
-
- void SAL_CALL
-@@ -96,18 +114,17 @@ ScVbaListBox::setValue( const uno::Any&
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
-
-- nList.realloc( 1 );
-- nList[0] = nValue;
--
-- m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
-+ uno::Sequence< sal_Int16 > nSelectedIndices(1);
-+ nSelectedIndices[ 0 ] = nValue;
-+ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nSelectedIndices ) );
-+ m_xProps->setPropertyValue( TEXT, uno::makeAny( sValue ) );
- }
-
- ::rtl::OUString SAL_CALL
- ScVbaListBox::getText() throw (uno::RuntimeException)
- {
- rtl::OUString result;
-- uno::Reference< form::validation::XValidatableFormComponent > xValidatableFormComponent( m_xProps, uno::UNO_QUERY_THROW );
-- xValidatableFormComponent->getCurrentValue() >>= result;
-+ getValue() >>= result;
- return result;
- }
-
-@@ -130,29 +147,7 @@ ScVbaListBox::setMultiSelect( sal_Bool _
- {
- m_xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiSelection" ) ), uno::makeAny( _multiselect ) );
- }
--/*
--css::uno::Sequence< sal_Bool > SAL_CALL
--ScVbaListBox::getSelected() throw (css::uno::RuntimeException)
--{
-- uno::Sequence< rtl::OUString > sList;
-- uno::Sequence< sal_Int16 > nList;
-- m_xProps->getPropertyValue( ITEMS ) >>= sList;
-- uno::Sequence< sal_Bool > bSelected( sList.getLength() );
-- for( sal_Int16 i = 0; i < bSelected.getLength(); i++ )
-- bSelected[i] = sal_False;
-- m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) ) ) >>= nList;
-- for( sal_Int16 i = 0; i < nList.getLength(); i++ )
-- {
-- bSelected[nList[i]] = sal_True;
-- }
-- return bSelected;
--}
-
--void SAL_CALL
--ScVbaListBox::setSelected( const css::uno::Sequence< sal_Bool >& _selected ) throw (css::uno::RuntimeException)
--{
--}
--*/
- css::uno::Any SAL_CALL
- ScVbaListBox::Selected( sal_Int32 index ) throw (css::uno::RuntimeException)
+ void StarBASIC::Insert( SbxVariable* pVar )
{
-@@ -230,6 +225,10 @@ ScVbaListBox::Clear( ) throw (uno::Runt
- //setValue( uno::makeAny( sal_Int16() ) );
- m_xProps->setPropertyValue( ITEMS, uno::makeAny( uno::Sequence< rtl::OUString >() ) );
- }
-+
-+// 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 )
-@@ -239,7 +238,7 @@ ScVbaListBox::setValueEvent( const uno::
- throw uno::RuntimeException( rtl::OUString::createFromAscii(
- "Invalid type\n. need boolean." ), uno::Reference< uno::XInterface >() );
- uno::Sequence< sal_Int16 > nList;
-- m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectedItems" ) ) ) >>= 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++ )
-@@ -255,7 +254,8 @@ ScVbaListBox::setValueEvent( const uno::
- nList[i] = nList[i + 1];
- }
- nList.realloc( nLength - 1 );
-- m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
-+ //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) );
-+ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( nList ) );
- return;
- }
- }
-@@ -276,6 +276,10 @@ ScVbaListBox::setValueEvent( const uno::
- }
- }
-
-+// 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()
- {
-@@ -292,3 +296,22 @@ ScVbaListBox::getValueEvent()
-
- return uno::makeAny( sal_False );
- }
-+
-+rtl::OUString&
-+ScVbaListBox::getServiceImplName()
-+{
-+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaListBox") );
-+ return sImplName;
-+}
-+
-+uno::Sequence< rtl::OUString >
-+ScVbaListBox::getServiceNames()
-+{
-+ static uno::Sequence< rtl::OUString > aServiceNames;
-+ if ( aServiceNames.getLength() == 0 )
-+ {
-+ aServiceNames.realloc( 1 );
-+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.ScVbaListBox" ) );
-+ }
-+ return aServiceNames;
-+}
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbalistbox.hxx 2008-04-03 11:33:30.000000000 +0100
-+++ sc/source/ui/vba/vbalistbox.hxx 2008-04-02 16:19:38.000000000 +0100
-@@ -55,13 +55,11 @@ class ScVbaListBox : public ListBoxImpl_
-
- public:
- ScVbaListBox( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
-- ScVbaListBox( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::beans::XPropertySet >& xProps,
-- const css::uno::Reference< css::drawing::XControlShape> xControlShape );
--
-+ const css::uno::Reference< css::uno::XInterface >& xControl );
-
- // 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 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);
-@@ -77,7 +75,11 @@ public:
-
- // 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();
-+
- //PropListener
- virtual void setValueEvent( const css::uno::Any& value );
- virtual css::uno::Any getValueEvent();
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbaradiobutton.hxx 2008-04-03 11:33:30.000000000 +0100
-+++ sc/source/ui/vba/vbaradiobutton.hxx 2008-04-02 19:47:50.000000000 +0100
-@@ -34,24 +34,28 @@
- ************************************************************************/
- #ifndef SC_VBA_RADIOBUTTON_HXX
- #define SC_VBA_RADIOBUTTON_HXX
--#include <cppuhelper/implbase1.hxx>
- #include <org/openoffice/msforms/XRadioButton.hpp>
--
- #include "vbacontrol.hxx"
- #include "vbahelper.hxx"
-+#include <cppuhelper/implbase2.hxx>
-
--typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XRadioButton > RadioButtonImpl_BASE;
-+typedef cppu::ImplInheritanceHelper2< ScVbaControl, oo::msforms::XRadioButton, css::script::XDefaultProperty > RadioButtonImpl_BASE;
-
- class ScVbaRadioButton : public RadioButtonImpl_BASE
- {
- public:
- ScVbaRadioButton( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
-+ const css::uno::Reference< css::uno::XInterface >& xControl );
- // 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 sal_Bool SAL_CALL getValue() throw (css::uno::RuntimeException);
-- virtual void SAL_CALL setValue( sal_Bool _value ) 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
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbaradiobutton.cxx 2008-04-03 12:30:43.000000000 +0100
-+++ sc/source/ui/vba/vbaradiobutton.cxx 2008-04-02 22:48:26.000000000 +0100
-@@ -41,7 +41,7 @@ using namespace org::openoffice;
-
- const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
- const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") );
--ScVbaRadioButton::ScVbaRadioButton( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : RadioButtonImpl_BASE( xContext, xControlShape )
-+ScVbaRadioButton::ScVbaRadioButton( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl ) : RadioButtonImpl_BASE( xContext, xControl )
- {
- }
+@@ -948,6 +977,9 @@ SbxVariable* StarBASIC::Find( const Stri
+ }
+ pNamed = p;
+ }
++ if ( p->GetSbxId() == SBXID_DOCUMENTMOD
++ || p->GetSbxId() == SBXID_USERFORMMOD )
++ continue;
+ // Sonst testen, ob das Element vorhanden ist
+ // GBLSEARCH-Flag rausnehmen (wg. Rekursion)
+ USHORT nGblFlag = p->GetFlags() & SBX_GBLSEARCH;
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/classes/sbxmod.cxx 2008-04-08 12:03:51.000000000 +0100
++++ basic/source/classes/sbxmod.cxx 2008-04-06 21:34:40.000000000 +0100
+@@ -62,6 +62,9 @@
+ #include "sbunoobj.hxx"
+ #include <basic/hilight.hxx>
+ #include <basic/basrdll.hxx>
++#include <basic/sbobjmod.hxx>
++#include <com/sun/star/script/XObjectProvider.hpp>
++#include <com/sun/star/lang/XServiceInfo.hpp>
-@@ -60,22 +60,53 @@ ScVbaRadioButton::setCaption( const rtl:
- m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
- }
+ #ifndef _VOS_MUTEX_HXX_
+ #include <vos/mutex.hxx>
+@@ -80,7 +83,20 @@
--sal_Bool SAL_CALL
-+uno::Any SAL_CALL
- ScVbaRadioButton::getValue() throw (css::uno::RuntimeException)
- {
-- sal_Bool bValue = sal_False;
- sal_Int16 nValue = -1;
- m_xProps->getPropertyValue( STATE ) >>= nValue;
- if( nValue != 0 )
-- bValue = sal_True;
-- return bValue;
-+ 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 );
-+
- }
+ #include <stdio.h>
- void SAL_CALL
--ScVbaRadioButton::setValue( sal_Bool _value ) throw (css::uno::RuntimeException)
-+ScVbaRadioButton::setValue( const uno::Any& _value ) throw (uno::RuntimeException)
- {
- sal_Int16 nValue = 0;
-- if( _value )
-- nValue = 1;
-+ 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 ) );
- }
++#include <comphelper/processfactory.hxx>
++#include <com/sun/star/script/XLibraryContainer.hpp>
++#include <com/sun/star/lang/XMultiServiceFactory.hpp>
++#include <com/sun/star/awt/XDialogProvider.hpp>
++#include <com/sun/star/awt/XTopWindow.hpp>
++#include <com/sun/star/awt/XControl.hpp>
++#include <com/sun/star/frame/XModel.hpp>
++#include <cppuhelper/implbase1.hxx>
++#include <comphelper/anytostring.hxx>
+
-+rtl::OUString&
-+ScVbaRadioButton::getServiceImplName()
-+{
-+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaRadioButton") );
-+ return sImplName;
-+}
++using namespace ::com::sun::star;
+
-+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("org.openoffice.msforms.RadioButton" ) );
-+ }
-+ return aServiceNames;
-+}
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbashape.hxx sc/source/ui/vba/vbashape.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbashape.hxx 2008-03-29 23:07:54.000000000 +0000
-+++ sc/source/ui/vba/vbashape.hxx 2008-03-28 10:30:34.000000000 +0000
-@@ -52,6 +52,7 @@ typedef InheritedHelperInterfaceImpl< Li
-
- class ScVbaShape : public ScVbaShape_BASE
- {
-+friend class ConcreteXShapeHelper; // perhaps an accessor would be better
- private:
- protected:
- css::uno::Reference< css::drawing::XShape > m_xShape;
-diff -up /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbatextbox.cxx sc/source/ui/vba/vbatextbox.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbatextbox.cxx 2008-03-31 15:23:06.000000000 +0100
-+++ sc/source/ui/vba/vbatextbox.cxx 2008-04-01 22:27:48.000000000 +0100
-@@ -42,11 +42,24 @@ using namespace org::openoffice;
-
+ static const String sThisWorkbook( RTL_CONSTASCII_USTRINGPARAM("ThisWorkbook"));
++static const rtl::OUString sStandard( RTL_CONSTASCII_USTRINGPARAM("Standard") );
+ TYPEINIT1(SbModule,SbxObject)
+ TYPEINIT1(SbMethod,SbxMethod)
+@@ -88,6 +104,8 @@ TYPEINIT1(SbProperty,SbxProperty)
+ TYPEINIT1(SbProcedureProperty,SbxProperty)
+ TYPEINIT1(SbJScriptModule,SbModule)
+ TYPEINIT1(SbJScriptMethod,SbMethod)
++TYPEINIT1(SbObjModule,SbModule)
++TYPEINIT1(SbUserFormModule,SbModule)
--ScVbaTextBox::ScVbaTextBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< css::drawing::XControlShape >& xControlShape ) : TextBoxImpl_BASE( xContext, xControlShape )
-+ScVbaTextBox::ScVbaTextBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, bool bDialog ) : TextBoxImpl_BASE( xContext, xControl ), mbDialog( bDialog )
- {
+ SV_DECL_VARARR(SbiBreakpoints,USHORT,4,4)
+ SV_IMPL_VARARR(SbiBreakpoints,USHORT)
+@@ -1903,6 +1921,307 @@ void SyntaxHighlighter::getHighlightPort
+ m_pSimpleTokenizer->getHighlightPortions( nLine, rLine, portions );
}
- // Attributes
-+uno::Any SAL_CALL
-+ScVbaTextBox::getValue() throw (css::uno::RuntimeException)
++/////////////////////////////////////////////////////////////////////////
++SbObjModule::SbObjModule( const rtl::OUString& rName, const com::sun::star::script::ModuleInfo& mInfo )
++ :SbModule( rName ), pDocObject( NULL )
+{
-+ return uno::makeAny( getText() );
++ m_mInfo = mInfo;
++ SetSource32( mInfo.ModuleSource );
+}
+
-+void SAL_CALL
-+ScVbaTextBox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeException)
++BOOL
++SbObjModule::IsClass( const XubString& rName )
+{
-+ rtl::OUString sVal = getAnyAsString( _value );
-+ setText( sVal );
++ GetObject();
++ return SbxObject::IsClass( rName );
+}
+
- //getString() will cause some imfo lose.
- rtl::OUString SAL_CALL
- ScVbaTextBox::getText() throw (css::uno::RuntimeException)
-@@ -62,8 +75,13 @@ ScVbaTextBox::getText() throw (css::uno:
- void SAL_CALL
- ScVbaTextBox::setText( const rtl::OUString& _text ) throw (css::uno::RuntimeException)
- {
-- uno::Reference< text::XTextRange > xTextRange( m_xProps, uno::UNO_QUERY_THROW );
-- xTextRange->setString( _text );
-+ 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
-@@ -103,3 +121,22 @@ ScVbaTextBox::setMultiline( sal_Bool _mu
- m_xProps->setPropertyValue
- (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MultiLine" ) ), aValue);
- }
-+
-+rtl::OUString&
-+ScVbaTextBox::getServiceImplName()
++SbxVariable*
++SbObjModule::GetObject()
+{
-+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaTextBox") );
-+ return sImplName;
++ if( !pDocObject )
++ InitObject();
++ return pDocObject;
+}
-+
-+uno::Sequence< rtl::OUString >
-+ScVbaTextBox::getServiceNames()
++SbxVariable*
++SbObjModule::Find( const XubString& rName, SbxClassType t )
+{
-+ static uno::Sequence< rtl::OUString > aServiceNames;
-+ if ( aServiceNames.getLength() == 0 )
++ //OSL_TRACE("SbObjectModule find for %s", rtl::OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr() );
++ if ( !pDocObject )
++ InitObject();
++ //OSL_TRACE("!!!!try to find in derived module " );
++ SbxVariable* pVar = NULL;
++ if ( !pVar && pDocObject)
++ {
++ pVar = pDocObject->Find( rName, t );
++ if ( pVar )
++ {
++ //OSL_TRACE("found in uno (psuedo-base) object" );
++ }
++ else
+ {
-+ aServiceNames.realloc( 1 );
-+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.TextBox" ) );
++ //OSL_TRACE("NOT found in uno (psuedo-base) object" );
+ }
-+ return aServiceNames;
-+}
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbatextbox.hxx 2008-03-31 15:23:06.000000000 +0100
-+++ sc/source/ui/vba/vbatextbox.hxx 2008-04-01 21:11:39.000000000 +0100
-@@ -43,16 +43,21 @@ typedef cppu::ImplInheritanceHelper1< Sc
-
- class ScVbaTextBox : public TextBoxImpl_BASE
- {
-+ bool mbDialog;
- public:
- ScVbaTextBox( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-- const css::uno::Reference< css::drawing::XControlShape >& xControlShape );
-+ const css::uno::Reference< css::uno::XInterface >& xControl, 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
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbascrollbar.cxx 2008-04-02 22:26:03.000000000 +0100
-@@ -0,0 +1,139 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbalabel.cxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 10:54:35 $
-+ *
-+ * 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 org::openoffice;
-+
-+
-+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 uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl ) : ScrollBarImpl_BASE( xContext, xControl )
-+{
-+}
++ }
++ if ( !pVar )
++ {
++ pVar = SbModule::Find( rName, t );
++ if ( pVar )
++ {
++ //OSL_TRACE("! found in (normal) module " );
++ }
++ }
+
-+// Attributes
-+uno::Any SAL_CALL
-+ScVbaScrollBar::getValue() throw (css::uno::RuntimeException)
-+{
-+ return m_xProps->getPropertyValue( SCROLLVALUE );
++ return pVar;
+}
+
-+void SAL_CALL
-+ScVbaScrollBar::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
++void
++SbObjModule::InitObject()
+{
-+ m_xProps->setPropertyValue( SCROLLVALUE, _value );
++ // OSL_TRACE("Initialize pDocObject");
++ try
++ {
++ com::sun::star::uno::Reference< com::sun::star::script::XObjectProvider > xObjectProvider( m_mInfo.ModuleObjectProvider, com::sun::star::uno::UNO_QUERY_THROW );
++ com::sun::star::uno::Any aObject = xObjectProvider->getObject();
++ pDocObject = new SbUnoObject( GetName(), aObject );
++ com::sun::star::uno::Reference< com::sun::star::lang::XServiceInfo > xServiceInfo( aObject, com::sun::star::uno::UNO_QUERY_THROW );
++ if( xServiceInfo->supportsService( rtl::OUString::createFromAscii( "org.openoffice.excel.Worksheet" ) ) )
++ {
++ SetClassName( rtl::OUString::createFromAscii( "Worksheet" ) );
++ }
++ else if( xServiceInfo->supportsService( rtl::OUString::createFromAscii( "org.openoffice.excel.Workbook" ) ) )
++ {
++ SetClassName( rtl::OUString::createFromAscii( "Workbook" ) );
++ }
++ }catch( com::sun::star::uno::RuntimeException e )
++ {
++ //OSL_TRACE("Object is not exist." );
++ }
+}
+
-+::sal_Int32 SAL_CALL
-+ScVbaScrollBar::getMax() throw (uno::RuntimeException)
-+{
-+ sal_Int32 nMax = 0;
-+ m_xProps->getPropertyValue( SCROLLMAX ) >>= nMax;
-+ return nMax;
-+}
++typedef ::cppu::WeakImplHelper1< awt::XTopWindowListener > EventListener_BASE;
+
-+void SAL_CALL
-+ScVbaScrollBar::setMax( sal_Int32 nVal ) throw (uno::RuntimeException)
++class FormObjEventListenerImpl : public EventListener_BASE
+{
-+ m_xProps->setPropertyValue( SCROLLMAX, uno::makeAny( nVal ) );
-+}
++ class ActivateGuard
++ {
++ public:
++ ActivateGuard() { ++getCounter(); }
++ virtual ~ActivateGuard() { --getCounter(); }
++ virtual int& getCounter()
++ {
++ static int activateCount = 0;
++ return activateCount;
++ }
++ bool alreadyProcessing() { return ( getCounter() > 1 ); }
++ };
+
-+::sal_Int32 SAL_CALL
-+ScVbaScrollBar::getMin() throw (uno::RuntimeException)
-+{
-+ sal_Int32 nVal = 0;
-+ m_xProps->getPropertyValue( SCROLLMIN ) >>= nVal;
-+ return nVal;
-+}
++ class DeActivateGuard
++ {
++ public:
++ DeActivateGuard() { ++getCounter(); }
++ virtual ~DeActivateGuard() { --getCounter(); }
++ virtual int& getCounter()
++ {
++ static int deactivateCount = 0;
++ return deactivateCount;
++ }
++ bool alreadyProcessing() { return ( getCounter() > 1 ); }
++ };
+
-+void SAL_CALL
-+ScVbaScrollBar::setMin( sal_Int32 nVal ) throw (uno::RuntimeException)
-+{
-+ m_xProps->setPropertyValue( SCROLLMIN, uno::makeAny( nVal ) );
-+}
++ SbUserFormModule* mpUserForm;
++ uno::Reference< lang::XComponent > mxComponent;
++ bool mbDisposed;
++ FormObjEventListenerImpl(); // not defined
++ FormObjEventListenerImpl(const FormObjEventListenerImpl&); // not defined
++public:
++ FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) : mpUserForm( pUserForm ), mxComponent( xComponent) , mbDisposed( false )
++ {
++ if ( mxComponent.is() );
++ {
++ uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
++ //uno::Reference< awt::XWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
++ OSL_TRACE("*********** Registering the listener");
++ xList->addTopWindowListener( this );
++ }
++ }
+
-+void SAL_CALL
-+ScVbaScrollBar::setLargeChange( ::sal_Int32 _largechange ) throw (uno::RuntimeException)
-+{
-+ m_xProps->setPropertyValue( LARGECHANGE, uno::makeAny( _largechange ) );
-+}
++ ~FormObjEventListenerImpl()
++ {
++ removeListener();
++ }
++ void removeListener()
++ {
++ try
++ {
++ if ( mxComponent.is() && !mbDisposed )
++ {
++ uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
++ OSL_TRACE("*********** Removing the listener");
++ xList->removeTopWindowListener( this );
++ mxComponent = NULL;
++ }
++ }
++ catch( uno::Exception& ) {}
++ }
++ virtual void SAL_CALL windowOpened( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) {}
++ virtual void SAL_CALL windowClosing( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) {}
++ virtual void SAL_CALL windowClosed( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) {}
++ virtual void SAL_CALL windowMinimized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) {}
++ virtual void SAL_CALL windowNormalized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException){}
++ virtual void SAL_CALL windowActivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
++ {
++// ActivateGuard aGuard;
++// if ( mpUserForm && !aGuard.alreadyProcessing() )
++ if ( mpUserForm )
++ mpUserForm->triggerActivateEvent();
++ }
++
++ virtual void SAL_CALL windowDeactivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
++ {
++// DeActivateGuard aGuard;
++// if ( mpUserForm && !aGuard.alreadyProcessing() )
++ if ( mpUserForm )
++ mpUserForm->triggerDeActivateEvent();
++ }
++
++
++ virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw (uno::RuntimeException)
++ {
++ OSL_TRACE("** Userform/Dialog disposing");
++ mbDisposed = true;
++ uno::Any aSource;
++ aSource <<= Source;
++ mxComponent = NULL;
++ if ( mpUserForm )
++ mpUserForm->ResetApiObj();
++ }
++};
+
-+::sal_Int32 SAL_CALL
-+ScVbaScrollBar::getLargeChange() throw (uno::RuntimeException)
++SbUserFormModule::SbUserFormModule( const rtl::OUString& rName, const com::sun::star::script::ModuleInfo& mInfo )
++ :SbObjModule( rName, mInfo ), m_bUnloaded( true )
+{
-+ sal_Int32 nVal = 0;
-+ m_xProps->getPropertyValue( LARGECHANGE ) >>= nVal;
-+ return nVal;
+}
+
-+::sal_Int32 SAL_CALL
-+ScVbaScrollBar::getSmallChange() throw (uno::RuntimeException)
++void SbUserFormModule::ResetApiObj( bool bUnload )
+{
-+ sal_Int32 nSmallChange = 0;
-+ m_xProps->getPropertyValue( SMALLCHANGE ) >>= nSmallChange;
-+ return nSmallChange;
++ if ( m_xDialog.is() ) // probably someone close the dialog window
++ {
++ triggerTerminateEvent();
++ }
++ pDocObject = NULL;
++ m_xDialog = NULL;
+}
+
-+void SAL_CALL
-+ScVbaScrollBar::setSmallChange( ::sal_Int32 _smallchange ) throw (uno::RuntimeException)
++void SbUserFormModule::triggerMethod( const String& aMethodToRun )
+{
-+ m_xProps->setPropertyValue( SMALLCHANGE, uno::makeAny( _smallchange ) );
++ OSL_TRACE("*** trigger %s ***", rtl::OUStringToOString( aMethodToRun, RTL_TEXTENCODING_UTF8 ).getStr() );
++ // Search method
++ SbxVariable* pMeth = SbObjModule::Find( aMethodToRun, SbxCLASS_METHOD );
++ if( pMeth )
++ {
++ SbxValues aVals;
++ pMeth->Get( aVals );
++ }
+}
+
-+rtl::OUString&
-+ScVbaScrollBar::getServiceImplName()
++void SbUserFormModule::triggerActivateEvent( void )
+{
-+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaScrollBar") );
-+ return sImplName;
++ OSL_TRACE("**** entering SbUserFormModule::triggerActivate");
++ triggerMethod( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UserForm_activate") ) );
++ OSL_TRACE("**** leaving SbUserFormModule::triggerActivate");
+}
+
-+uno::Sequence< rtl::OUString >
-+ScVbaScrollBar::getServiceNames()
++void SbUserFormModule::triggerDeActivateEvent( void )
+{
-+ static uno::Sequence< rtl::OUString > aServiceNames;
-+ if ( aServiceNames.getLength() == 0 )
-+ {
-+ aServiceNames.realloc( 1 );
-+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.msforms.Frame" ) );
-+ }
-+ return aServiceNames;
++ OSL_TRACE("**** SbUserFormModule::triggerDeActivate");
++ triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_DeActivate") ) );
+}
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbascrollbar.hxx 2008-04-02 22:33:09.000000000 +0100
-@@ -0,0 +1,67 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbalabel.hxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 10:54:46 $
-+ *
-+ * 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 <org/openoffice/msforms/XScrollBar.hpp>
+
-+#include "vbacontrol.hxx"
-+#include "vbahelper.hxx"
++void SbUserFormModule::triggerInitializeEvent( void )
++
++{
++ OSL_TRACE("**** SbUserFormModule::triggerInitializeEvent");
++ static String aInitMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Initialize") );
++ triggerMethod( aInitMethodName );
+
-+typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XScrollBar > ScrollBarImpl_BASE;
++}
+
-+class ScVbaScrollBar : public ScrollBarImpl_BASE
++void SbUserFormModule::triggerTerminateEvent( void )
+{
-+public:
-+ ScVbaScrollBar( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-+ const css::uno::Reference< css::uno::XInterface >& xControl );
-+ // 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
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbaworksheet.cxx 2008-04-14 17:28:42.000000000 +0100
-+++ sc/source/ui/vba/vbaworksheet.cxx 2008-04-11 16:17:37.000000000 +0100
-@@ -61,6 +61,7 @@
- #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
- #include <com/sun/star/drawing/XControlShape.hpp>
- #include <com/sun/star/form/FormComponentType.hpp>
-+#include <com/sun/star/form/XFormsSupplier.hpp>
-
- #include <comphelper/processfactory.hxx>
-
-@@ -421,6 +422,7 @@ ScVbaWorksheet::Delete() throw (uno::Run
- uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
- uno::Reference<container::XNameContainer> xNameContainer(xSheets,uno::UNO_QUERY_THROW);
- xNameContainer->removeByName(aSheetName);
-+ mxSheet.clear();
- }
- }
-
-@@ -661,29 +663,10 @@ ScVbaWorksheet::setValue( const ::rtl::O
- uno::Any SAL_CALL
- ScVbaWorksheet::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException)
- {
--/* uno::Any aProp = getControl( aPropertyName );
--
-- if ( !aProp.hasValue() )
-- throw beans::UnknownPropertyException(); // unsupported operation
-- // #TODO we need a factory here when we support
-- // more control types
-- sal_Int32 nClassId = -1;
-- uno::Reference< beans::XPropertySet > xProps( aProp, uno::UNO_QUERY_THROW );
-- const static rtl::OUString sClassId( RTL_CONSTASCII_USTRINGPARAM("ClassId") );
-- xProps->getPropertyValue( sClassId ) >>= nClassId;
-- ScVbaControlFactory controlFactory( m_xContext, xProps, xControlShape );
-- uno::Reference< vba::XControl > xControl( controlFactory.createControl( nClassId ) );
-- if ( nClassId == form::FormComponentType::COMBOBOX )
-- {
-- uno::Reference< msforms::XComboBox > xCbx( new ScVbaComboBox( m_xContext, xProps ) );
-- return uno::makeAny( xCbx );
-- }
--*/
- uno::Reference< drawing::XControlShape > xControlShape( getControlShape( aPropertyName ), uno::UNO_QUERY_THROW );
- ScVbaControlFactory controlFactory( mxContext, xControlShape );
-- uno::Reference< msforms::XControl > xControl( controlFactory.createControl() );
-+ uno::Reference< msforms::XControl > xControl( controlFactory.createControl( getModel() ) );
- return uno::makeAny( xControl );
--// return aProp;
- }
-
- ::sal_Bool SAL_CALL
-@@ -691,84 +674,65 @@ ScVbaWorksheet::hasMethod( const ::rtl::
- {
- return sal_False;
- }
--::sal_Bool SAL_CALL
--ScVbaWorksheet::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
++ OSL_TRACE("**** SbUserFormModule::triggerTerminateEvent");
++ static String aTermMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Terminate") );
++ triggerMethod( aTermMethodName );
++}
+
-+uno::Reference< container::XNameAccess >
-+ScVbaWorksheet::getFormControls()
- {
-+ uno::Reference< container::XNameAccess > xFormControls;
- try
- {
-- if ( getControl( aName ).hasValue() )
-- return sal_True;
-- }
-- catch( uno::Exception& )
-+ uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW );
-+ uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW );
-+ uno::Reference< form::XFormsSupplier > xFormSupplier( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
-+ uno::Reference< container::XIndexAccess > xIndexAccess( xFormSupplier->getForms(), uno::UNO_QUERY_THROW );
-+ // get the www-standard container ( maybe we should access the
-+ // 'www-standard' by name rather than index, this seems an
-+ // implementation detail
-+ xFormControls.set( xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW );
-+
-+ }
-+ catch( uno::Exception & )
- {
- }
-- return sal_False;
-+ return xFormControls;
++void SbUserFormModule::load()
++{
++ OSL_TRACE("** load() ");
++ GetObject(); // forces a load
++}
++void SbUserFormModule::Unload()
++{
++ OSL_TRACE("** Unload() ");
++ if ( m_xDialog.is() )
++ {
++ triggerTerminateEvent();
++ }
++ // Search method
++ SbxVariable* pMeth = SbObjModule::Find( String( RTL_CONSTASCII_USTRINGPARAM( "UnloadObject" ) ), SbxCLASS_METHOD );
++ if( pMeth )
++ {
++ OSL_TRACE("Attempting too run the UnloadObjectMethod");
++ m_xDialog = NULL; //release ref to the uno object
++ SbxValues aVals;
++ pMeth->Get( aVals );
++ }
++}
+
- }
--uno::Any
--ScVbaWorksheet::getControl( const ::rtl::OUString& sName )
-+::sal_Bool SAL_CALL
-+ScVbaWorksheet::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
- {
-- uno::Reference< sheet::XScenarioEnhanced > xIf( getSheet(), uno::UNO_QUERY_THROW );
-- ScTableSheetObj* pTab= static_cast< ScTableSheetObj* >( xIf.get() );
-- ScDocShell* pShell = NULL;
-- if ( pTab )
-- pShell = pTab->GetDocShell();
-- if ( pShell )
-- {
-- ScDrawLayer* pDrawLayer = pShell->MakeDrawLayer();
-- SCTAB nTab = 0;
-- // make GetTab_Impl() public or this class a friend
-- const ScRangeList& rRanges = pTab->GetRangeList();
-- const ScRange* pFirst = rRanges.GetObject(0);
-- if (pFirst)
-- nTab = pFirst->aStart.Tab();
--
-- SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
-- if ( pPage )
-- {
-- ULONG nCount = pPage->GetObjCount();
-- for ( ULONG index=0; index<nCount; ++index )
-- {
-- SdrObject* pObj = pPage->GetObj( index );
-- if ( pObj )
-- {
--
-- SdrUnoObj* pUnoObj = PTR_CAST(SdrUnoObj, pObj);
-- if ( pUnoObj )
-- {
-- uno::Reference< container::XNamed > xNamed( pUnoObj->GetUnoControlModel(), uno::UNO_QUERY_THROW );
-- if ( sName.equals( xNamed->getName() ) )
-- return uno::makeAny( xNamed );
-- }
-- }
-- }
-- }
-- }
--
-- return uno::Any();
-+ uno::Reference< container::XNameAccess > xFormControls( getFormControls() );
-+ if ( xFormControls.is() )
-+ return xFormControls->hasByName( aName );
-+ return sal_False;
- }
-
- uno::Any
- ScVbaWorksheet::getControlShape( const ::rtl::OUString& sName )
- {
-- //uno::Reference< sheet::XScenarioEnhanced > xIf( getSheet(), uno::UNO_QUERY_THROW );
-- uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW );
-- uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW );
-- uno::Reference< drawing::XDrawPage > xDrawPage( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
-- uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPage, uno::UNO_QUERY_THROW );
-+ // ideally we would get an XControl object but it appears an XControl
-+ // implementation only exists for a Control implementation optained from the
-+ // view ( e.g. in basic you would get this from
-+ // thiscomponent.currentcontroller.getControl( controlModel ) )
-+ // and the thing to realise is that it is only possible to get an XControl
-+ // for a currently displayed control :-( often we would want to modify
-+ // a control not on the active sheet. But.. you can always access the
-+ // XControlShape from the DrawPage whether that is the active drawpage or not
++void SbUserFormModule::InitObject()
++{
++ try
++ {
+
-+ uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( getSheet(), uno::UNO_QUERY_THROW );
-+ uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
++ uno::Reference< frame::XModel > xModel( m_mInfo.ModuleObjectProvider, uno::UNO_QUERY_THROW );
++ if ( xModel.is() )
++ {
++ uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
++ uno::Sequence< uno::Any > aArgs(1);
++ aArgs[ 0 ] <<= xModel;
++ rtl::OUString sDialogUrl( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.script:" ) );
++ sDialogUrl = sDialogUrl.concat( sStandard ).concat( rtl::OUString( '.') ).concat( m_mInfo.ModuleName ).concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("?location=document") ) );
+
- sal_Int32 nCount = xIndexAccess->getCount();
- for( int index = 0; index < nCount; index++ )
- {
- uno::Any aUnoObj = xIndexAccess->getByIndex( index );
- uno::Reference< drawing::XControlShape > xControlShape( aUnoObj, uno::UNO_QUERY_THROW );
-- uno::Reference< awt::XControlModel > xControlModel( xControlShape->getControl() );
-- uno::Reference< container::XNamed > xNamed( xControlModel, uno::UNO_QUERY_THROW );
-+ uno::Reference< container::XNamed > xNamed( xControlShape->getControl(), uno::UNO_QUERY_THROW );
- if( sName.equals( xNamed->getName() ))
- {
- return aUnoObj;
- }
--
- }
-- return uno::Any();
-+ return uno::Any();
- }
-
-
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbaworksheet.hxx sc/source/ui/vba/vbaworksheet.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbaworksheet.hxx 2008-03-29 23:07:54.000000000 +0000
-+++ sc/source/ui/vba/vbaworksheet.hxx 2008-03-28 10:30:34.000000000 +0000
-@@ -62,7 +62,7 @@ class ScVbaWorksheet : public WorksheetI
- css::uno::Reference< oo::excel::XWorksheet > getSheetAtOffset(SCTAB offset) throw (css::uno::RuntimeException);
- css::uno::Reference< oo::excel::XRange > getSheetRange() throw (css::uno::RuntimeException);
-
-- css::uno::Any getControl( const rtl::OUString& sName );
-+ css::uno::Reference< css::container::XNameAccess > getFormControls();
- css::uno::Any getControlShape( const rtl::OUString& sName );
- protected:
-
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/view/viewfun2.cxx sc/source/ui/view/viewfun2.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/view/viewfun2.cxx 2008-03-29 23:08:24.000000000 +0000
-+++ sc/source/ui/view/viewfun2.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -62,6 +62,11 @@
- #include <vcl/sound.hxx>
- #include <vcl/waitobj.hxx>
-
-+#include <basic/sbstar.hxx>
-+#include <com/sun/star/container/XNameContainer.hpp>
-+#include <com/sun/star/script/XLibraryContainer.hpp>
-+using namespace com::sun::star;
++ uno::Reference< awt::XDialogProvider > xProvider( xFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.DialogProvider")), aArgs ), uno::UNO_QUERY_THROW );
++ m_xDialog = xProvider->createDialog( sDialogUrl );
+
- #include "viewfunc.hxx"
-
- #include "sc.hrc"
-@@ -2095,15 +2100,42 @@ BOOL ScViewFunc::DeleteTable( SCTAB nTab
- return bSuccess;
- }
-
-+void lcl_DeleteModule( ScDocShell* rDocSh, String& sModuleName )
-+{
-+ SFX_APP()->EnterBasicCall();
-+ uno::Reference< script::XLibraryContainer > xLibContainer = rDocSh->GetBasicContainer();
-+ DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
++ // create vba api object
++ aArgs.realloc( 3 );
++ aArgs[ 0 ] = uno::Any();
++ aArgs[ 1 ] <<= m_xDialog;
++ aArgs[ 2 ] <<= xModel;
++ pDocObject = new SbUnoObject( GetName(), uno::makeAny( xFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.UserForm")), aArgs ) ) );
++ uno::Reference< lang::XComponent > xComponent( aArgs[ 1 ], uno::UNO_QUERY_THROW );
++ // remove old listener if it exists
++ FormObjEventListenerImpl* pFormListener = dynamic_cast< FormObjEventListenerImpl* >( m_DialogListener.get() );
++ if ( pFormListener )
++ pFormListener->removeListener();
++ m_DialogListener = new FormObjEventListenerImpl( this, xComponent );
+
-+ uno::Reference< container::XNameContainer > xLib;
-+ if( xLibContainer.is() )
-+ {
-+ String aLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
-+ uno::Any aLibAny = xLibContainer->getByName( aLibName );
-+ aLibAny >>= xLib;
++ // trigger initialise event
++ triggerInitializeEvent();
++ }
+ }
-+ if( xLib.is() )
++ catch( uno::Exception& e )
+ {
-+ if( xLib->hasByName( sModuleName ) )
-+ {
-+ xLib->removeByName( sModuleName );
-+ }
+ }
-+ SFX_APP()->LeaveBasicCall();
++
+}
+
- BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord )
- {
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
- ScDocument* pDoc = pDocSh->GetDocument();
-+ StarBASIC* pStarBASIC = pDocSh->GetBasic();
-+ BOOL bVbaEnabled = pStarBASIC->isVBAEnabled();
- SCTAB nNewTab = TheTabs[0];
- int i;
- WaitObject aWait( GetFrameWin() );
- if (bRecord && !pDoc->IsUndoEnabled())
- bRecord = FALSE;
-+ if ( bVbaEnabled )
-+ bRecord = FALSE;
++SbxVariable*
++SbUserFormModule::Find( const XubString& rName, SbxClassType t )
++{
++ return SbObjModule::Find( rName, t );
++}
- while ( nNewTab > 0 && !pDoc->IsVisible( nNewTab ) )
- --nNewTab;
-@@ -2170,9 +2202,18 @@ BOOL ScViewFunc::DeleteTables(const SvSh
+ /////////////////////////////////////////////////////////////////////////
+ // Implementation SbJScriptModule (Basic-Modul fuer JavaScript-Sourcen)
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/methods1.cxx basic/source/runtime/methods1.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/methods1.cxx 2007-09-20 16:55:19.000000000 +0100
++++ basic/source/runtime/methods1.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -60,6 +60,9 @@
+ #ifndef _SBX_HXX
+ #include <basic/sbx.hxx>
+ #endif
++#ifndef _SBSTAR_HXX
++#include <basic/sbstar.hxx>
++#endif
+ #ifndef _ZFORLIST_HXX //autogen
+ #include <svtools/zforlist.hxx>
+ #endif
+@@ -86,6 +89,7 @@
+ #endif
- for(i=TheTabs.Count()-1;i>=0;i--)
+ #include <vcl/jobset.hxx>
++#include <basic/sbobjmod.hxx>
+
+ #include "sbintern.hxx"
+ #include "runtime.hxx"
+@@ -2611,13 +2615,22 @@ RTLFUNC(Me)
+
+ SbModule* pActiveModule = pINST->GetActiveModule();
+ SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pActiveModule);
++ SbxVariableRef refVar = rPar.Get(0);
+ if( pClassModuleObject == NULL )
{
-+ String sCodeName;
-+ BOOL bHasCodeName = pDoc->GetCodeName( TheTabs[sal::static_int_cast<USHORT>(i)], sCodeName );
- if (pDoc->DeleteTab( TheTabs[sal::static_int_cast<USHORT>(i)], pUndoDoc ))
- {
- bDelDone = TRUE;
-+ if( bVbaEnabled )
-+ {
-+ if( bHasCodeName )
-+ {
-+ lcl_DeleteModule( pDocSh, sCodeName );
-+ }
-+ }
- pDocSh->Broadcast( ScTablesHint( SC_TAB_DELETED, TheTabs[sal::static_int_cast<USHORT>(i)] ) );
- }
+- StarBASIC::Error( SbERR_INVALID_USAGE_OBJECT );
++ SbObjModule* pMod = PTR_CAST(SbObjModule,pActiveModule);
++ if ( pMod == NULL )
++ {
++ SbUserFormModule* pFormMod = PTR_CAST(SbUserFormModule,pActiveModule);
++ if ( !pFormMod )
++ StarBASIC::Error( SbERR_INVALID_USAGE_OBJECT );
++ else
++ refVar->PutObject( pFormMod );
++
++ }
++ else
++ refVar->PutObject( pMod );
}
-@@ -2200,6 +2241,7 @@ BOOL ScViewFunc::DeleteTables(const SvSh
- pDocSh->PostPaintExtras();
- pDocSh->SetDocumentModified();
+ else
+- {
+- SbxVariableRef refVar = rPar.Get(0);
+ refVar->PutObject( pClassModuleObject );
+- }
+ }
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/methods.cxx basic/source/runtime/methods.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/methods.cxx 2008-03-29 23:08:19.000000000 +0000
++++ basic/source/runtime/methods.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -152,6 +152,8 @@ using namespace com::sun::star::io;
+ #include <io.h>
+ #endif
++#include <basic/sbobjmod.hxx>
+
- SfxApplication* pSfxApp = SFX_APP(); // Navigator
- pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
- pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
+ static void FilterWhiteSpace( String& rStr )
+ {
+ rStr.EraseAllChars( ' ' );
+@@ -4386,7 +4386,12 @@ RTLFUNC(Load)
+
+ // Diesen Call einfach an das Object weiterreichen
+ SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
+- if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
++ if( pObj && pObj->IsA( TYPE( SbUserFormModule ) ) )
++ {
++ SbUserFormModule* pFormModule = ( SbUserFormModule* )pObj;
++ pFormModule->load();
++ }
++ else if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
+ {
+ SbxVariable* pVar = ((SbxObject*)pObj)->
+ Find( String( RTL_CONSTASCII_USTRINGPARAM("Load") ), SbxCLASS_METHOD );
+@@ -4407,7 +4409,12 @@ RTLFUNC(Unload)
+
+ // Diesen Call einfach an das Object weitereichen
+ SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
+- if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
++ if( pObj && pObj->IsA( TYPE( SbUserFormModule ) ) )
++ {
++ SbUserFormModule* pFormModule = ( SbUserFormModule* )pObj;
++ pFormModule->Unload();
++ }
++ else if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
+ {
+ SbxVariable* pVar = ((SbxObject*)pObj)->
+ Find( String( RTL_CONSTASCII_USTRINGPARAM("Unload") ), SbxCLASS_METHOD );
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/runtime.cxx basic/source/runtime/runtime.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/runtime.cxx 2008-03-29 23:08:19.000000000 +0000
++++ basic/source/runtime/runtime.cxx 2008-03-29 00:19:02.000000000 +0000
+@@ -82,6 +82,17 @@ void StarBASIC::StaticEnableReschedule(
+ {
+ bStaticGlobalEnableReschedule = bReschedule;
+ }
++void StarBASIC::SetVBAEnabled( BOOL bEnabled )
++{
++ bVBAEnabled = bEnabled;
++}
++
++BOOL StarBASIC::isVBAEnabled()
++{
++ if( SbiRuntime::isVBAEnabled() )
++ return TRUE;
++ return bVBAEnabled;
++}
+
+
+ struct SbiArgvStack { // Argv stack:
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/sbx/sbxobj.cxx basic/source/sbx/sbxobj.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/sbx/sbxobj.cxx 2007-06-27 15:31:34.000000000 +0100
++++ basic/source/sbx/sbxobj.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -187,7 +187,7 @@ void SbxObject::SFX_NOTIFY( SfxBroadcast
+ }
+ }
+
+-BOOL SbxObject::IsClass( const XubString& rName ) const
++BOOL SbxObject::IsClass( const XubString& rName )
+ {
+ return BOOL( aClassName.EqualsIgnoreCaseAscii( rName ) );
+ }
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/uno/namecont.cxx basic/source/uno/namecont.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/uno/namecont.cxx 2008-02-26 17:01:46.000000000 +0000
++++ basic/source/uno/namecont.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -139,6 +139,9 @@
+ #endif
+ #include <basic/sbmod.hxx>
+
++#ifndef _COM_SUN_STAR_SCRIPT_MODULEINFO_HPP_
++#include <com/sun/star/script/ModuleInfo.hpp>
++#endif
+
+ namespace basic
+ {
+@@ -217,7 +220,7 @@ void NameContainer::replaceByName( const
+ throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
+ {
+ Type aAnyType = aElement.getValueType();
+- if( mType != aAnyType )
++ if( mType != aAnyType && aAnyType != getCppuType( static_cast< ModuleInfo* >( NULL ) ) )
+ throw IllegalArgumentException();
+
+ NameContainerNameMap::iterator aIt = mHashMap.find( aName );
+@@ -259,7 +262,7 @@ void NameContainer::insertByName( const
+ throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
+ {
+ Type aAnyType = aElement.getValueType();
+- if( mType != aAnyType )
++ if( mType != aAnyType && aAnyType != getCppuType( static_cast< ModuleInfo* >( NULL ) ) )
+ throw IllegalArgumentException();
+
+ NameContainerNameMap::iterator aIt = mHashMap.find( aName );
--- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbauserform.hxx 2008-04-03 13:28:01.000000000 +0100
-@@ -0,0 +1,77 @@
++++ basic/inc/basic/sbobjmod.hxx 2008-04-02 17:40:27.000000000 +0100
+@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
-+ * $RCSfile: vbashape.hxx,v $
++ * $RCSfile: sbobjmod.hxx,v $
+ *
-+ * $Revision: 1.2 $
++ * $Revision: 1.4 $
+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 11:02:09 $
++ * last change: $Author: $ $Date: 2007/08/27 16:31:39 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
@@ -3078,3656 +2365,656 @@
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
-+#ifndef SC_VBA_USERFORM_HXX
-+#define SC_VBA_USERFORM_HXX
+
-+#include <cppuhelper/implbase1.hxx>
-+#include <org/openoffice/msforms/XUserForm.hpp>
++#ifndef _SB_OBJMOD_HXX
++#define _SB_OBJMOD_HXX
++
++#include <basic/sbmod.hxx>
++#include <basic/sbstar.hxx>
++#include <com/sun/star/script/ModuleInfo.hpp>
++#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/awt/XDialog.hpp>
+
-+#include "vbahelperinterface.hxx"
-+#include "vbacontrol.hxx"
++namespace css = ::com::sun::star;
+
-+//typedef InheritedHelperInterfaceImpl1< oo::msforms::XUserForm > ScVbaUserForm_BASE;
-+typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XUserForm > ScVbaUserForm_BASE;
++// Basic-Module for excel object.
+
-+class ScVbaUserForm : public ScVbaUserForm_BASE
++class SbObjModule : public SbModule
+{
-+private:
-+ css::uno::Reference< css::awt::XDialog > m_xDialog;
-+ ScDocShell* m_pDocShell;
-+ bool mbDispose;
+protected:
++ com::sun::star::script::ModuleInfo m_mInfo;
++ SbxObjectRef pDocObject; // a vba api object.
++ virtual void InitObject();
+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);
-+
-+ //XHelperInterface
-+ virtual rtl::OUString& getServiceImplName();
-+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++ TYPEINFO();
++ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_DOCUMENTMOD,2);
++ SbObjModule( const rtl::OUString& rName, const com::sun::star::script::ModuleInfo& mInfo );
++ virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
++ SbxVariable* GetObject();
++ virtual BOOL IsClass( const String& );
+};
-+#endif
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbauserform.cxx 2008-04-11 16:20:05.000000000 +0100
-@@ -0,0 +1,276 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbashape.cxx,v $
-+ *
-+ * $Revision: 1.3 $
-+ *
-+ * last change: $Author: kz $ $Date: 2007/12/14 12:41:26 $
-+ *
-+ * 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 "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"
-+
-+using namespace ::org::openoffice;
-+using namespace ::com::sun::star;
+
-+#define VBA_LEFT "PositionX"
-+#define VBA_TOP "PositionY"
-+class UserFormGeometryHelper : public AbstractGeometryAttributes
++class SbUserFormModule : public SbObjModule
+{
++ css::uno::Reference<css::lang::XEventListener> m_DialogListener;
++ css::uno::Reference<css::awt::XDialog> m_xDialog;
++ String sFormName;
+
-+ uno::Reference< beans::XPropertySet > mxModel;
++ bool m_bUnloaded;
++ static USHORT nHideHash;
++protected:
++ virtual void InitObject();
+public:
-+ UserFormGeometryHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< awt::XControl >& xControl )
-+ {
-+ mxModel.set( xControl->getModel(), uno::UNO_QUERY_THROW );
-+ }
-+ virtual double getLeft()
-+ {
-+ sal_Int32 nLeft = 0;
-+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft;
-+ return nLeft;
-+ }
-+ virtual void setLeft( double nLeft )
-+ {
-+ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ), uno::makeAny( static_cast< sal_Int32 >( nLeft ) ) );
-+ }
-+ virtual double getTop()
-+ {
-+ sal_Int32 nTop = 0;
-+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ) ) >>= nTop;
-+ return nTop;
-+ }
-+ virtual void setTop( double nTop )
-+ {
-+ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_TOP ) ), uno::makeAny( static_cast< sal_Int32 >( nTop ) ) );
-+ }
-+ virtual double getHeight()
-+ {
-+ sal_Int32 nHeight = 0;
-+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLHGT ) ) ) >>= nHeight;
-+ return static_cast< double >( nHeight );
-+ }
-+ virtual void setHeight( double nHeight )
-+ {
-+ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLHGT ) ), uno::makeAny( static_cast< sal_Int32 >( nHeight ) ) );
-+ }
-+ virtual double getWidth()
-+ {
-+ sal_Int32 nWidth = 0;
-+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLWID ) ) ) >>= nWidth;
-+ return static_cast< sal_Int32 >( nWidth );
-+ }
-+ virtual void setWidth( double nWidth)
-+ {
-+ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_CELLWID ) ), uno::makeAny( static_cast< sal_Int32 >( nWidth ) ) );
-+ }
++ TYPEINFO();
++ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_USERFORMMOD,2);
++ SbUserFormModule( const rtl::OUString& rName, const com::sun::star::script::ModuleInfo& mInfo );
++ virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
++ void ResetApiObj( bool bUnloaded = true );
++ void Unload();
++ void load();
++ void triggerMethod( const String& );
++ void triggerActivateEvent();
++ void triggerDeActivateEvent();
++ void triggerInitializeEvent();
++ void triggerTerminateEvent();
++};
+
++SV_DECL_IMPL_REF(SbUserFormModule);
++#ifndef __SB_SBOBJMODULEREF_HXX
++#define __SB_SBOBJMODULEREF_HXX
+
-+};
-+// 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
++SV_DECL_IMPL_REF(SbObjModule);
+
-+ScVbaUserForm::ScVbaUserForm( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& xContext ) throw ( lang::IllegalArgumentException ) : ScVbaUserForm_BASE( xContext, getXSomethingFromArgs< uno::XInterface >( aArgs, 1 ) ), m_pDocShell( 0 ), mbDispose( true )
++#endif
++#endif
++
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sfx2/source/doc/docmacromode.cxx sfx2/source/doc/docmacromode.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sfx2/source/doc/docmacromode.cxx 2008-01-24 15:54:21.000000000 +0000
++++ sfx2/source/doc/docmacromode.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -45,6 +45,7 @@
+ #include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp>
+ #include <com/sun/star/task/InteractionClassification.hpp>
+ #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
++#include <com/sun/star/script/ModuleInfo.hpp>
+ /** === end UNO includes === **/
+
+ #include <comphelper/componentcontext.hxx>
+@@ -80,8 +81,11 @@ namespace sfx2
+ using ::com::sun::star::document::XEmbeddedScripts;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::script::XLibraryContainer;
++ using ::com::sun::star::script::ModuleInfo;
+ using ::com::sun::star::container::XNameAccess;
++ using ::com::sun::star::container::XNameContainer;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
++ using ::com::sun::star::uno::Sequence;
+ /** === end UNO using === **/
+ namespace MacroExecMode = ::com::sun::star::document::MacroExecMode;
+
+@@ -427,7 +431,7 @@ namespace sfx2
+ bHasMacroLib = sal_False;
+ else
+ {
+- ::rtl::OUString aStdLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
++ ::rtl::OUString aStdLibName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ) );
+ Sequence< ::rtl::OUString > aElements = xContainer->getElementNames();
+ if ( aElements.getLength() )
+ {
+@@ -447,8 +451,43 @@ namespace sfx2
+ Any aAny = xContainer->getByName( aStdLibName );
+ aAny >>= xLib;
+ if ( xLib.is() )
++ {
+ bHasMacroLib = xLib->hasElements();
+- }
++ if( !bHasMacroLib )
++ return bHasMacroLib;
++ // VBA will introduce some empty Object Module
++ // If all module only include
++ // "Rem Attribute VBA_ModuleType=VBADocumentModule\nOption VBASupport"
++ // it should be set bHasMacros as false
++ Sequence< ::rtl::OUString > sNames = xLib->getElementNames();
++ Reference < XNameContainer > xNameContainer( xContainer->getByName( aStdLibName ), UNO_QUERY_THROW );
++ sal_Int32 nCount = sNames.getLength();
++ ::rtl::OUString sName;
++ Any aCode;
++ ModuleInfo sModuleInfo;
++ ::rtl::OUString sMod;
++ ::rtl::OUString sVbaOptiona( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Rem Attribute VBA_ModuleType=VBADocumentModule\nOption VBASupport 1\n" )));
++ ::rtl::OUString sVbaOptionb( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "\r\n" )));
++ sVbaOptionb = sVbaOptiona + sVbaOptionb;
++ for ( sal_Int32 nMod = 0; nMod < nCount; nMod++ )
++ {
++ sName = sNames[nMod];
++ if ( xNameContainer->hasByName( sName ) )
++ aCode = xNameContainer->getByName( sName );
++ if ( aCode >>= sModuleInfo )
++ {
++ sMod = sModuleInfo.ModuleSource;
++ if ( sMod.getLength() && !( sMod.equals( sVbaOptiona ) || sMod.equals( sVbaOptionb ) ) )
++ return bHasMacroLib;
++ }
++ else
++ {
++ return bHasMacroLib;
++ }
++ }
++ bHasMacroLib = sal_False;
++ }
++ }
+ }
+ }
+ }
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl 2007-04-27 08:32:41.000000000 +0100
++++ oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl 2008-03-28 10:30:34.000000000 +0000
+@@ -50,5 +50,10 @@ interface XVBAToOOEventDescGen : com::su
+ com::sun::star::script::XScriptEventsSupplier getEventSupplier( [in] com::sun::star::uno::XInterface xControl );
+ };
+
++interface XFakeVBAEventDescriptorSupplier : com::sun::star::uno::XInterface
+{
-+ OSL_TRACE("ScVbaUserForm::ScVbaUserForm()");
-+ m_xDialog.set( m_xControl, uno::UNO_QUERY_THROW );
-+ uno::Reference< frame::XModel > xModel = getXSomethingFromArgs< frame::XModel >( aArgs, 2 );
-+ uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
-+ m_pDocShell = getDocShell( xModel );
-+ m_xProps.set( xControl->getModel(), uno::UNO_QUERY_THROW );
-+ setGeometryHelper( new UserFormGeometryHelper( xContext, xControl ) );
-+}
++ sequence< com::sun::star::script::ScriptEventDescriptor > getEventDescriptions( [in] com::sun::star::uno::XInterface xControl );
++};
++
+ }; }; };
+ #endif
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/inc/InterfaceContainer.hxx forms/source/inc/InterfaceContainer.hxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/inc/InterfaceContainer.hxx 2007-01-29 15:46:36.000000000 +0000
++++ forms/source/inc/InterfaceContainer.hxx 2008-03-28 10:30:34.000000000 +0000
+@@ -319,6 +319,9 @@ protected:
+ void implCheckIndex( const sal_Int32 _nIndex ) SAL_THROW( ( ::com::sun::star::lang::IndexOutOfBoundsException ) );
+
+ private:
++ // hack for Vba Events
++ void fakeVbaEventsHack( sal_Int32 _nIndex );
+
-+ScVbaUserForm::~ScVbaUserForm()
+ // the runtime event format has changed from version SO5.2 to OOo
+ enum EventFormat
+ {
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/misc/InterfaceContainer.cxx forms/source/misc/InterfaceContainer.cxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/misc/InterfaceContainer.cxx 2006-12-01 16:55:25.000000000 +0000
++++ forms/source/misc/InterfaceContainer.cxx 2008-03-28 10:30:34.000000000 +0000
+@@ -105,11 +105,14 @@
+ #include <rtl/logfile.hxx>
+ #endif
+
++#include <com/sun/star/frame/XModel.hpp>
++#include <org/openoffice/vba/XFakeVBAEventDescriptorSupplier.hpp>
+ //.........................................................................
+ namespace frm
+ {
+ //.........................................................................
+
++using namespace ::com::sun::star::frame;
+ using namespace ::com::sun::star::lang;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::beans;
+@@ -127,6 +130,83 @@ namespace
+ }
+ }
+
++bool
++lcl_hasVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents )
+{
-+ OSL_TRACE("ScVbaUserForm::~ScVbaUserForm()");
++ const ScriptEventDescriptor* pDesc = sEvents.getConstArray();
++ const ScriptEventDescriptor* pEnd = ( pDesc + sEvents.getLength() );
++ for ( ; pDesc != pEnd; ++pDesc )
++ {
++ if ( pDesc->ScriptType.equals( rtl::OUString::createFromAscii( "VBAInterop" ) ) )
++ return true;
++ }
++ return false;
+}
+
-+void SAL_CALL
-+ScVbaUserForm::Show( ) throw (uno::RuntimeException)
++Sequence< ScriptEventDescriptor >
++lcl_stripVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents )
+{
-+ 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 )
++ Sequence< ScriptEventDescriptor > sStripped( sEvents.getLength() );
++
++ const ScriptEventDescriptor* pDesc = sEvents.getConstArray();
++ const ScriptEventDescriptor* pEnd = ( pDesc + sEvents.getLength() );
++ sal_Int32 nCopied = 0;
++ for ( ; pDesc != pEnd; ++pDesc )
+ {
-+ try
-+ {
-+ uno::Reference< lang::XComponent > xComp( m_xDialog, uno::UNO_QUERY_THROW );
-+ m_xDialog = NULL;
-+ xComp->dispose();
-+ mbDispose = false;
-+ }
-+ catch( uno::Exception& )
++ if ( !pDesc->ScriptType.equals( rtl::OUString::createFromAscii( "VBAInterop" ) ) )
+ {
++ sStripped[ nCopied++ ] = *pDesc;
+ }
+ }
++ if ( nCopied )
++ sStripped.realloc( nCopied );
++ return sStripped;
+}
+
-+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()
++OInterfaceContainer::fakeVbaEventsHack( sal_Int32 _nIndex )
+{
-+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaUserForm") );
-+ return sImplName;
-+}
++ // we are dealing with form controls
++ try
++ {
++ Reference< XFormComponent > xForm( static_cast< XContainer* >(this), UNO_QUERY_THROW );
++ // grand-parent should be the model, no parent ? if not
++ // we'll ignore, we'll get called back here anyway )
++ Reference< XChild > xChild( xForm->getParent(), UNO_QUERY_THROW );
++ Reference< XModel > xDocOwner( xChild->getParent(), UNO_QUERY );
++ OSL_TRACE(" Is DOC ????? %s", xDocOwner.is() ? "true" : "false" );
++ if ( xDocOwner.is() )
++ {
++ bool hasVBABindings = lcl_hasVbaEvents( m_xEventAttacher->getScriptEvents( _nIndex ) );
++ if ( hasVBABindings )
++ {
++ OSL_TRACE("Has VBA bindings already, returning ");
++ return;
++ }
++ Reference< XMultiServiceFactory > xFac( xDocOwner, UNO_QUERY );
++ if ( xFac.is() )
++ {
++ try
++ {
++ Reference< org::openoffice::vba::XFakeVBAEventDescriptorSupplier > xDescSupplier( xFac->createInstance( rtl::OUString::createFromAscii( "org.openoffice.vba.controlevents" ) ), UNO_QUERY_THROW );
++ Reference< XInterface > xIf( getByIndex( _nIndex ) , UNO_QUERY_THROW );
++ Sequence< ScriptEventDescriptor > vbaEvents = xDescSupplier->getEventDescriptions( xIf );
++ // register the vba script events
++ if ( m_xEventAttacher.is() )
++ {
++ m_xEventAttacher->registerScriptEvents( _nIndex, vbaEvents );
++ }
++ }
++ catch( Exception& e ){ OSL_TRACE("lcl_fakevbaevents - Caught Exception trying to create control eventstuff "); }
++ }
+
-+uno::Sequence< rtl::OUString >
-+ScVbaUserForm::getServiceNames()
-+{
-+ static uno::Sequence< rtl::OUString > aServiceNames;
-+ if ( aServiceNames.getLength() == 0 )
++ }
++ }
++ catch( Exception& e )
+ {
-+ aServiceNames.realloc( 1 );
-+ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.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)
-+{
-+ //OSL_TRACE("ScVbaUserForm getProperty( %s )", rtl::OUStringToOString( aPropertyName, RTL_TEXTENCODING_UTF8 ).getStr() );
-+ 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 );
-+ 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;
-+}
-+
-+::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",
-+ "org.openoffice.excel.UserForm" );
-+}
-+
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basides1.cxx basctl/source/basicide/basides1.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basides1.cxx 2008-01-14 16:00:33.000000000 +0000
-+++ basctl/source/basicide/basides1.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -1229,10 +1229,16 @@ IDEBaseWindow* BasicIDEShell::FindWindow
- // return any non-suspended window
- return pWin;
- }
-- else if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName && pWin->GetName() == rName &&
-+ else if ( pWin->IsDocument( rDocument ) )
-+ {
-+ OSL_TRACE("FindWindow pWin->GetLibName() %s rLibName %s",
-+ rtl::OUStringToOString( pWin->GetLibName(), RTL_TEXTENCODING_UTF8 ).getStr(),
-+ rtl::OUStringToOString( rLibName, RTL_TEXTENCODING_UTF8 ).getStr() );
-+ OSL_TRACE("pWin->pWin->IsA( TYPE( ModulWindow ) %d && nType %d = BASICIDE_TYPE_MODULE %d", pWin->IsA( TYPE( ModulWindow ) ), nType, BASICIDE_TYPE_MODULE );
-+ OSL_TRACE("pWin->pWin->IsA( TYPE( DialogWindow ) %d && nType %d = BASICIDE_TYPE_DIALOG %d", pWin->IsA( TYPE( DialogWindow ) ), nType, BASICIDE_TYPE_DIALOG );
-+ if ( pWin->GetLibName() == rLibName && pWin->GetName() == rName &&
- ( ( pWin->IsA( TYPE( ModulWindow ) ) && nType == BASICIDE_TYPE_MODULE ) ||
- ( pWin->IsA( TYPE( DialogWindow ) ) && nType == BASICIDE_TYPE_DIALOG ) ) )
-- {
- return pWin;
- }
- }
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basides2.cxx basctl/source/basicide/basides2.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basides2.cxx 2007-11-21 16:37:21.000000000 +0000
-+++ basctl/source/basicide/basides2.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -252,9 +252,12 @@ ModulWindow* BasicIDEShell::CreateBasWin
+ //==================================================================
+ //= ElementDescription
+ //==================================================================
+@@ -726,6 +806,7 @@ void OInterfaceContainer::approveNewElem
+ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XPropertySet >& _rxElement,
+ sal_Bool _bEvents, ElementDescription* _pApprovalResult, sal_Bool _bFire ) throw( IllegalArgumentException )
+ {
++ OSL_TRACE("OInterfaceContainer::implInsert( %d)", _nIndex );
+ RTL_LOGFILE_CONTEXT( aLogger, "forms::OInterfaceContainer::implInsert" );
- if ( bSuccess )
- {
-- // new module window
-- pWin = new ModulWindow( pModulLayout, rDocument, aLibName, aModName, aModule );
-- nKey = InsertWindowInTable( pWin );
-+ pWin = FindBasWin( rDocument, aLibName, aModName, FALSE, TRUE );
-+ if( !pWin )
-+ { // new module window
-+ pWin = new ModulWindow( pModulLayout, rDocument, aLibName, aModName, aModule );
-+ nKey = InsertWindowInTable( pWin );
-+ }
- }
- }
- else
-@@ -269,7 +272,8 @@ ModulWindow* BasicIDEShell::CreateBasWin
- }
- DBG_ASSERT( nKey, "CreateBasWin: Kein Key- Fenster nicht gefunden!" );
+ ::osl::ClearableMutexGuard aGuard( m_rMutex );
+@@ -775,6 +856,23 @@ void OInterfaceContainer::implInsert(sal
+ {
+ m_xEventAttacher->insertEntry(_nIndex);
+ m_xEventAttacher->attach( _nIndex, pElementMetaData->xInterface, makeAny( _rxElement ) );
++ // insert fake events?
++ Reference< XEventAttacherManager > xMgr ( pElementMetaData->xInterface, UNO_QUERY );
++ if ( xMgr.is() )
++ {
++ OInterfaceContainer* pIfcMgr = dynamic_cast< OInterfaceContainer* >( xMgr.get() );
++ sal_Int32 nLen = getCount();
++ for ( sal_Int32 i = 0; (i < nLen) && pIfcMgr ; ++i )
++ {
++ // add fake events to the control at index i
++ pIfcMgr->fakeVbaEventsHack( i );
++ }
++ }
++ else
++ {
++ // add fake events to the control at index i
++ fakeVbaEventsHack( _nIndex );
++ }
}
-- pTabBar->InsertPage( (USHORT)nKey, aModName );
-+ if( nKey )
-+ pTabBar->InsertPage( (USHORT)nKey, aModName );
- pTabBar->Sort();
- pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar );
- if ( !pCurWin )
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basidesh.cxx basctl/source/basicide/basidesh.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/basidesh.cxx 2008-01-14 16:00:46.000000000 +0000
-+++ basctl/source/basicide/basidesh.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -97,6 +97,9 @@
- #ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
- #include <com/sun/star/container/XNameContainer.hpp>
- #endif
-+#include <com/sun/star/container/XContainer.hpp>
-+#include <com/sun/star/container/XContainerListener.hpp>
-+#include <com/sun/star/script/XLibraryContainer.hpp>
-
- #include <svx/xmlsecctrl.hxx>
-
-@@ -104,6 +107,71 @@ using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star;
- using ::rtl::OUString;
-+static const rtl::OUString sStandardLibName( rtl::OUString::createFromAscii("Standard") );
-+
-+typedef ::cppu::WeakImplHelper1< container::XContainerListener > ContainerListenerBASE;
-+
-+class ContainerListenerImpl : public ContainerListenerBASE
-+{
-+ BasicIDEShell* mpShell;
-+public:
-+
-+ ContainerListenerImpl( BasicIDEShell* pShell ) : mpShell( pShell ) {}
-+
-+ ~ContainerListenerImpl()
+ // notify derived classes
+@@ -1054,20 +1152,29 @@ void SAL_CALL OInterfaceContainer::remov
+ //------------------------------------------------------------------------
+ void SAL_CALL OInterfaceContainer::registerScriptEvent( sal_Int32 nIndex, const ScriptEventDescriptor& aScriptEvent ) throw(IllegalArgumentException, RuntimeException)
+ {
++ OSL_TRACE("*** registerScriptEvent %d", nIndex);
+ if ( m_xEventAttacher.is() )
+ {
+ m_xEventAttacher->registerScriptEvent( nIndex, aScriptEvent );
++ fakeVbaEventsHack( nIndex ); // add fake vba events
+ }
-+
-+ void addContainerListener( const ScriptDocument& rScriptDocument )
+ }
+
+ //------------------------------------------------------------------------
+ void SAL_CALL OInterfaceContainer::registerScriptEvents( sal_Int32 nIndex, const Sequence< ScriptEventDescriptor >& aScriptEvents ) throw(IllegalArgumentException, RuntimeException)
+ {
++ OSL_TRACE("*** registerScriptEvent(s) %d", nIndex);
+ if ( m_xEventAttacher.is() )
+ {
-+ uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, sStandardLibName, FALSE ), uno::UNO_QUERY );
-+ if ( rScriptDocument.isDocument() && xContainer.is() )
-+ {
-+ uno::Reference< container::XContainerListener > xContainerListener( this );
-+ try
-+ {
-+ xContainer->addContainerListener( xContainerListener );
-+ }
-+ catch( uno::Exception& ) {}
-+ }
+ m_xEventAttacher->registerScriptEvents( nIndex, aScriptEvents );
++ fakeVbaEventsHack( nIndex ); // add fake vba events
+ }
-+ void removeContainerListener( const ScriptDocument& rScriptDocument )
+ }
+
+ //------------------------------------------------------------------------
+ void SAL_CALL OInterfaceContainer::revokeScriptEvent( sal_Int32 nIndex, const ::rtl::OUString& aListenerType, const ::rtl::OUString& aEventMethod, const ::rtl::OUString& aRemoveListenerParam ) throw(IllegalArgumentException, RuntimeException)
+ {
++ OSL_TRACE("*** revokeScriptEvent %d listenertype %s, eventMethod %s", nIndex, rtl::OUStringToOString( aListenerType, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( aEventMethod, RTL_TEXTENCODING_UTF8 ).getStr());
+ if ( m_xEventAttacher.is() )
+ m_xEventAttacher->revokeScriptEvent( nIndex, aListenerType, aEventMethod, aRemoveListenerParam );
+ }
+@@ -1096,9 +1203,16 @@ void SAL_CALL OInterfaceContainer::remov
+ //------------------------------------------------------------------------
+ Sequence< ScriptEventDescriptor > SAL_CALL OInterfaceContainer::getScriptEvents( sal_Int32 nIndex ) throw(IllegalArgumentException, RuntimeException)
+ {
++ OSL_TRACE("getScriptEvents");
+ Sequence< ScriptEventDescriptor > aReturn;
+ if ( m_xEventAttacher.is() )
+ {
-+ uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, sStandardLibName, FALSE ), uno::UNO_QUERY );
-+ if ( rScriptDocument.isDocument(), xContainer.is() )
-+ {
-+ uno::Reference< container::XContainerListener > xContainerListener( this );
-+ try
+ aReturn = m_xEventAttacher->getScriptEvents( nIndex );
++ if ( lcl_hasVbaEvents( aReturn ) )
+ {
-+ xContainer->removeContainerListener( xContainerListener );
++ aReturn = lcl_stripVbaEvents( aReturn );
+ }
-+ catch( uno::Exception& ) {}
-+ }
+ }
+ return aReturn;
+ }
+
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/misc/makefile.mk forms/source/misc/makefile.mk
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/misc/makefile.mk 2005-09-09 00:01:56.000000000 +0100
++++ forms/source/misc/makefile.mk 2008-03-28 10:30:34.000000000 +0000
+@@ -48,6 +48,7 @@ ENABLE_EXCEPTIONS=TRUE
+ # --- Types -------------------------------------
+
+ INCPRE+=$(SOLARINCDIR)$/offuh
++INCPRE*=$(INCCOM)$/$(TARGET)
+
+ # --- Files -------------------------------------
+
+@@ -65,3 +66,12 @@ SLOFILES= $(SLO)$/limitedformats.obj \
+
+ .INCLUDE : target.mk
+
++ALLTAR : \
++ $(MISC)$/$(TARGET).don \
+
-+ // XEventListener
-+ virtual void SAL_CALL disposing( const lang::EventObject& ) throw( uno::RuntimeException ) {}
++$(SLOFILES) : $(MISC)$/$(TARGET).don
+
-+ // XContainerListener
-+ virtual void SAL_CALL elementInserted( const container::ContainerEvent& Event ) throw( uno::RuntimeException )
-+ {
-+ rtl::OUString sModuleName;
-+ if( mpShell && ( Event.Accessor >>= sModuleName ) )
-+ mpShell->FindBasWin( mpShell->m_aCurDocument, sStandardLibName, sModuleName, TRUE, FALSE );
-+ }
-+ virtual void SAL_CALL elementReplaced( const container::ContainerEvent& ) throw( com::sun::star::uno::RuntimeException ) { }
-+ virtual void SAL_CALL elementRemoved( const container::ContainerEvent& Event ) throw( com::sun::star::uno::RuntimeException )
-+ {
-+ rtl::OUString sModuleName;
-+ if( mpShell && ( Event.Accessor >>= sModuleName ) )
-+ {
-+ IDEBaseWindow* pWin = mpShell->FindWindow( mpShell->m_aCurDocument, sStandardLibName, sModuleName, BASICIDE_TYPE_MODULE, TRUE );
-+ if( pWin )
-+ mpShell->RemoveWindow( pWin, FALSE, TRUE );
-+ }
-+ }
++$(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
++ +$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
++ echo $@
+
-+};
-
- TYPEINIT1( BasicIDEShell, SfxViewShell );
+diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/scripting/source/dlgprov/dlgevtatt.hxx scripting/source/dlgprov/dlgevtatt.hxx
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/scripting/source/dlgprov/dlgevtatt.hxx 2008-03-29 23:07:53.000000000 +0000
++++ scripting/source/dlgprov/dlgevtatt.hxx 2008-03-28 12:09:13.000000000 +0000
+@@ -68,6 +68,9 @@
+ #include <com/sun/star/script/XScriptEventsSupplier.hpp>
-@@ -141,6 +209,7 @@ BasicIDEShell::BasicIDEShell( SfxViewFra
- m_bAppBasicModified( FALSE ),
- m_aNotifier( *this )
- {
-+ m_xLibListener = new ContainerListenerImpl( this );
- Init();
- GnBasicIDEShellCount++;
- }
-@@ -156,6 +225,7 @@ BasicIDEShell::BasicIDEShell( SfxViewFra
- m_aNotifier( *this )
+ #include <hash_map>
++
++#define FAKE_VBA_EVENT_SUPPORT 1
++
+ //.........................................................................
+ namespace dlgprov
{
- DBG_ERROR( "Zweite Ansicht auf Debugger nicht moeglich!" );
-+ m_xLibListener = new ContainerListenerImpl( this );
- GnBasicIDEShellCount++;
- }
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/scripting/source/vbaevents/eventhelper.cxx 2008-04-08 14:28:35.000000000 +0100
++++ scripting/source/vbaevents/eventhelper.cxx 2008-04-03 13:28:01.000000000 +0100
+@@ -23,6 +23,7 @@
+ #include <com/sun/star/drawing/XControlShape.hpp>
-@@ -170,6 +240,7 @@ BasicIDEShell::BasicIDEShell( SfxViewFra
- m_aNotifier( *this )
- {
- Init();
-+ m_xLibListener = new ContainerListenerImpl( this );
- GnBasicIDEShellCount++;
- }
-
-@@ -258,6 +329,12 @@ __EXPORT BasicIDEShell::~BasicIDEShell()
- delete pTabBar;
- delete pObjectCatalog;
- DestroyModulWindowLayout();
-+
-+ ContainerListenerImpl* pListener = dynamic_cast< ContainerListenerImpl* >( m_xLibListener.get() );
-+ // Destroy all ContainerListeners for Basic Container.
-+ if ( pListener )
-+ pListener->removeContainerListener( m_aCurDocument );
-+
- // MI: Das gab einen GPF im SDT beim Schliessen da dann der ViewFrame die
- // ObjSh loslaesst. Es wusste auch keiner mehr wozu das gut war.
- // GetViewFrame()->GetObjectShell()->Broadcast( SfxSimpleHint( SFX_HINT_DYING ) );
-@@ -275,6 +352,7 @@ sal_Bool BasicIDEShell::HasBasic() const
-
- void BasicIDEShell::onDocumentCreated( const ScriptDocument& /*_rDocument*/ )
- {
-+ // _rDocument is not a valid ScriptDocument.
- UpdateWindows();
- }
+ #include <com/sun/star/awt/XControl.hpp>
++#include <com/sun/star/awt/XDialog.hpp>
+ #include <com/sun/star/awt/KeyEvent.hpp>
+ #include <com/sun/star/awt/MouseEvent.hpp>
-@@ -303,6 +381,8 @@ void BasicIDEShell::onDocumentSaveAsDone
- // not interested in
+@@ -94,7 +95,7 @@ Sequence< ::rtl::OUString> getEventMetho
+ return aNames;
}
-+//============================================================================
-+
- void BasicIDEShell::onDocumentClosed( const ScriptDocument& _rDocument )
+-// for debug only ( conditionalize out? )
++#if 0
+ void dumpListeners( const Reference< beans::XIntrospection >& xIntrospection, const Reference<XInterface>& xIfc)
{
- if ( !_rDocument.isValid() )
-@@ -402,7 +482,6 @@ void BasicIDEShell::StoreAllWindowData(
- }
+ Reference< beans::XIntrospectionAccess > xIntrospectionAccess;
+@@ -164,6 +165,7 @@ void dumpEvent( const ScriptEvent& evt )
+ }
}
--
- USHORT __EXPORT BasicIDEShell::PrepareClose( BOOL bUI, BOOL bForBrowsing )
- {
- (void)bForBrowsing;
-@@ -600,7 +679,6 @@ void BasicIDEShell::ShowObjectDialog( BO
- }
++#endif
+ bool isKeyEventOk( awt::KeyEvent& evt, const Sequence< Any >& params )
+ {
+@@ -277,6 +279,9 @@ EventInfoHash& getEventTransInfo()
+ info.sVBAName = rtl::OUString::createFromAscii("_Click");
+ info.toVBA = NULL;
+ actionInfos.push_back( info );
++ info.sVBAName = rtl::OUString::createFromAscii("_Change");
++ info.toVBA = NULL;
++ actionInfos.push_back( info );
+ eventTransInfo[ rtl::OUString::createFromAscii("actionPerformed") ] = actionInfos;
+ // changed ooo event
+ std::list< TranslateInfo > changeInfos;
+@@ -336,7 +341,7 @@ EventInfoHash& getEventTransInfo()
+ eventTransInfo[ rtl::OUString::createFromAscii("mousePressed") ] = mousePressedInfos;
+ // mouseMoved ooo event
+ std::list< TranslateInfo > mouseMovedInfos;
+- info.sVBAName = rtl::OUString::createFromAscii("_MouseMoved");
++ info.sVBAName = rtl::OUString::createFromAscii("_MouseMove");
+ info.toVBA = ooMouseEvtToVBAMouseEvt;
+ mouseMovedInfos.push_back( info );
+ eventTransInfo[ rtl::OUString::createFromAscii("mouseMoved") ] = mouseMovedInfos;
+@@ -393,41 +398,17 @@ eventMethodToDescriptors( const ::rtl::O
+ EventInfoHash::const_iterator eventInfo_it = infos.find( sMethodName );
+ EventInfoHash::const_iterator it_end = infos.end();
+- // sLibModName ( could ) include the uri bits :-) from calc
+- rtl::OUString sPartialMacroName = sLibModName + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".") ) + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$macro"));
-
- void __EXPORT BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
- const SfxHint& rHint, const TypeId& )
- {
-@@ -983,7 +1061,15 @@ void BasicIDEShell::SetCurLib( const Scr
- {
- if ( !bCheck || ( rDocument != m_aCurDocument || aLibName != m_aCurLibName ) )
+- if ( sMethodName.getLength()
+- && sTypeName.getLength()
+- && ( infos.find( sMethodName ) != infos.end() ) )
++ if ( infos.find( sMethodName ) != infos.end() )
{
-+ ContainerListenerImpl* pListener = dynamic_cast< ContainerListenerImpl* >( m_xLibListener.get() );
-+ if ( pListener )
-+ pListener->removeContainerListener( m_aCurDocument );
-+
- m_aCurDocument = rDocument;
-+
-+ if ( pListener )
-+ pListener->addContainerListener( m_aCurDocument );
-+
- m_aCurLibName = aLibName;
- if ( bUpdateWindows )
- UpdateWindows();
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/scriptdocument.cxx basctl/source/basicide/scriptdocument.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/basicide/scriptdocument.cxx 2007-10-09 16:24:54.000000000 +0100
-+++ basctl/source/basicide/scriptdocument.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -61,6 +61,7 @@
- #include <com/sun/star/frame/XModel2.hpp>
- #include <com/sun/star/awt/XWindow2.hpp>
- #include <com/sun/star/document/XEmbeddedScripts.hpp>
-+#include <com/sun/star/script/ModuleInfo.hpp>
- /** === end UNO includes === **/
-
- #include <sfx2/objsh.hxx>
-@@ -146,6 +147,7 @@ namespace basctl
- using ::com::sun::star::uno::RuntimeException;
- using ::com::sun::star::document::XEventBroadcaster;
- using ::com::sun::star::document::XEmbeddedScripts;
-+ using ::com::sun::star::script::ModuleInfo;
- /** === end UNO using === **/
- namespace MacroExecMode = ::com::sun::star::document::MacroExecMode;
- namespace FrameSearchFlag = ::com::sun::star::frame::FrameSearchFlag;
-@@ -678,6 +680,15 @@ namespace basctl
- }
-
- // insert element by new name in container
-+ if ( _eType == E_SCRIPTS )
-+ {
-+ ModuleInfo sModuleInfo;
-+ if ( aElement >>= sModuleInfo )
-+ {
-+ sModuleInfo.ModuleName = _rNewName;
-+ aElement <<= sModuleInfo;
-+ }
-+ }
- xLib->insertByName( _rNewName, aElement );
- return true;
- }
-@@ -1433,7 +1444,15 @@ namespace basctl
- Any aCode;
- if ( !m_pImpl->getModuleOrDialog( E_SCRIPTS, _rLibName, _rModName, aCode ) )
- return false;
-- OSL_VERIFY( aCode >>= _out_rModuleSource );
-+ ModuleInfo sModuleInfo;
-+ if ( aCode >>= sModuleInfo )
-+ {
-+ _out_rModuleSource = sModuleInfo.ModuleSource;
-+ }
-+ else
-+ {
-+ OSL_VERIFY( aCode >>= _out_rModuleSource );
-+ }
+- std::list< TranslateInfo >::const_iterator txInfo =
+- eventInfo_it->second.begin();
+- std::list< TranslateInfo >::const_iterator txInfo_end =
+- eventInfo_it->second.end();
+- for ( ; txInfo != txInfo_end; ++txInfo )
+- {
+- // Check if extension is support for this method, if
+- // so create an eventdescription for that
+- const rtl::OUString* pExt = sHandlerExts.getConstArray();
+- sal_Int32 nCount = sHandlerExts.getLength();
+- for ( sal_Int32 counter=0; counter<nCount; ++counter, ++pExt )
+- {
+- if ( (*txInfo).sVBAName.equals( *pExt ) ) // handler for event
+- {
+- sal_Int32 nIndex = evtDescs.getLength();
+- evtDescs.realloc( evtDescs.getLength() + 1 );
+- evtDescs[ nIndex ].ScriptCode = sPartialMacroName + *pExt;
+- evtDescs[ nIndex ].ListenerType = sTypeName;
+- evtDescs[ nIndex ].EventMethod = sMethodName;
+-
+- // set this it VBAInterop, ensures that it doesn't
+- // get persisted or shown in property editors
+- evtDescs[ nIndex ].ScriptType = rtl::OUString::createFromAscii( "VBAInterop" );
+- }
+- }
+- }
++ sal_Int32 nIndex = evtDescs.getLength();
++ evtDescs.realloc( evtDescs.getLength() + 1 );
++ evtDescs[ nIndex ].ScriptType = rtl::OUString::createFromAscii( "VBAInterop" );
++ evtDescs[ nIndex ].ScriptCode = sLibModName; // codeName
++ evtDescs[ nIndex ].ListenerType = sTypeName;
++ evtDescs[ nIndex ].EventMethod = sMethodName;
return true;
}
-
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/inc/basidesh.hxx basctl/source/inc/basidesh.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basctl/source/inc/basidesh.hxx 2007-10-09 16:25:06.000000000 +0100
-+++ basctl/source/inc/basidesh.hxx 2008-03-28 10:30:34.000000000 +0000
-@@ -62,7 +62,7 @@
- #ifndef _COM_SUN_STAR_IO_XINPUTSTREAMPROVIDER_HXX_
- #include <com/sun/star/io/XInputStreamProvider.hpp>
- #endif
--
-+#include <com/sun/star/container/XContainerListener.hpp>
-
- //----------------------------------------------------------------------------
-
-@@ -90,13 +90,15 @@ DECLARE_TABLE( IDEWindowTable, IDEBaseWi
- typedef Table IDEWindowTable;
- #endif
-
-+namespace css = ::com::sun::star;
+
- class BasicIDEShell :public SfxViewShell
- ,public ::basctl::DocumentEventListener
- {
- friend class JavaDebuggingListenerImpl;
- friend class LocalizationMgr;
- friend class BasicIDE;
--
-+friend class ContainerListenerImpl;
- ObjectCatalog* pObjectCatalog;
-
- IDEWindowTable aIDEWindowTable;
-@@ -116,6 +118,7 @@ friend class BasicIDE;
- BOOL m_bAppBasicModified;
- ::basctl::DocumentEventNotifier
- m_aNotifier;
-+ css::uno::Reference< css::container::XContainerListener > m_xLibListener;
+ return false;
- #if _SOLAR__PRIVATE
- void Init();
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbdef.hxx basic/inc/basic/sbdef.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbdef.hxx 2007-04-11 13:51:38.000000000 +0100
-+++ basic/inc/basic/sbdef.hxx 2008-03-28 10:30:34.000000000 +0000
-@@ -100,6 +100,8 @@ void setBasicWatchMode( bool bOn );
+ }
+@@ -522,8 +503,10 @@ ScriptEventFactory::getEventListeners( c
+ Reference< beans::XIntrospection > xIntrospection(
+ xMFac->createInstanceWithContext( rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.Introspection" ) ), instance().m_xCtx ), UNO_QUERY );
+- //dumpListeners( xIntrospection, xControl );
+- //dumpListeners( xIntrospection, xControl->getModel() );
++#if 0
++ dumpListeners( xIntrospection, xControl );
++ dumpListeners( xIntrospection, xControl->getModel() );
++#endif
+ Reference< beans::XIntrospectionAccess > xIntrospectionAccess;
+ if ( xIntrospection.is() )
+ {
+@@ -583,7 +566,8 @@ ScriptEventFactory::createEvents( const
+ ::rtl::OUString sNoNameSpaceMethod = *pSrc;
+ if ( ( lastDotIndex = pSrc->lastIndexOf( '.' ) ) > -1 )
+ sNoNameSpaceMethod = sNoNameSpaceMethod.copy( lastDotIndex + 1 );
+- Sequence< ScriptEventDescriptor> evtDescs;
++
++ Sequence< ScriptEventDescriptor > evtDescs;
+ if ( eventMethodToDescriptors( sNoNameSpaceMethod, xControl, sLibModName, sHandlerExts, evtDescs ) )
+ {
+ sal_Int32 dIndex = nEvts;
+@@ -826,13 +810,28 @@ EventListener::getPropertySetInfo( ) th
+ void
+ EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet ) throw(RuntimeException)
+ {
+- OSL_TRACE("EventListener::firing_Impl !!!");
++ OSL_TRACE("EventListener::firing_Impl( FAKE VBA_EVENTS )");
+ static const ::rtl::OUString vbaInterOp =
+ ::rtl::OUString::createFromAscii("VBAInterop");
- #define SBXID_BASIC 0x6273 // sb: StarBASIC
- #define SBXID_BASICMOD 0x6d62 // bm: StarBASIC-Modul
-+#define SBXID_DOCUMENTMOD 0x6d63 // Special document Module
-+#define SBXID_USERFORMMOD 0x6d64 // Special userform Module
- #define SBXID_BASICPROP 0x7262 // pr: StarBASIC-Property
- #define SBXID_BASICMETHOD 0x6d65 // me: StarBASIC-Methode
- #define SBXID_JSCRIPTMOD 0x6a62 // jm: JavaScript-Modul
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbstar.hxx basic/inc/basic/sbstar.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbstar.hxx 2007-08-30 10:58:14.000000000 +0100
-+++ basic/inc/basic/sbstar.hxx 2008-03-28 10:30:34.000000000 +0000
-@@ -51,6 +51,7 @@
-
- #include <basic/sbdef.hxx>
- #include <basic/sberrors.hxx>
-+#include <com/sun/star/script/ModuleInfo.hpp>
-
- class SbModule; // fertiges Modul
- class SbiInstance; // Laufzeit-Instanz
-@@ -82,6 +83,7 @@ class StarBASIC : public SbxObject
- BOOL bNoRtl; // TRUE: RTL nicht durchsuchen
- BOOL bBreak; // TRUE: Break, sonst Step
- BOOL bDocBasic;
-+ BOOL bVBAEnabled;
- BasicLibInfo* pLibInfo; // Infoblock fuer Basic-Manager
- SbLanguageMode eLanguageMode; // LanguageMode des Basic-Objekts
- protected:
-@@ -124,7 +126,8 @@ public:
-
- // Compiler-Interface
- SbModule* MakeModule( const String& rName, const String& rSrc );
-- SbModule* MakeModule32( const String& rName, const ::rtl::OUString& rSrc );
-+ SbModule* MakeModule32( const String& rName, const ::rtl::OUString& rSrc );
-+ SbModule* MakeObjModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo );
- BOOL Compile( SbModule* );
- BOOL Disassemble( SbModule*, String& rText );
- static void Stop();
-@@ -196,6 +199,8 @@ public:
- ( const String& rName, USHORT& rStatus );
- static SbMethod* GetActiveMethod( USHORT nLevel = 0 );
- static SbModule* GetActiveModule();
-+ void SetVBAEnabled( BOOL bEnabled );
-+ BOOL isVBAEnabled();
-
- // #60175 TRUE: SFX-Resource wird bei Basic-Fehlern nicht angezogen
- static void StaticSuppressSfxResource( BOOL bSuppress );
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbxobj.hxx basic/inc/basic/sbxobj.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/inc/basic/sbxobj.hxx 2007-04-11 13:55:16.000000000 +0100
-+++ basic/inc/basic/sbxobj.hxx 2008-03-28 10:30:34.000000000 +0000
-@@ -80,7 +80,7 @@ public:
- virtual SbxClassType GetClass() const;
- virtual void Clear();
-
-- virtual BOOL IsClass( const String& ) const;
-+ virtual BOOL IsClass( const String& );
- const String& GetClassName() const { return aClassName; }
- void SetClassName( const String &rNew ) { aClassName = rNew; }
- // Default-Property
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/basmgr/basmgr.cxx basic/source/basmgr/basmgr.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/basmgr/basmgr.cxx 2007-08-30 10:58:48.000000000 +0100
-+++ basic/source/basmgr/basmgr.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -102,6 +102,8 @@
- #include <com/sun/star/script/XStarBasicDialogInfo.hpp>
- #include <com/sun/star/script/XStarBasicLibraryInfo.hpp>
- #include <com/sun/star/script/XLibraryContainerPassword.hpp>
-+#include <com/sun/star/script/ModuleInfo.hpp>
-+#include <com/sun/star/script/ModuleType.hpp>
-
- #include <cppuhelper/implbase1.hxx>
-
-@@ -145,6 +147,7 @@ static const char* szScriptLanguage = "S
- static const String BasicStreamName( String::CreateFromAscii(szBasicStorage) );
- static const String ManagerStreamName( String::CreateFromAscii(szManagerStream) );
-
-+//enum ModuleType { Unknown = 0, Normal, Class, Form, Document };
-
- #define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII))
+ // let default handlers deal with non vba stuff
+ if ( !evt.ScriptType.equals( vbaInterOp ) )
+ return;
++ lang::EventObject aEvent;
++ evt.Arguments[ 0 ] >>= aEvent;
++ OSL_TRACE("Argument[0] is %s", rtl::OUStringToOString( comphelper::anyToString( evt.Arguments[0] ), RTL_TEXTENCODING_UTF8 ).getStr() );
++ OSL_TRACE("Getting Control");
++ uno::Reference< awt::XControl > xControl( aEvent.Source, uno::UNO_QUERY_THROW );
++ OSL_TRACE("Getting properties");
++ uno::Reference< beans::XPropertySet > xProps( xControl->getModel(), uno::UNO_QUERY_THROW );
++ rtl::OUString sName;
++ OSL_TRACE("Getting Name");
++
++ uno::Reference< awt::XDialog > xDlg( aEvent.Source, uno::UNO_QUERY );
++ if ( xDlg.is() )
++ sName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UserForm") );
++ else
++ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) >>= sName;
+ //dumpEvent( evt );
+ EventInfoHash& infos = getEventTransInfo();
+ EventInfoHash::const_iterator eventInfo_it = infos.find( evt.MethodName );
+@@ -858,14 +857,11 @@ EventListener::firing_Impl(const ScriptE
+ {
+ // see if we have a match for the handlerextension
+ // where ScriptCode is methodname_handlerextension
+- rtl::OUString sTemp = evt.ScriptCode;
+- sal_Int32 lastIndexOf_ = sTemp.lastIndexOf( '_' );
+- if ( lastIndexOf_ != -1 )
+- sTemp = sTemp.copy( lastIndexOf_ );
+- OSL_TRACE("*** trying to match %s with %s",
+- rtl::OUStringToOString( sTemp, RTL_TEXTENCODING_UTF8 ).getStr(),
+- rtl::OUStringToOString( (*txInfo).sVBAName, RTL_TEXTENCODING_UTF8 ).getStr() );
+- if ( sTemp.equals( (*txInfo).sVBAName ) )
++ rtl::OUString sTemp = rtl::OUString::createFromAscii("Standard.").concat( evt.ScriptCode ).concat( rtl::OUString::createFromAscii(".") ).concat( sName ).concat( (*txInfo).sVBAName );
++
++ OSL_TRACE("*** trying to invoke %s ",
++ rtl::OUStringToOString( sTemp, RTL_TEXTENCODING_UTF8 ).getStr() );
++ //if ( sTemp.equals( (*txInfo).sVBAName ) )
+ {
+ // !! translate arguments & emulate events where necessary
+ Sequence< Any > aArguments;
+@@ -881,7 +877,7 @@ EventListener::firing_Impl(const ScriptE
+ static rtl::OUString part2 = rtl::OUString::createFromAscii("?language=Basic&location=document");
-@@ -280,9 +283,22 @@ void BasMgrContainerListenerImpl::addLib
- {
- OUString aModuleName = pNames[ j ];
- Any aElement = xLibNameAccess->getByName( aModuleName );
-+ ModuleInfo mInfo;
- OUString aMod;
-- aElement >>= aMod;
-- pLib->MakeModule32( aModuleName, aMod );
-+ sal_Int16 mType;
-+ if ( aElement >>= mInfo )
-+ {
-+ aMod = mInfo.ModuleSource;
-+ mType = mInfo.ModuleType;
-+ OSL_TRACE("#1 - aMod");
-+ //pLib->MakeModule32( aModuleName, aMod, SBXID_DOCUMENTMOD );
-+ pLib->MakeObjModule( aModuleName, mInfo );
-+ }
-+ else
-+ {
-+ aElement >>= aMod;
-+ pLib->MakeModule32( aModuleName, aMod );
-+ }
- }
+ // create script url
+- rtl::OUString url = part1 + evt.ScriptCode + part2;
++ rtl::OUString url = part1 + sTemp + part2;
+
+ OSL_TRACE("script url = %s",
+ rtl::OUStringToOString( url,
+@@ -893,16 +889,7 @@ EventListener::firing_Impl(const ScriptE
+ {
+ uno::Reference< script::provider::XScript > xScript = xScriptProvider->getScript( url );
+ if ( xScript.is() )
+- {
+- uno::Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY );
+- if ( xProps.is() )
+- {
+- Sequence< Any > aCallerHack(1);
+- aCallerHack[ 0 ] = uno::makeAny( rtl::OUString::createFromAscii("Error") );
+- xProps->setPropertyValue( rtl::OUString::createFromAscii( "Caller" ), uno::makeAny( aCallerHack ) );
+- }
+- xScript->invoke( aArguments, aOutArgsIndex, aOutArgs );
+- }
++ xScript->invoke( aArguments, aOutArgsIndex, aOutArgs );
+ }
+ catch ( uno::Exception& e )
+ {
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/docshell/vbaevents.cxx 2008-04-08 14:28:35.000000000 +0100
++++ sc/source/ui/docshell/vbaevents.cxx 2008-04-06 18:32:45.000000000 +0100
+@@ -60,11 +60,7 @@ const static rtl::OUString sUrlPart2 = r
+ rtl::OUString sCodeName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisWorkbook") );
+ if ( pShell )
+ {
+- if ( ScExtDocOptions* pExtDocOpts = pShell->GetDocument()->GetExtDocOptions() )
+- {
+- if ( pExtDocOpts->GetDocSettings().maGlobCodeName.Len() > 0 )
+- sCodeName = pExtDocOpts->GetDocSettings().maGlobCodeName;
+- }
++ pShell->GetDocument()->GetCodeName();
}
+ return sCodeName;
+ }
+@@ -103,6 +99,8 @@ bool executeWorkBookMacro( ScDocShell* p
+ String docMacroExists( ScDocShell* pShell,
+ const String& sMod, const String& sMacro )
+ {
++OSL_TRACE( "*** docMacroExists for macro %s, module ->%s<-",
++ rtl::OUStringToOString( sMacro, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( sMacro, RTL_TEXTENCODING_UTF8 ).getStr() );
+ String sFullName;
+ // would use the script provider to see if the macro exists but
+ // called at this stage tdoc content handler stuff is not set up
+@@ -137,7 +135,8 @@ const String& sMod, const String& sMacro
+ }
+ }
+ }
+- else if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pBasic->Find( sMacro, SbxCLASS_METHOD ) ) )
++ //else if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pBasic->Find( sMacro, SbxCLASS_METHOD ) ) )
++ else if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pBasic->Find( sMacro, SbxCLASS_DONTCARE ) ) )
+ {
+ if( SbModule* pModule = pMethod->GetModule() )
+ {
+@@ -159,7 +158,8 @@ bool processDocBeforeCloseMacro( ScDocSh
+ bool bCancel = sal_False;
+ aArgs[ 0 ] <<= bCancel;
+ const static String sBeforeClose( RTL_CONSTASCII_USTRINGPARAM("Workbook_BeforeClose") );
+- String sFullClose = docMacroExists( pShell, String(), sBeforeClose );
++ rtl::OUString workbookModule = getWorkbookModuleName( pShell );
++ String sFullClose = docMacroExists( pShell, workbookModule, sBeforeClose );
+ if ( sFullClose.Len() > 0 )
+ {
+ if ( !executeWorkBookMacro( pShell, sFullClose, aArgs, aRet ) )
+@@ -224,8 +224,8 @@ bool processDocOpenMacro( ScDocShell* pS
+ // until ObjectModules ( and persisting of codename ) are supported if this is a
+ // document saved from XL then we won't be able to determine the codename for the Workbook
+ // Module, so... we have no choice but to search all modules for the moment
+- //rtl::OUString workbookModule = getWorkbookModuleName( pShell );
+- rtl::OUString workbookModule; // no name means all modules will be searched
++ rtl::OUString workbookModule = getWorkbookModuleName( pShell );
++ //rtl::OUString workbookModule; // no name means all modules will be searched
+ String sFullOpen = docMacroExists( pShell, workbookModule, sOpenMacro );
+ if ( sFullOpen.Len() > 0 )
+ {
+@@ -316,12 +316,8 @@ uno::Any createRange( const uno::Any& aR
-@@ -319,8 +335,16 @@ void SAL_CALL BasMgrContainerListenerImp
- }
- else
- {
-+ ModuleInfo mInfo;
- OUString aMod;
-- Event.Element >>= aMod;
-+ sal_Int16 mType;
-+ if( Event.Element >>= mInfo )
-+ {
-+ aMod = mInfo.ModuleSource;
-+ mType = mInfo.ModuleType;
-+ }
-+ else
-+ Event.Element >>= aMod;
+ String getSheetModuleName( ScDocShell* pShell, SCTAB nTab )
+ {
+- ScExtDocOptions* pExtOptions = pShell->GetDocument()->GetExtDocOptions();
+ String aCodeName;
+- pShell->GetDocument()->GetName( nTab, aCodeName);
+- // Use code name if that exists
+- if ( pExtOptions )
+- aCodeName = pExtOptions->GetCodeName( nTab );
++ pShell->GetDocument()->GetCodeName( nTab, aCodeName);
+ return aCodeName;
+ }
- StarBASIC* pLib = mpMgr->GetLib( maLibName );
- DBG_ASSERT( pLib, "BasMgrContainerListenerImpl::elementInserted: Unknown lib!");
-@@ -329,7 +353,15 @@ void SAL_CALL BasMgrContainerListenerImp
- SbModule* pMod = pLib->FindModule( aName );
- if( !pMod )
- {
-- pLib->MakeModule32( aName, aMod );
-+ if ( mType == ::com::sun::star::script::ModuleType::Document )
-+ {
-+ //pLib->MakeModule32( aName, aMod, SBXID_DOCUMENTMOD );
-+ pLib->MakeObjModule( aName, mInfo );
-+ }
-+ else
-+ {
-+ pLib->MakeModule32( aName, aMod );
-+ }
- pLib->SetModified( FALSE );
- }
- }
-@@ -356,12 +388,27 @@ void SAL_CALL BasMgrContainerListenerImp
- if( pLib )
- {
- SbModule* pMod = pLib->FindModule( aName );
-+ ModuleInfo mInfo;
- OUString aMod;
-+ sal_Int16 mType;
- Event.Element >>= aMod;
- if( pMod )
- pMod->SetSource32( aMod );
- else
-- pLib->MakeModule32( aName, aMod );
-+ {
-+ if( Event.Element >>= mInfo )
-+ {
-+ aMod = mInfo.ModuleSource;
-+ mType = mInfo.ModuleType;
-+ //pLib->MakeModule32( aName, aMod, SBXID_DOCUMENTMOD );
-+ pLib->MakeObjModule( aName, mInfo );
-+ }
-+ else
-+ {
-+ Event.Element >>= aMod;
-+ pLib->MakeModule32( aName, aMod );
-+ }
-+ }
-
- pLib->SetModified( FALSE );
- }
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/classes/sb.cxx basic/source/classes/sb.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/classes/sb.cxx 2008-03-29 23:08:18.000000000 +0000
-+++ basic/source/classes/sb.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -70,6 +70,7 @@
- #include "disas.hxx"
- #include "runtime.hxx"
- #include <basic/sbuno.hxx>
-+#include <basic/sbobjmod.hxx>
- #include "stdobj.hxx"
- #include "filefmt.hxx"
- #include "sb.hrc"
-@@ -79,6 +80,10 @@
- #include <vos/mutex.hxx>
- #endif
-
-+#include <com/sun/star/script/ModuleType.hpp>
-+#include <com/sun/star/script/ModuleInfo.hpp>
-+using namespace ::com::sun::star::script;
-+
- // #pragma SW_SEGMENT_CLASS( SBASIC, SBASIC_CODE )
-
- SV_IMPL_VARARR(SbTextPortions,SbTextPortion)
-@@ -667,6 +672,7 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL
- SetParent( p );
- pLibInfo = NULL;
- bNoRtl = bBreak = FALSE;
-+ bVBAEnabled = FALSE;
- pModules = new SbxArray;
-
- if( !GetSbData()->nInst++ )
-@@ -769,13 +775,36 @@ SbModule* StarBASIC::MakeModule( const S
-
- SbModule* StarBASIC::MakeModule32( const String& rName, const ::rtl::OUString& rSrc )
- {
-- SbModule* p = new SbModule( rName );
-+ SbModule* p = new SbModule( rName );
- p->SetSource32( rSrc );
- p->SetParent( this );
- pModules->Insert( p, pModules->Count() );
- SetModified( TRUE );
- return p;
- }
-+SbModule* StarBASIC::MakeObjModule( const String& rName, const ModuleInfo& mInfo )
-+{
-+
-+ SbObjModule* p = NULL;
-+ switch ( mInfo.ModuleType )
-+ {
-+ case ModuleType::Document:
-+ p = new SbObjModule( rName, mInfo );
-+ break;
-+ case ModuleType::Form:
-+ p = new SbUserFormModule( rName, mInfo );
-+ break;
-+ default:
-+ break; //
-+ }
-+ if ( p )
-+ {
-+ pModules->Insert( p, pModules->Count() );
-+ SetModified( TRUE );
-+ p->SetParent( this );
-+ }
-+ return p;
-+}
-
- void StarBASIC::Insert( SbxVariable* pVar )
- {
-@@ -948,6 +977,9 @@ SbxVariable* StarBASIC::Find( const Stri
- }
- pNamed = p;
- }
-+ if ( p->GetSbxId() == SBXID_DOCUMENTMOD
-+ || p->GetSbxId() == SBXID_USERFORMMOD )
-+ continue;
- // Sonst testen, ob das Element vorhanden ist
- // GBLSEARCH-Flag rausnehmen (wg. Rekursion)
- USHORT nGblFlag = p->GetFlags() & SBX_GBLSEARCH;
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/classes/sbxmod.cxx 2008-04-08 12:03:51.000000000 +0100
-+++ basic/source/classes/sbxmod.cxx 2008-04-06 21:34:40.000000000 +0100
-@@ -62,6 +62,9 @@
- #include "sbunoobj.hxx"
- #include <basic/hilight.hxx>
- #include <basic/basrdll.hxx>
-+#include <basic/sbobjmod.hxx>
-+#include <com/sun/star/script/XObjectProvider.hpp>
-+#include <com/sun/star/lang/XServiceInfo.hpp>
-
- #ifndef _VOS_MUTEX_HXX_
- #include <vos/mutex.hxx>
-@@ -80,7 +83,20 @@
-
- #include <stdio.h>
-
-+#include <comphelper/processfactory.hxx>
-+#include <com/sun/star/script/XLibraryContainer.hpp>
-+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-+#include <com/sun/star/awt/XDialogProvider.hpp>
-+#include <com/sun/star/awt/XTopWindow.hpp>
-+#include <com/sun/star/awt/XControl.hpp>
-+#include <com/sun/star/frame/XModel.hpp>
-+#include <cppuhelper/implbase1.hxx>
-+#include <comphelper/anytostring.hxx>
-+
-+using namespace ::com::sun::star;
-+
- static const String sThisWorkbook( RTL_CONSTASCII_USTRINGPARAM("ThisWorkbook"));
-+static const rtl::OUString sStandard( RTL_CONSTASCII_USTRINGPARAM("Standard") );
-
- TYPEINIT1(SbModule,SbxObject)
- TYPEINIT1(SbMethod,SbxMethod)
-@@ -88,6 +104,8 @@ TYPEINIT1(SbProperty,SbxProperty)
- TYPEINIT1(SbProcedureProperty,SbxProperty)
- TYPEINIT1(SbJScriptModule,SbModule)
- TYPEINIT1(SbJScriptMethod,SbMethod)
-+TYPEINIT1(SbObjModule,SbModule)
-+TYPEINIT1(SbUserFormModule,SbModule)
-
- SV_DECL_VARARR(SbiBreakpoints,USHORT,4,4)
- SV_IMPL_VARARR(SbiBreakpoints,USHORT)
-@@ -1903,6 +1921,307 @@ void SyntaxHighlighter::getHighlightPort
- m_pSimpleTokenizer->getHighlightPortions( nLine, rLine, portions );
- }
-
-+/////////////////////////////////////////////////////////////////////////
-+SbObjModule::SbObjModule( const rtl::OUString& rName, const com::sun::star::script::ModuleInfo& mInfo )
-+ :SbModule( rName ), pDocObject( NULL )
-+{
-+ m_mInfo = mInfo;
-+ SetSource32( mInfo.ModuleSource );
-+}
-+
-+BOOL
-+SbObjModule::IsClass( const XubString& rName )
-+{
-+ GetObject();
-+ return SbxObject::IsClass( rName );
-+}
-+
-+SbxVariable*
-+SbObjModule::GetObject()
-+{
-+ if( !pDocObject )
-+ InitObject();
-+ return pDocObject;
-+}
-+SbxVariable*
-+SbObjModule::Find( const XubString& rName, SbxClassType t )
-+{
-+ //OSL_TRACE("SbObjectModule find for %s", rtl::OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr() );
-+ if ( !pDocObject )
-+ InitObject();
-+ //OSL_TRACE("!!!!try to find in derived module " );
-+ SbxVariable* pVar = NULL;
-+ if ( !pVar && pDocObject)
-+ {
-+ pVar = pDocObject->Find( rName, t );
-+ if ( pVar )
-+ {
-+ //OSL_TRACE("found in uno (psuedo-base) object" );
-+ }
-+ else
-+ {
-+ //OSL_TRACE("NOT found in uno (psuedo-base) object" );
-+ }
-+ }
-+ if ( !pVar )
-+ {
-+ pVar = SbModule::Find( rName, t );
-+ if ( pVar )
-+ {
-+ //OSL_TRACE("! found in (normal) module " );
-+ }
-+ }
-+
-+ return pVar;
-+}
-+
-+void
-+SbObjModule::InitObject()
-+{
-+ // OSL_TRACE("Initialize pDocObject");
-+ try
-+ {
-+ com::sun::star::uno::Reference< com::sun::star::script::XObjectProvider > xObjectProvider( m_mInfo.ModuleObjectProvider, com::sun::star::uno::UNO_QUERY_THROW );
-+ com::sun::star::uno::Any aObject = xObjectProvider->getObject();
-+ pDocObject = new SbUnoObject( GetName(), aObject );
-+ com::sun::star::uno::Reference< com::sun::star::lang::XServiceInfo > xServiceInfo( aObject, com::sun::star::uno::UNO_QUERY_THROW );
-+ if( xServiceInfo->supportsService( rtl::OUString::createFromAscii( "org.openoffice.excel.Worksheet" ) ) )
-+ {
-+ SetClassName( rtl::OUString::createFromAscii( "Worksheet" ) );
-+ }
-+ else if( xServiceInfo->supportsService( rtl::OUString::createFromAscii( "org.openoffice.excel.Workbook" ) ) )
-+ {
-+ SetClassName( rtl::OUString::createFromAscii( "Workbook" ) );
-+ }
-+ }catch( com::sun::star::uno::RuntimeException e )
-+ {
-+ //OSL_TRACE("Object is not exist." );
-+ }
-+}
-+
-+typedef ::cppu::WeakImplHelper1< awt::XTopWindowListener > EventListener_BASE;
-+
-+class FormObjEventListenerImpl : public EventListener_BASE
-+{
-+ class ActivateGuard
-+ {
-+ public:
-+ ActivateGuard() { ++getCounter(); }
-+ virtual ~ActivateGuard() { --getCounter(); }
-+ virtual int& getCounter()
-+ {
-+ static int activateCount = 0;
-+ return activateCount;
-+ }
-+ bool alreadyProcessing() { return ( getCounter() > 1 ); }
-+ };
-+
-+ class DeActivateGuard
-+ {
-+ public:
-+ DeActivateGuard() { ++getCounter(); }
-+ virtual ~DeActivateGuard() { --getCounter(); }
-+ virtual int& getCounter()
-+ {
-+ static int deactivateCount = 0;
-+ return deactivateCount;
-+ }
-+ bool alreadyProcessing() { return ( getCounter() > 1 ); }
-+ };
-+
-+ SbUserFormModule* mpUserForm;
-+ uno::Reference< lang::XComponent > mxComponent;
-+ bool mbDisposed;
-+ FormObjEventListenerImpl(); // not defined
-+ FormObjEventListenerImpl(const FormObjEventListenerImpl&); // not defined
-+public:
-+ FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) : mpUserForm( pUserForm ), mxComponent( xComponent) , mbDisposed( false )
-+ {
-+ if ( mxComponent.is() );
-+ {
-+ uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
-+ //uno::Reference< awt::XWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
-+ OSL_TRACE("*********** Registering the listener");
-+ xList->addTopWindowListener( this );
-+ }
-+ }
-+
-+ ~FormObjEventListenerImpl()
-+ {
-+ removeListener();
-+ }
-+ void removeListener()
-+ {
-+ try
-+ {
-+ if ( mxComponent.is() && !mbDisposed )
-+ {
-+ uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
-+ OSL_TRACE("*********** Removing the listener");
-+ xList->removeTopWindowListener( this );
-+ mxComponent = NULL;
-+ }
-+ }
-+ catch( uno::Exception& ) {}
-+ }
-+ virtual void SAL_CALL windowOpened( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) {}
-+ virtual void SAL_CALL windowClosing( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) {}
-+ virtual void SAL_CALL windowClosed( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) {}
-+ virtual void SAL_CALL windowMinimized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) {}
-+ virtual void SAL_CALL windowNormalized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException){}
-+ virtual void SAL_CALL windowActivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
-+ {
-+// ActivateGuard aGuard;
-+// if ( mpUserForm && !aGuard.alreadyProcessing() )
-+ if ( mpUserForm )
-+ mpUserForm->triggerActivateEvent();
-+ }
-+
-+ virtual void SAL_CALL windowDeactivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException)
-+ {
-+// DeActivateGuard aGuard;
-+// if ( mpUserForm && !aGuard.alreadyProcessing() )
-+ if ( mpUserForm )
-+ mpUserForm->triggerDeActivateEvent();
-+ }
-+
-+
-+ virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw (uno::RuntimeException)
-+ {
-+ OSL_TRACE("** Userform/Dialog disposing");
-+ mbDisposed = true;
-+ uno::Any aSource;
-+ aSource <<= Source;
-+ mxComponent = NULL;
-+ if ( mpUserForm )
-+ mpUserForm->ResetApiObj();
-+ }
-+};
-+
-+SbUserFormModule::SbUserFormModule( const rtl::OUString& rName, const com::sun::star::script::ModuleInfo& mInfo )
-+ :SbObjModule( rName, mInfo ), m_bUnloaded( true )
-+{
-+}
-+
-+void SbUserFormModule::ResetApiObj( bool bUnload )
-+{
-+ if ( m_xDialog.is() ) // probably someone close the dialog window
-+ {
-+ triggerTerminateEvent();
-+ }
-+ pDocObject = NULL;
-+ m_xDialog = NULL;
-+}
-+
-+void SbUserFormModule::triggerMethod( const String& aMethodToRun )
-+{
-+ OSL_TRACE("*** trigger %s ***", rtl::OUStringToOString( aMethodToRun, RTL_TEXTENCODING_UTF8 ).getStr() );
-+ // Search method
-+ SbxVariable* pMeth = SbObjModule::Find( aMethodToRun, SbxCLASS_METHOD );
-+ if( pMeth )
-+ {
-+ SbxValues aVals;
-+ pMeth->Get( aVals );
-+ }
-+}
-+
-+void SbUserFormModule::triggerActivateEvent( void )
-+{
-+ OSL_TRACE("**** entering SbUserFormModule::triggerActivate");
-+ triggerMethod( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UserForm_activate") ) );
-+ OSL_TRACE("**** leaving SbUserFormModule::triggerActivate");
-+}
-+
-+void SbUserFormModule::triggerDeActivateEvent( void )
-+{
-+ OSL_TRACE("**** SbUserFormModule::triggerDeActivate");
-+ triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_DeActivate") ) );
-+}
-+
-+void SbUserFormModule::triggerInitializeEvent( void )
-+
-+{
-+ OSL_TRACE("**** SbUserFormModule::triggerInitializeEvent");
-+ static String aInitMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Initialize") );
-+ triggerMethod( aInitMethodName );
-+
-+}
-+
-+void SbUserFormModule::triggerTerminateEvent( void )
-+{
-+ OSL_TRACE("**** SbUserFormModule::triggerTerminateEvent");
-+ static String aTermMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Terminate") );
-+ triggerMethod( aTermMethodName );
-+}
-+
-+void SbUserFormModule::load()
-+{
-+ OSL_TRACE("** load() ");
-+ GetObject(); // forces a load
-+}
-+void SbUserFormModule::Unload()
-+{
-+ OSL_TRACE("** Unload() ");
-+ if ( m_xDialog.is() )
-+ {
-+ triggerTerminateEvent();
-+ }
-+ // Search method
-+ SbxVariable* pMeth = SbObjModule::Find( String( RTL_CONSTASCII_USTRINGPARAM( "UnloadObject" ) ), SbxCLASS_METHOD );
-+ if( pMeth )
-+ {
-+ OSL_TRACE("Attempting too run the UnloadObjectMethod");
-+ m_xDialog = NULL; //release ref to the uno object
-+ SbxValues aVals;
-+ pMeth->Get( aVals );
-+ }
-+}
-+
-+void SbUserFormModule::InitObject()
-+{
-+ try
-+ {
-+
-+ uno::Reference< frame::XModel > xModel( m_mInfo.ModuleObjectProvider, uno::UNO_QUERY_THROW );
-+ if ( xModel.is() )
-+ {
-+ uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
-+ uno::Sequence< uno::Any > aArgs(1);
-+ aArgs[ 0 ] <<= xModel;
-+ rtl::OUString sDialogUrl( RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.script:" ) );
-+ sDialogUrl = sDialogUrl.concat( sStandard ).concat( rtl::OUString( '.') ).concat( m_mInfo.ModuleName ).concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("?location=document") ) );
-+
-+ uno::Reference< awt::XDialogProvider > xProvider( xFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.DialogProvider")), aArgs ), uno::UNO_QUERY_THROW );
-+ m_xDialog = xProvider->createDialog( sDialogUrl );
-+
-+ // create vba api object
-+ aArgs.realloc( 3 );
-+ aArgs[ 0 ] = uno::Any();
-+ aArgs[ 1 ] <<= m_xDialog;
-+ aArgs[ 2 ] <<= xModel;
-+ pDocObject = new SbUnoObject( GetName(), uno::makeAny( xFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.UserForm")), aArgs ) ) );
-+ uno::Reference< lang::XComponent > xComponent( aArgs[ 1 ], uno::UNO_QUERY_THROW );
-+ // remove old listener if it exists
-+ FormObjEventListenerImpl* pFormListener = dynamic_cast< FormObjEventListenerImpl* >( m_DialogListener.get() );
-+ if ( pFormListener )
-+ pFormListener->removeListener();
-+ m_DialogListener = new FormObjEventListenerImpl( this, xComponent );
-+
-+ // trigger initialise event
-+ triggerInitializeEvent();
-+ }
-+ }
-+ catch( uno::Exception& e )
-+ {
-+ }
-+
-+}
-+
-+SbxVariable*
-+SbUserFormModule::Find( const XubString& rName, SbxClassType t )
-+{
-+ return SbObjModule::Find( rName, t );
-+}
-
- /////////////////////////////////////////////////////////////////////////
- // Implementation SbJScriptModule (Basic-Modul fuer JavaScript-Sourcen)
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/methods1.cxx basic/source/runtime/methods1.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/methods1.cxx 2007-09-20 16:55:19.000000000 +0100
-+++ basic/source/runtime/methods1.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -60,6 +60,9 @@
- #ifndef _SBX_HXX
- #include <basic/sbx.hxx>
- #endif
-+#ifndef _SBSTAR_HXX
-+#include <basic/sbstar.hxx>
-+#endif
- #ifndef _ZFORLIST_HXX //autogen
- #include <svtools/zforlist.hxx>
- #endif
-@@ -86,6 +89,7 @@
- #endif
-
- #include <vcl/jobset.hxx>
-+#include <basic/sbobjmod.hxx>
-
- #include "sbintern.hxx"
- #include "runtime.hxx"
-@@ -2611,13 +2615,22 @@ RTLFUNC(Me)
-
- SbModule* pActiveModule = pINST->GetActiveModule();
- SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pActiveModule);
-+ SbxVariableRef refVar = rPar.Get(0);
- if( pClassModuleObject == NULL )
- {
-- StarBASIC::Error( SbERR_INVALID_USAGE_OBJECT );
-+ SbObjModule* pMod = PTR_CAST(SbObjModule,pActiveModule);
-+ if ( pMod == NULL )
-+ {
-+ SbUserFormModule* pFormMod = PTR_CAST(SbUserFormModule,pActiveModule);
-+ if ( !pFormMod )
-+ StarBASIC::Error( SbERR_INVALID_USAGE_OBJECT );
-+ else
-+ refVar->PutObject( pFormMod );
-+
-+ }
-+ else
-+ refVar->PutObject( pMod );
- }
- else
-- {
-- SbxVariableRef refVar = rPar.Get(0);
- refVar->PutObject( pClassModuleObject );
-- }
- }
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/methods.cxx basic/source/runtime/methods.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/methods.cxx 2008-03-29 23:08:19.000000000 +0000
-+++ basic/source/runtime/methods.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -152,6 +152,8 @@ using namespace com::sun::star::io;
- #include <io.h>
- #endif
-
-+#include <basic/sbobjmod.hxx>
-+
- static void FilterWhiteSpace( String& rStr )
- {
- rStr.EraseAllChars( ' ' );
-@@ -4386,7 +4386,12 @@ RTLFUNC(Load)
-
- // Diesen Call einfach an das Object weiterreichen
- SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
-- if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
-+ if( pObj && pObj->IsA( TYPE( SbUserFormModule ) ) )
-+ {
-+ SbUserFormModule* pFormModule = ( SbUserFormModule* )pObj;
-+ pFormModule->load();
-+ }
-+ else if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
- {
- SbxVariable* pVar = ((SbxObject*)pObj)->
- Find( String( RTL_CONSTASCII_USTRINGPARAM("Load") ), SbxCLASS_METHOD );
-@@ -4407,7 +4409,12 @@ RTLFUNC(Unload)
-
- // Diesen Call einfach an das Object weitereichen
- SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
-- if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
-+ if( pObj && pObj->IsA( TYPE( SbUserFormModule ) ) )
-+ {
-+ SbUserFormModule* pFormModule = ( SbUserFormModule* )pObj;
-+ pFormModule->Unload();
-+ }
-+ else if( pObj && pObj->IsA( TYPE( SbxObject ) ) )
- {
- SbxVariable* pVar = ((SbxObject*)pObj)->
- Find( String( RTL_CONSTASCII_USTRINGPARAM("Unload") ), SbxCLASS_METHOD );
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/runtime.cxx basic/source/runtime/runtime.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/runtime/runtime.cxx 2008-03-29 23:08:19.000000000 +0000
-+++ basic/source/runtime/runtime.cxx 2008-03-29 00:19:02.000000000 +0000
-@@ -82,6 +82,17 @@ void StarBASIC::StaticEnableReschedule(
- {
- bStaticGlobalEnableReschedule = bReschedule;
- }
-+void StarBASIC::SetVBAEnabled( BOOL bEnabled )
-+{
-+ bVBAEnabled = bEnabled;
-+}
-+
-+BOOL StarBASIC::isVBAEnabled()
-+{
-+ if( SbiRuntime::isVBAEnabled() )
-+ return TRUE;
-+ return bVBAEnabled;
-+}
-
-
- struct SbiArgvStack { // Argv stack:
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/sbx/sbxobj.cxx basic/source/sbx/sbxobj.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/sbx/sbxobj.cxx 2007-06-27 15:31:34.000000000 +0100
-+++ basic/source/sbx/sbxobj.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -187,7 +187,7 @@ void SbxObject::SFX_NOTIFY( SfxBroadcast
- }
- }
-
--BOOL SbxObject::IsClass( const XubString& rName ) const
-+BOOL SbxObject::IsClass( const XubString& rName )
- {
- return BOOL( aClassName.EqualsIgnoreCaseAscii( rName ) );
- }
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/uno/namecont.cxx basic/source/uno/namecont.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/uno/namecont.cxx 2008-02-26 17:01:46.000000000 +0000
-+++ basic/source/uno/namecont.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -139,6 +139,9 @@
- #endif
- #include <basic/sbmod.hxx>
-
-+#ifndef _COM_SUN_STAR_SCRIPT_MODULEINFO_HPP_
-+#include <com/sun/star/script/ModuleInfo.hpp>
-+#endif
-
- namespace basic
- {
-@@ -217,7 +220,7 @@ void NameContainer::replaceByName( const
- throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException)
- {
- Type aAnyType = aElement.getValueType();
-- if( mType != aAnyType )
-+ if( mType != aAnyType && aAnyType != getCppuType( static_cast< ModuleInfo* >( NULL ) ) )
- throw IllegalArgumentException();
-
- NameContainerNameMap::iterator aIt = mHashMap.find( aName );
-@@ -259,7 +262,7 @@ void NameContainer::insertByName( const
- throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException)
- {
- Type aAnyType = aElement.getValueType();
-- if( mType != aAnyType )
-+ if( mType != aAnyType && aAnyType != getCppuType( static_cast< ModuleInfo* >( NULL ) ) )
- throw IllegalArgumentException();
-
- NameContainerNameMap::iterator aIt = mHashMap.find( aName );
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ basic/inc/basic/sbobjmod.hxx 2008-04-02 17:40:27.000000000 +0100
-@@ -0,0 +1,97 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: sbobjmod.hxx,v $
-+ *
-+ * $Revision: 1.4 $
-+ *
-+ * last change: $Author: $ $Date: 2007/08/27 16:31:39 $
-+ *
-+ * 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 _SB_OBJMOD_HXX
-+#define _SB_OBJMOD_HXX
-+
-+#include <basic/sbmod.hxx>
-+#include <basic/sbstar.hxx>
-+#include <com/sun/star/script/ModuleInfo.hpp>
-+#include <com/sun/star/lang/XEventListener.hpp>
-+#include <com/sun/star/awt/XDialog.hpp>
-+
-+namespace css = ::com::sun::star;
-+
-+// Basic-Module for excel object.
-+
-+class SbObjModule : public SbModule
-+{
-+protected:
-+ com::sun::star::script::ModuleInfo m_mInfo;
-+ SbxObjectRef pDocObject; // a vba api object.
-+ virtual void InitObject();
-+public:
-+ TYPEINFO();
-+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_DOCUMENTMOD,2);
-+ SbObjModule( const rtl::OUString& rName, const com::sun::star::script::ModuleInfo& mInfo );
-+ virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
-+ SbxVariable* GetObject();
-+ virtual BOOL IsClass( const String& );
-+};
-+
-+class SbUserFormModule : public SbObjModule
-+{
-+ css::uno::Reference<css::lang::XEventListener> m_DialogListener;
-+ css::uno::Reference<css::awt::XDialog> m_xDialog;
-+ String sFormName;
-+
-+ bool m_bUnloaded;
-+ static USHORT nHideHash;
-+protected:
-+ virtual void InitObject();
-+public:
-+ TYPEINFO();
-+ SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_USERFORMMOD,2);
-+ SbUserFormModule( const rtl::OUString& rName, const com::sun::star::script::ModuleInfo& mInfo );
-+ virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
-+ void ResetApiObj( bool bUnloaded = true );
-+ void Unload();
-+ void load();
-+ void triggerMethod( const String& );
-+ void triggerActivateEvent();
-+ void triggerDeActivateEvent();
-+ void triggerInitializeEvent();
-+ void triggerTerminateEvent();
-+};
-+
-+SV_DECL_IMPL_REF(SbUserFormModule);
-+#ifndef __SB_SBOBJMODULEREF_HXX
-+#define __SB_SBOBJMODULEREF_HXX
-+
-+SV_DECL_IMPL_REF(SbObjModule);
-+
-+#endif
-+#endif
-+
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sfx2/source/doc/docmacromode.cxx sfx2/source/doc/docmacromode.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sfx2/source/doc/docmacromode.cxx 2008-01-24 15:54:21.000000000 +0000
-+++ sfx2/source/doc/docmacromode.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -45,6 +45,7 @@
- #include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp>
- #include <com/sun/star/task/InteractionClassification.hpp>
- #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
-+#include <com/sun/star/script/ModuleInfo.hpp>
- /** === end UNO includes === **/
-
- #include <comphelper/componentcontext.hxx>
-@@ -80,8 +81,11 @@ namespace sfx2
- using ::com::sun::star::document::XEmbeddedScripts;
- using ::com::sun::star::uno::UNO_SET_THROW;
- using ::com::sun::star::script::XLibraryContainer;
-+ using ::com::sun::star::script::ModuleInfo;
- using ::com::sun::star::container::XNameAccess;
-+ using ::com::sun::star::container::XNameContainer;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
-+ using ::com::sun::star::uno::Sequence;
- /** === end UNO using === **/
- namespace MacroExecMode = ::com::sun::star::document::MacroExecMode;
-
-@@ -427,7 +431,7 @@ namespace sfx2
- bHasMacroLib = sal_False;
- else
- {
-- ::rtl::OUString aStdLibName( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
-+ ::rtl::OUString aStdLibName( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ) );
- Sequence< ::rtl::OUString > aElements = xContainer->getElementNames();
- if ( aElements.getLength() )
- {
-@@ -447,8 +451,43 @@ namespace sfx2
- Any aAny = xContainer->getByName( aStdLibName );
- aAny >>= xLib;
- if ( xLib.is() )
-+ {
- bHasMacroLib = xLib->hasElements();
-- }
-+ if( !bHasMacroLib )
-+ return bHasMacroLib;
-+ // VBA will introduce some empty Object Module
-+ // If all module only include
-+ // "Rem Attribute VBA_ModuleType=VBADocumentModule\nOption VBASupport"
-+ // it should be set bHasMacros as false
-+ Sequence< ::rtl::OUString > sNames = xLib->getElementNames();
-+ Reference < XNameContainer > xNameContainer( xContainer->getByName( aStdLibName ), UNO_QUERY_THROW );
-+ sal_Int32 nCount = sNames.getLength();
-+ ::rtl::OUString sName;
-+ Any aCode;
-+ ModuleInfo sModuleInfo;
-+ ::rtl::OUString sMod;
-+ ::rtl::OUString sVbaOptiona( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "Rem Attribute VBA_ModuleType=VBADocumentModule\nOption VBASupport 1\n" )));
-+ ::rtl::OUString sVbaOptionb( ::rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( "\r\n" )));
-+ sVbaOptionb = sVbaOptiona + sVbaOptionb;
-+ for ( sal_Int32 nMod = 0; nMod < nCount; nMod++ )
-+ {
-+ sName = sNames[nMod];
-+ if ( xNameContainer->hasByName( sName ) )
-+ aCode = xNameContainer->getByName( sName );
-+ if ( aCode >>= sModuleInfo )
-+ {
-+ sMod = sModuleInfo.ModuleSource;
-+ if ( sMod.getLength() && !( sMod.equals( sVbaOptiona ) || sMod.equals( sVbaOptionb ) ) )
-+ return bHasMacroLib;
-+ }
-+ else
-+ {
-+ return bHasMacroLib;
-+ }
-+ }
-+ bHasMacroLib = sal_False;
-+ }
-+ }
- }
- }
- }
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/msforms/makefile.mk 2008-04-08 12:03:51.000000000 +0100
-+++ oovbaapi/org/openoffice/msforms/makefile.mk 2008-04-06 15:59:26.000000000 +0100
-@@ -60,7 +60,13 @@ IDLFILES=\
- XPictureFormat.idl \
- XShapeRange.idl \
- XTextBoxShape.idl \
-- XListBox.idl
-+ XUserForm.idl \
-+ XListBox.idl \
-+ XToggleButton.idl \
-+ XScrollBar.idl \
-+ XProgressBar.idl \
-+ XMultiPage.idl \
-+ XPages.idl \
-
- # ------------------------------------------------------------------
-
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/msforms/XControl.idl 2008-04-03 11:33:30.000000000 +0100
-+++ oovbaapi/org/openoffice/msforms/XControl.idl 2008-04-02 18:43:57.000000000 +0100
-@@ -42,12 +42,17 @@
-
- //=============================================================================
-
--module org { module openoffice { module msforms {
-+#ifndef __org_openoffice_vba_XHelperInterface_idl__
-+#include <org/openoffice/vba/XHelperInterface.idl>
-+#endif
-
-+module org { module openoffice { module msforms {
-
- //=============================================================================
--interface XControl: com::sun::star::uno::XInterface
-+interface XControl
- {
-+ interface ::org::openoffice::vba::XHelperInterface;
-+ void SetFocus();
- [attribute] boolean Enabled;
- [attribute] boolean Visible;
- //Size. there are some defferent between Mso and OOo.
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/msforms/XComboBox.idl 2007-04-27 08:35:26.000000000 +0100
-+++ oovbaapi/org/openoffice/msforms/XComboBox.idl 2008-04-01 21:35:53.000000000 +0100
-@@ -49,6 +49,7 @@ module org { module openoffice { modul
- interface XComboBox: ::com::sun::star::uno::XInterface
- {
- [attribute] any Value;
-+ [attribute] any ListIndex;
- [attribute] string Text;
- void AddItem( [in] any pvargItem, [in] any pvargIndex );
- void Clear();
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/msforms/XLabel.idl 2007-12-07 12:15:04.000000000 +0000
-+++ oovbaapi/org/openoffice/msforms/XLabel.idl 2008-04-02 16:16:34.000000000 +0100
-@@ -46,6 +46,7 @@ module org { module openoffice { modul
- interface XLabel: com::sun::star::uno::XInterface
- {
- [attribute] string Caption;
-+ [attribute] any Value;
- };
-
- //=============================================================================
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/msforms/XListBox.idl 2007-12-07 12:15:24.000000000 +0000
-+++ oovbaapi/org/openoffice/msforms/XListBox.idl 2008-04-02 16:17:03.000000000 +0100
-@@ -49,6 +49,7 @@ interface XListBox: com::sun::star::uno:
- [attribute] any Value;
- [attribute] string Text;
- [attribute] boolean MultiSelect;
-+ [attribute] any ListIndex;
- //[attribute] sequence< boolean > Selected;
- void AddItem( [in] any pvargItem, [in] any pvargIndex );
- void Clear();
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/msforms/XRadioButton.idl 2007-12-07 12:15:44.000000000 +0000
-+++ oovbaapi/org/openoffice/msforms/XRadioButton.idl 2008-04-02 19:09:03.000000000 +0100
-@@ -46,7 +46,7 @@ module org { module openoffice { modul
- interface XRadioButton: com::sun::star::uno::XInterface
- {
- [attribute] string Caption;
-- [attribute] boolean Value;
-+ [attribute] any Value;
- };
-
- //=============================================================================
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/msforms/XTextBox.idl 2007-12-07 12:16:25.000000000 +0000
-+++ oovbaapi/org/openoffice/msforms/XTextBox.idl 2008-04-01 20:57:37.000000000 +0100
-@@ -46,7 +46,7 @@ module org { module openoffice { modul
- interface XTextBox: com::sun::star::uno::XInterface
- {
- [attribute] string Text;
--// [attribute] any Value;
-+ [attribute] any Value;
- [attribute] long MaxLength;
- [attribute] boolean Multiline;
- };
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ oovbaapi/org/openoffice/msforms/XScrollBar.idl 2008-04-02 22:20:04.000000000 +0100
-@@ -0,0 +1,61 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: XRadioButton.idl,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 12:15:44 $
-+ *
-+ * 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 __org_openoffice_msforms_XRadioButton_idl__
-+#define __org_openoffice_msforms_XRadioButton_idl__
-+
-+#ifndef __com_sun_star_uno_XInterface_idl__
-+#include <com/sun/star/uno/XInterface.idl>
-+#endif
-+//=============================================================================
-+
-+module org { module openoffice { module msforms {
-+
-+//=============================================================================
-+interface XScrollBar: com::sun::star::uno::XInterface
-+{
-+ [attribute] long Max;
-+ [attribute] long Min;
-+ [attribute] any Value;
-+ [attribute] long LargeChange;
-+ [attribute] long SmallChange;
-+};
-+
-+//=============================================================================
-+
-+}; }; };
-+
-+#endif
-+
-+
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ oovbaapi/org/openoffice/msforms/XProgressBar.idl 2008-04-06 16:17:01.000000000 +0100
-@@ -0,0 +1,57 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: XLabel.idl,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 12:15:04 $
-+ *
-+ * 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 __org_openoffice_msforms_XProgressBar_idl__
-+#define __org_openoffice_msforms_XProgressBar_idl__
-+
-+#ifndef __com_sun_star_uno_XInterface_idl__
-+#include <com/sun/star/uno/XInterface.idl>
-+#endif
-+//=============================================================================
-+
-+module org { module openoffice { module msforms {
-+
-+//=============================================================================
-+interface XProgressBar: com::sun::star::uno::XInterface
-+{
-+ [attribute] any Value;
-+};
-+
-+//=============================================================================
-+
-+}; }; };
-+
-+#endif
-+
-+
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl 2007-04-27 08:32:41.000000000 +0100
-+++ oovbaapi/org/openoffice/vba/XVBAToOOEventDescGen.idl 2008-03-28 10:30:34.000000000 +0000
-@@ -50,5 +50,10 @@ interface XVBAToOOEventDescGen : com::su
- com::sun::star::script::XScriptEventsSupplier getEventSupplier( [in] com::sun::star::uno::XInterface xControl );
- };
-
-+interface XFakeVBAEventDescriptorSupplier : com::sun::star::uno::XInterface
-+{
-+ sequence< com::sun::star::script::ScriptEventDescriptor > getEventDescriptions( [in] com::sun::star::uno::XInterface xControl );
-+};
-+
- }; }; };
- #endif
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ oovbaapi/org/openoffice/msforms/XGroupBox.idl 2008-04-01 16:34:54.000000000 +0100
-@@ -0,0 +1,56 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: XButton.idl,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 12:14:23 $
-+ *
-+ * 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 __org_openoffice_msforms_XGroupBox_idl__
-+#define __org_openoffice_msforms_XGroupBox_idl__
-+
-+#ifndef __com_sun_star_uno_XInterface_idl__
-+#include <com/sun/star/uno/XInterface.idl>
-+#endif
-+//=============================================================================
-+
-+module org { module openoffice { module msforms {
-+//=============================================================================
-+interface XGroupBox
-+{
-+ [attribute] string Caption;
-+};
-+
-+//=============================================================================
-+
-+}; }; };
-+
-+#endif
-+
-+
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ oovbaapi/org/openoffice/msforms/XUserForm.idl 2008-04-01 23:47:29.000000000 +0100
-@@ -0,0 +1,57 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: XShape.idl,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 12:15:54 $
-+ *
-+ * 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 __org_openoffice_msforms_XUserForm_idl__
-+#define __org_openoffice_msforms_XUserForm_idl__
-+
-+#ifndef __org_openoffice_vba_XHelperInterface_idl__
-+#include <org/openoffice/vba/XHelperInterface.idl>
-+#endif
-+#ifndef __com_sun_star_script_XInvocation_idl__
-+#include <com/sun/star/script/XInvocation.idl>
-+#endif
-+module org { module openoffice { module msforms {
-+interface XUserForm
-+{
-+ //interface ::org::openoffice::vba::XHelperInterface;
-+ interface ::com::sun::star::script::XInvocation;
-+ [attribute] string Caption;
-+ void Show();
-+ void Hide();
-+ void RePaint();
-+ void UnloadObject();
-+};
-+}; }; };
-+
-+#endif
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/inc/InterfaceContainer.hxx forms/source/inc/InterfaceContainer.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/inc/InterfaceContainer.hxx 2007-01-29 15:46:36.000000000 +0000
-+++ forms/source/inc/InterfaceContainer.hxx 2008-03-28 10:30:34.000000000 +0000
-@@ -319,6 +319,9 @@ protected:
- void implCheckIndex( const sal_Int32 _nIndex ) SAL_THROW( ( ::com::sun::star::lang::IndexOutOfBoundsException ) );
-
- private:
-+ // hack for Vba Events
-+ void fakeVbaEventsHack( sal_Int32 _nIndex );
-+
- // the runtime event format has changed from version SO5.2 to OOo
- enum EventFormat
- {
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/misc/InterfaceContainer.cxx forms/source/misc/InterfaceContainer.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/misc/InterfaceContainer.cxx 2006-12-01 16:55:25.000000000 +0000
-+++ forms/source/misc/InterfaceContainer.cxx 2008-03-28 10:30:34.000000000 +0000
-@@ -105,11 +105,14 @@
- #include <rtl/logfile.hxx>
- #endif
-
-+#include <com/sun/star/frame/XModel.hpp>
-+#include <org/openoffice/vba/XFakeVBAEventDescriptorSupplier.hpp>
- //.........................................................................
- namespace frm
- {
- //.........................................................................
-
-+using namespace ::com::sun::star::frame;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::beans;
-@@ -127,6 +130,83 @@ namespace
- }
- }
-
-+bool
-+lcl_hasVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents )
-+{
-+ const ScriptEventDescriptor* pDesc = sEvents.getConstArray();
-+ const ScriptEventDescriptor* pEnd = ( pDesc + sEvents.getLength() );
-+ for ( ; pDesc != pEnd; ++pDesc )
-+ {
-+ if ( pDesc->ScriptType.equals( rtl::OUString::createFromAscii( "VBAInterop" ) ) )
-+ return true;
-+ }
-+ return false;
-+}
-+
-+Sequence< ScriptEventDescriptor >
-+lcl_stripVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents )
-+{
-+ Sequence< ScriptEventDescriptor > sStripped( sEvents.getLength() );
-+
-+ const ScriptEventDescriptor* pDesc = sEvents.getConstArray();
-+ const ScriptEventDescriptor* pEnd = ( pDesc + sEvents.getLength() );
-+ sal_Int32 nCopied = 0;
-+ for ( ; pDesc != pEnd; ++pDesc )
-+ {
-+ if ( !pDesc->ScriptType.equals( rtl::OUString::createFromAscii( "VBAInterop" ) ) )
-+ {
-+ sStripped[ nCopied++ ] = *pDesc;
-+ }
-+ }
-+ if ( nCopied )
-+ sStripped.realloc( nCopied );
-+ return sStripped;
-+}
-+
-+void
-+OInterfaceContainer::fakeVbaEventsHack( sal_Int32 _nIndex )
-+{
-+ // we are dealing with form controls
-+ try
-+ {
-+ Reference< XFormComponent > xForm( static_cast< XContainer* >(this), UNO_QUERY_THROW );
-+ // grand-parent should be the model, no parent ? if not
-+ // we'll ignore, we'll get called back here anyway )
-+ Reference< XChild > xChild( xForm->getParent(), UNO_QUERY_THROW );
-+ Reference< XModel > xDocOwner( xChild->getParent(), UNO_QUERY );
-+ OSL_TRACE(" Is DOC ????? %s", xDocOwner.is() ? "true" : "false" );
-+ if ( xDocOwner.is() )
-+ {
-+ bool hasVBABindings = lcl_hasVbaEvents( m_xEventAttacher->getScriptEvents( _nIndex ) );
-+ if ( hasVBABindings )
-+ {
-+ OSL_TRACE("Has VBA bindings already, returning ");
-+ return;
-+ }
-+ Reference< XMultiServiceFactory > xFac( xDocOwner, UNO_QUERY );
-+ if ( xFac.is() )
-+ {
-+ try
-+ {
-+ Reference< org::openoffice::vba::XFakeVBAEventDescriptorSupplier > xDescSupplier( xFac->createInstance( rtl::OUString::createFromAscii( "org.openoffice.vba.controlevents" ) ), UNO_QUERY_THROW );
-+ Reference< XInterface > xIf( getByIndex( _nIndex ) , UNO_QUERY_THROW );
-+ Sequence< ScriptEventDescriptor > vbaEvents = xDescSupplier->getEventDescriptions( xIf );
-+ // register the vba script events
-+ if ( m_xEventAttacher.is() )
-+ {
-+ m_xEventAttacher->registerScriptEvents( _nIndex, vbaEvents );
-+ }
-+ }
-+ catch( Exception& e ){ OSL_TRACE("lcl_fakevbaevents - Caught Exception trying to create control eventstuff "); }
-+ }
-+
-+ }
-+ }
-+ catch( Exception& e )
-+ {
-+ }
-+
-+}
- //==================================================================
- //= ElementDescription
- //==================================================================
-@@ -726,6 +806,7 @@ void OInterfaceContainer::approveNewElem
- void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XPropertySet >& _rxElement,
- sal_Bool _bEvents, ElementDescription* _pApprovalResult, sal_Bool _bFire ) throw( IllegalArgumentException )
- {
-+ OSL_TRACE("OInterfaceContainer::implInsert( %d)", _nIndex );
- RTL_LOGFILE_CONTEXT( aLogger, "forms::OInterfaceContainer::implInsert" );
-
- ::osl::ClearableMutexGuard aGuard( m_rMutex );
-@@ -775,6 +856,23 @@ void OInterfaceContainer::implInsert(sal
- {
- m_xEventAttacher->insertEntry(_nIndex);
- m_xEventAttacher->attach( _nIndex, pElementMetaData->xInterface, makeAny( _rxElement ) );
-+ // insert fake events?
-+ Reference< XEventAttacherManager > xMgr ( pElementMetaData->xInterface, UNO_QUERY );
-+ if ( xMgr.is() )
-+ {
-+ OInterfaceContainer* pIfcMgr = dynamic_cast< OInterfaceContainer* >( xMgr.get() );
-+ sal_Int32 nLen = getCount();
-+ for ( sal_Int32 i = 0; (i < nLen) && pIfcMgr ; ++i )
-+ {
-+ // add fake events to the control at index i
-+ pIfcMgr->fakeVbaEventsHack( i );
-+ }
-+ }
-+ else
-+ {
-+ // add fake events to the control at index i
-+ fakeVbaEventsHack( _nIndex );
-+ }
- }
-
- // notify derived classes
-@@ -1054,20 +1152,29 @@ void SAL_CALL OInterfaceContainer::remov
- //------------------------------------------------------------------------
- void SAL_CALL OInterfaceContainer::registerScriptEvent( sal_Int32 nIndex, const ScriptEventDescriptor& aScriptEvent ) throw(IllegalArgumentException, RuntimeException)
- {
-+ OSL_TRACE("*** registerScriptEvent %d", nIndex);
- if ( m_xEventAttacher.is() )
-+ {
- m_xEventAttacher->registerScriptEvent( nIndex, aScriptEvent );
-+ fakeVbaEventsHack( nIndex ); // add fake vba events
-+ }
- }
-
- //------------------------------------------------------------------------
- void SAL_CALL OInterfaceContainer::registerScriptEvents( sal_Int32 nIndex, const Sequence< ScriptEventDescriptor >& aScriptEvents ) throw(IllegalArgumentException, RuntimeException)
- {
-+ OSL_TRACE("*** registerScriptEvent(s) %d", nIndex);
- if ( m_xEventAttacher.is() )
-+ {
- m_xEventAttacher->registerScriptEvents( nIndex, aScriptEvents );
-+ fakeVbaEventsHack( nIndex ); // add fake vba events
-+ }
- }
-
- //------------------------------------------------------------------------
- void SAL_CALL OInterfaceContainer::revokeScriptEvent( sal_Int32 nIndex, const ::rtl::OUString& aListenerType, const ::rtl::OUString& aEventMethod, const ::rtl::OUString& aRemoveListenerParam ) throw(IllegalArgumentException, RuntimeException)
- {
-+ OSL_TRACE("*** revokeScriptEvent %d listenertype %s, eventMethod %s", nIndex, rtl::OUStringToOString( aListenerType, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( aEventMethod, RTL_TEXTENCODING_UTF8 ).getStr());
- if ( m_xEventAttacher.is() )
- m_xEventAttacher->revokeScriptEvent( nIndex, aListenerType, aEventMethod, aRemoveListenerParam );
- }
-@@ -1096,9 +1203,16 @@ void SAL_CALL OInterfaceContainer::remov
- //------------------------------------------------------------------------
- Sequence< ScriptEventDescriptor > SAL_CALL OInterfaceContainer::getScriptEvents( sal_Int32 nIndex ) throw(IllegalArgumentException, RuntimeException)
- {
-+ OSL_TRACE("getScriptEvents");
- Sequence< ScriptEventDescriptor > aReturn;
- if ( m_xEventAttacher.is() )
-+ {
- aReturn = m_xEventAttacher->getScriptEvents( nIndex );
-+ if ( lcl_hasVbaEvents( aReturn ) )
-+ {
-+ aReturn = lcl_stripVbaEvents( aReturn );
-+ }
-+ }
- return aReturn;
- }
-
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/misc/makefile.mk forms/source/misc/makefile.mk
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/forms/source/misc/makefile.mk 2005-09-09 00:01:56.000000000 +0100
-+++ forms/source/misc/makefile.mk 2008-03-28 10:30:34.000000000 +0000
-@@ -48,6 +48,7 @@ ENABLE_EXCEPTIONS=TRUE
- # --- Types -------------------------------------
-
- INCPRE+=$(SOLARINCDIR)$/offuh
-+INCPRE*=$(INCCOM)$/$(TARGET)
-
- # --- Files -------------------------------------
-
-@@ -65,3 +66,12 @@ SLOFILES= $(SLO)$/limitedformats.obj \
-
- .INCLUDE : target.mk
-
-+ALLTAR : \
-+ $(MISC)$/$(TARGET).don \
-+
-+$(SLOFILES) : $(MISC)$/$(TARGET).don
-+
-+$(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
-+ +$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
-+ echo $@
-+
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/scripting/source/dlgprov/dlgevtatt.hxx scripting/source/dlgprov/dlgevtatt.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/scripting/source/dlgprov/dlgevtatt.hxx 2008-03-29 23:07:53.000000000 +0000
-+++ scripting/source/dlgprov/dlgevtatt.hxx 2008-03-28 12:09:13.000000000 +0000
-@@ -68,6 +68,9 @@
- #include <com/sun/star/script/XScriptEventsSupplier.hpp>
-
- #include <hash_map>
-+
-+#define FAKE_VBA_EVENT_SUPPORT 1
-+
- //.........................................................................
- namespace dlgprov
- {
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/scripting/source/vbaevents/eventhelper.cxx 2008-04-08 14:28:35.000000000 +0100
-+++ scripting/source/vbaevents/eventhelper.cxx 2008-04-03 13:28:01.000000000 +0100
-@@ -23,6 +23,7 @@
- #include <com/sun/star/drawing/XControlShape.hpp>
-
- #include <com/sun/star/awt/XControl.hpp>
-+#include <com/sun/star/awt/XDialog.hpp>
- #include <com/sun/star/awt/KeyEvent.hpp>
- #include <com/sun/star/awt/MouseEvent.hpp>
-
-@@ -94,7 +95,7 @@ Sequence< ::rtl::OUString> getEventMetho
- return aNames;
- }
-
--// for debug only ( conditionalize out? )
-+#if 0
- void dumpListeners( const Reference< beans::XIntrospection >& xIntrospection, const Reference<XInterface>& xIfc)
- {
- Reference< beans::XIntrospectionAccess > xIntrospectionAccess;
-@@ -164,6 +165,7 @@ void dumpEvent( const ScriptEvent& evt )
- }
- }
-
-+#endif
-
- bool isKeyEventOk( awt::KeyEvent& evt, const Sequence< Any >& params )
- {
-@@ -277,6 +279,9 @@ EventInfoHash& getEventTransInfo()
- info.sVBAName = rtl::OUString::createFromAscii("_Click");
- info.toVBA = NULL;
- actionInfos.push_back( info );
-+ info.sVBAName = rtl::OUString::createFromAscii("_Change");
-+ info.toVBA = NULL;
-+ actionInfos.push_back( info );
- eventTransInfo[ rtl::OUString::createFromAscii("actionPerformed") ] = actionInfos;
- // changed ooo event
- std::list< TranslateInfo > changeInfos;
-@@ -336,7 +341,7 @@ EventInfoHash& getEventTransInfo()
- eventTransInfo[ rtl::OUString::createFromAscii("mousePressed") ] = mousePressedInfos;
- // mouseMoved ooo event
- std::list< TranslateInfo > mouseMovedInfos;
-- info.sVBAName = rtl::OUString::createFromAscii("_MouseMoved");
-+ info.sVBAName = rtl::OUString::createFromAscii("_MouseMove");
- info.toVBA = ooMouseEvtToVBAMouseEvt;
- mouseMovedInfos.push_back( info );
- eventTransInfo[ rtl::OUString::createFromAscii("mouseMoved") ] = mouseMovedInfos;
-@@ -393,41 +398,17 @@ eventMethodToDescriptors( const ::rtl::O
- EventInfoHash::const_iterator eventInfo_it = infos.find( sMethodName );
- EventInfoHash::const_iterator it_end = infos.end();
-
-- // sLibModName ( could ) include the uri bits :-) from calc
-- rtl::OUString sPartialMacroName = sLibModName + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".") ) + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$macro"));
--
-- if ( sMethodName.getLength()
-- && sTypeName.getLength()
-- && ( infos.find( sMethodName ) != infos.end() ) )
-+ if ( infos.find( sMethodName ) != infos.end() )
- {
-- std::list< TranslateInfo >::const_iterator txInfo =
-- eventInfo_it->second.begin();
-- std::list< TranslateInfo >::const_iterator txInfo_end =
-- eventInfo_it->second.end();
-- for ( ; txInfo != txInfo_end; ++txInfo )
-- {
-- // Check if extension is support for this method, if
-- // so create an eventdescription for that
-- const rtl::OUString* pExt = sHandlerExts.getConstArray();
-- sal_Int32 nCount = sHandlerExts.getLength();
-- for ( sal_Int32 counter=0; counter<nCount; ++counter, ++pExt )
-- {
-- if ( (*txInfo).sVBAName.equals( *pExt ) ) // handler for event
-- {
-- sal_Int32 nIndex = evtDescs.getLength();
-- evtDescs.realloc( evtDescs.getLength() + 1 );
-- evtDescs[ nIndex ].ScriptCode = sPartialMacroName + *pExt;
-- evtDescs[ nIndex ].ListenerType = sTypeName;
-- evtDescs[ nIndex ].EventMethod = sMethodName;
--
-- // set this it VBAInterop, ensures that it doesn't
-- // get persisted or shown in property editors
-- evtDescs[ nIndex ].ScriptType = rtl::OUString::createFromAscii( "VBAInterop" );
-- }
-- }
-- }
-+ sal_Int32 nIndex = evtDescs.getLength();
-+ evtDescs.realloc( evtDescs.getLength() + 1 );
-+ evtDescs[ nIndex ].ScriptType = rtl::OUString::createFromAscii( "VBAInterop" );
-+ evtDescs[ nIndex ].ScriptCode = sLibModName; // codeName
-+ evtDescs[ nIndex ].ListenerType = sTypeName;
-+ evtDescs[ nIndex ].EventMethod = sMethodName;
- return true;
- }
-+
- return false;
-
- }
-@@ -522,8 +503,10 @@ ScriptEventFactory::getEventListeners( c
- Reference< beans::XIntrospection > xIntrospection(
- xMFac->createInstanceWithContext( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.Introspection" ) ), instance().m_xCtx ), UNO_QUERY );
-- //dumpListeners( xIntrospection, xControl );
-- //dumpListeners( xIntrospection, xControl->getModel() );
-+#if 0
-+ dumpListeners( xIntrospection, xControl );
-+ dumpListeners( xIntrospection, xControl->getModel() );
-+#endif
- Reference< beans::XIntrospectionAccess > xIntrospectionAccess;
- if ( xIntrospection.is() )
- {
-@@ -583,7 +566,8 @@ ScriptEventFactory::createEvents( const
- ::rtl::OUString sNoNameSpaceMethod = *pSrc;
- if ( ( lastDotIndex = pSrc->lastIndexOf( '.' ) ) > -1 )
- sNoNameSpaceMethod = sNoNameSpaceMethod.copy( lastDotIndex + 1 );
-- Sequence< ScriptEventDescriptor> evtDescs;
-+
-+ Sequence< ScriptEventDescriptor > evtDescs;
- if ( eventMethodToDescriptors( sNoNameSpaceMethod, xControl, sLibModName, sHandlerExts, evtDescs ) )
- {
- sal_Int32 dIndex = nEvts;
-@@ -826,13 +810,28 @@ EventListener::getPropertySetInfo( ) th
- void
- EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet ) throw(RuntimeException)
- {
-- OSL_TRACE("EventListener::firing_Impl !!!");
-+ OSL_TRACE("EventListener::firing_Impl( FAKE VBA_EVENTS )");
- static const ::rtl::OUString vbaInterOp =
- ::rtl::OUString::createFromAscii("VBAInterop");
-
- // let default handlers deal with non vba stuff
- if ( !evt.ScriptType.equals( vbaInterOp ) )
- return;
-+ lang::EventObject aEvent;
-+ evt.Arguments[ 0 ] >>= aEvent;
-+ OSL_TRACE("Argument[0] is %s", rtl::OUStringToOString( comphelper::anyToString( evt.Arguments[0] ), RTL_TEXTENCODING_UTF8 ).getStr() );
-+ OSL_TRACE("Getting Control");
-+ uno::Reference< awt::XControl > xControl( aEvent.Source, uno::UNO_QUERY_THROW );
-+ OSL_TRACE("Getting properties");
-+ uno::Reference< beans::XPropertySet > xProps( xControl->getModel(), uno::UNO_QUERY_THROW );
-+ rtl::OUString sName;
-+ OSL_TRACE("Getting Name");
-+
-+ uno::Reference< awt::XDialog > xDlg( aEvent.Source, uno::UNO_QUERY );
-+ if ( xDlg.is() )
-+ sName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UserForm") );
-+ else
-+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) >>= sName;
- //dumpEvent( evt );
- EventInfoHash& infos = getEventTransInfo();
- EventInfoHash::const_iterator eventInfo_it = infos.find( evt.MethodName );
-@@ -858,14 +857,11 @@ EventListener::firing_Impl(const ScriptE
- {
- // see if we have a match for the handlerextension
- // where ScriptCode is methodname_handlerextension
-- rtl::OUString sTemp = evt.ScriptCode;
-- sal_Int32 lastIndexOf_ = sTemp.lastIndexOf( '_' );
-- if ( lastIndexOf_ != -1 )
-- sTemp = sTemp.copy( lastIndexOf_ );
-- OSL_TRACE("*** trying to match %s with %s",
-- rtl::OUStringToOString( sTemp, RTL_TEXTENCODING_UTF8 ).getStr(),
-- rtl::OUStringToOString( (*txInfo).sVBAName, RTL_TEXTENCODING_UTF8 ).getStr() );
-- if ( sTemp.equals( (*txInfo).sVBAName ) )
-+ rtl::OUString sTemp = rtl::OUString::createFromAscii("Standard.").concat( evt.ScriptCode ).concat( rtl::OUString::createFromAscii(".") ).concat( sName ).concat( (*txInfo).sVBAName );
-+
-+ OSL_TRACE("*** trying to invoke %s ",
-+ rtl::OUStringToOString( sTemp, RTL_TEXTENCODING_UTF8 ).getStr() );
-+ //if ( sTemp.equals( (*txInfo).sVBAName ) )
- {
- // !! translate arguments & emulate events where necessary
- Sequence< Any > aArguments;
-@@ -881,7 +877,7 @@ EventListener::firing_Impl(const ScriptE
- static rtl::OUString part2 = rtl::OUString::createFromAscii("?language=Basic&location=document");
-
- // create script url
-- rtl::OUString url = part1 + evt.ScriptCode + part2;
-+ rtl::OUString url = part1 + sTemp + part2;
-
- OSL_TRACE("script url = %s",
- rtl::OUStringToOString( url,
-@@ -893,16 +889,7 @@ EventListener::firing_Impl(const ScriptE
- {
- uno::Reference< script::provider::XScript > xScript = xScriptProvider->getScript( url );
- if ( xScript.is() )
-- {
-- uno::Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY );
-- if ( xProps.is() )
-- {
-- Sequence< Any > aCallerHack(1);
-- aCallerHack[ 0 ] = uno::makeAny( rtl::OUString::createFromAscii("Error") );
-- xProps->setPropertyValue( rtl::OUString::createFromAscii( "Caller" ), uno::makeAny( aCallerHack ) );
-- }
-- xScript->invoke( aArguments, aOutArgsIndex, aOutArgs );
-- }
-+ xScript->invoke( aArguments, aOutArgsIndex, aOutArgs );
- }
- catch ( uno::Exception& e )
- {
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/docshell/vbaevents.cxx 2008-04-08 14:28:35.000000000 +0100
-+++ sc/source/ui/docshell/vbaevents.cxx 2008-04-06 18:32:45.000000000 +0100
-@@ -60,11 +60,7 @@ const static rtl::OUString sUrlPart2 = r
- rtl::OUString sCodeName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisWorkbook") );
- if ( pShell )
- {
-- if ( ScExtDocOptions* pExtDocOpts = pShell->GetDocument()->GetExtDocOptions() )
-- {
-- if ( pExtDocOpts->GetDocSettings().maGlobCodeName.Len() > 0 )
-- sCodeName = pExtDocOpts->GetDocSettings().maGlobCodeName;
-- }
-+ pShell->GetDocument()->GetCodeName();
- }
- return sCodeName;
- }
-@@ -103,6 +99,8 @@ bool executeWorkBookMacro( ScDocShell* p
- String docMacroExists( ScDocShell* pShell,
- const String& sMod, const String& sMacro )
- {
-+OSL_TRACE( "*** docMacroExists for macro %s, module ->%s<-",
-+ rtl::OUStringToOString( sMacro, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( sMacro, RTL_TEXTENCODING_UTF8 ).getStr() );
- String sFullName;
- // would use the script provider to see if the macro exists but
- // called at this stage tdoc content handler stuff is not set up
-@@ -137,7 +135,8 @@ const String& sMod, const String& sMacro
- }
- }
- }
-- else if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pBasic->Find( sMacro, SbxCLASS_METHOD ) ) )
-+ //else if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pBasic->Find( sMacro, SbxCLASS_METHOD ) ) )
-+ else if( SbMethod* pMethod = dynamic_cast< SbMethod* >( pBasic->Find( sMacro, SbxCLASS_DONTCARE ) ) )
- {
- if( SbModule* pModule = pMethod->GetModule() )
- {
-@@ -159,7 +158,8 @@ bool processDocBeforeCloseMacro( ScDocSh
- bool bCancel = sal_False;
- aArgs[ 0 ] <<= bCancel;
- const static String sBeforeClose( RTL_CONSTASCII_USTRINGPARAM("Workbook_BeforeClose") );
-- String sFullClose = docMacroExists( pShell, String(), sBeforeClose );
-+ rtl::OUString workbookModule = getWorkbookModuleName( pShell );
-+ String sFullClose = docMacroExists( pShell, workbookModule, sBeforeClose );
- if ( sFullClose.Len() > 0 )
- {
- if ( !executeWorkBookMacro( pShell, sFullClose, aArgs, aRet ) )
-@@ -224,8 +224,8 @@ bool processDocOpenMacro( ScDocShell* pS
- // until ObjectModules ( and persisting of codename ) are supported if this is a
- // document saved from XL then we won't be able to determine the codename for the Workbook
- // Module, so... we have no choice but to search all modules for the moment
-- //rtl::OUString workbookModule = getWorkbookModuleName( pShell );
-- rtl::OUString workbookModule; // no name means all modules will be searched
-+ rtl::OUString workbookModule = getWorkbookModuleName( pShell );
-+ //rtl::OUString workbookModule; // no name means all modules will be searched
- String sFullOpen = docMacroExists( pShell, workbookModule, sOpenMacro );
- if ( sFullOpen.Len() > 0 )
- {
-@@ -316,12 +316,8 @@ uno::Any createRange( const uno::Any& aR
-
- String getSheetModuleName( ScDocShell* pShell, SCTAB nTab )
- {
-- ScExtDocOptions* pExtOptions = pShell->GetDocument()->GetExtDocOptions();
- String aCodeName;
-- pShell->GetDocument()->GetName( nTab, aCodeName);
-- // Use code name if that exists
-- if ( pExtOptions )
-- aCodeName = pExtOptions->GetCodeName( nTab );
-+ pShell->GetDocument()->GetCodeName( nTab, aCodeName);
- return aCodeName;
- }
-
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ oovbaapi/org/openoffice/msforms/XMultiPage.idl 2008-04-11 11:36:12.000000000 +0100
-@@ -0,0 +1,58 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: XLabel.idl,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 12:15:04 $
-+ *
-+ * 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 __org_openoffice_msforms_XMultiPage_idl__
-+#define __org_openoffice_msforms_XMultiPage_idl__
-+
-+#ifndef __com_sun_star_uno_XInterface_idl__
-+#include <com/sun/star/uno/XInterface.idl>
-+#endif
-+//=============================================================================
-+
-+module org { module openoffice { module msforms {
-+
-+//=============================================================================
-+interface XMultiPage: com::sun::star::uno::XInterface
-+{
-+ [attribute] long Value;
-+ any Pages( [in] any index );
-+};
-+
-+//=============================================================================
-+
-+}; }; };
-+
-+#endif
-+
-+
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ oovbaapi/org/openoffice/msforms/XPages.idl 2008-04-11 11:43:23.000000000 +0100
-@@ -0,0 +1,61 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: XLabel.idl,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 12:15:04 $
-+ *
-+ * 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 __org_openoffice_msforms_XPage_idl__
-+#define __org_openoffice_msforms_XPage_idl__
-+
-+#ifndef __com_sun_star_uno_XInterface_idl__
-+#include <com/sun/star/uno/XInterface.idl>
-+#endif
-+#ifndef __org_openoffice_vba_XCollection_idl__
-+#include <org/openoffice/vba/XCollection.idl>
-+#endif
-+
-+//=============================================================================
-+
-+module org { module openoffice { module msforms {
-+
-+//=============================================================================
-+interface XPages
-+{
-+ interface org::openoffice::vba::XCollection;
-+};
-+
-+//=============================================================================
-+
-+}; }; };
-+
-+#endif
-+
-+
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ oovbaapi/org/openoffice/msforms/XToggleButton.idl 2008-03-28 18:06:47.000000000 +0000
-@@ -0,0 +1,60 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: XButton.idl,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 12:14:23 $
-+ *
-+ * 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 __org_openoffice_msforms_XToggleButton_idl__
-+#define __org_openoffice_msforms_XToggleButton_idl__
-+
-+#ifndef __org_openoffice_msforms_XButton_idl__
-+#include <org/openoffice/msforms/XButton.idl>
-+#endif
-+#ifndef __com_sun_star_uno_XInterface_idl__
-+#include <com/sun/star/uno/XInterface.idl>
-+#endif
-+//=============================================================================
-+
-+module org { module openoffice { module msforms {
-+//=============================================================================
-+interface XToggleButton
-+{
-+ interface XButton;
-+ [attribute] any Value;
-+};
-+
-+//=============================================================================
-+
-+}; }; };
-+
-+#endif
-+
-+
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbamultipage.hxx 2008-04-11 16:13:20.000000000 +0100
-@@ -0,0 +1,66 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbalabel.hxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 10:54:46 $
-+ *
-+ * 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 <org/openoffice/msforms/XMultiPage.hpp>
-+#include <com/sun/star/container/XIndexAccess.hpp>
-+
-+#include "vbacontrol.hxx"
-+#include "vbahelper.hxx"
-+//#include <cppuhelper/implbase2.hxx>
-+#include <cppuhelper/implbase1.hxx>
-+
-+typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::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< css::uno::XComponentContext >& xContext,
-+ const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::uno::XInterface >& xDialog );
-+ // Attributes
-+ virtual sal_Int32 SAL_CALL getValue() throw (css::uno::RuntimeException);
-+ virtual void SAL_CALL setValue( 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
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbamultipage.cxx 2008-04-11 17:31:01.000000000 +0100
-@@ -0,0 +1,132 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbalabel.cxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 10:54:35 $
-+ *
-+ * 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 "vbamultipage.hxx"
-+#include <org/openoffice/vba/XCollection.hpp>
-+#include "vbapages.hxx"
-+#include <vector>
-+
-+using namespace com::sun::star;
-+using namespace org::openoffice;
-+
-+// 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") );
-+
-+typedef cppu::WeakImplHelper1< container::XIndexAccess > PagesImpl_Base;
-+class PagesImpl : public PagesImpl_Base
-+{
-+ sal_Int32 mnPages;
-+public:
-+ 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)
-+ {
-+ // no Pages object yet #FIXME
-+ //return msforms::XPage::static_type(0);
-+ return uno::XInterface::static_type(0);
-+ }
-+ 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< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< uno::XInterface >& xDialog ) : MultiPageImpl_BASE( xContext, xControl )
-+{
-+ mxDialogProps.set( xDialog, uno::UNO_QUERY_THROW );
-+ // set dialog step to value of multipage pseudo model
-+ setValue(getValue());
-+}
-+
-+// 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( 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) );
-+}
-+
-+
-+rtl::OUString&
-+ScVbaMultiPage::getServiceImplName()
-+{
-+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMultiPage") );
-+ return sImplName;
-+}
-+
-+uno::Any SAL_CALL
-+ScVbaMultiPage::Pages( const uno::Any& index ) throw (uno::RuntimeException)
-+{
-+ sal_Int32 nValue = 0;
-+ m_xProps->getPropertyValue( SVALUEMAX ) >>= nValue;
-+ uno::Reference< vba::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("org.openoffice.msforms.MultiPage" ) );
-+ }
-+ return aServiceNames;
-+}
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbapages.hxx 2008-04-11 15:15:32.000000000 +0100
-@@ -0,0 +1,64 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbashape.hxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 11:02:09 $
-+ *
-+ * 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 <org/openoffice/office/MsoShapeType.hpp>
-+#include <com/sun/star/lang/XEventListener.hpp>
-+#include <com/sun/star/beans/XPropertySet.hpp>
-+#include <org/openoffice/msforms/XPages.hpp>
-+#include <cppuhelper/implbase2.hxx>
-+#include <cppuhelper/implbase1.hxx>
-+
-+#include "vbacollectionimpl.hxx"
-+typedef CollTestImplHelper<
-+oo::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< oo::vba::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
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbapages.cxx 2008-04-11 15:17:33.000000000 +0100
-@@ -0,0 +1,81 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbashape.cxx,v $
-+ *
-+ * $Revision: 1.3 $
-+ *
-+ * last change: $Author: kz $ $Date: 2007/12/14 12:41:26 $
-+ *
-+ * 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 ::org::openoffice;
-+using namespace ::com::sun::star;
-+using namespace ::vos;
-+
-+ScVbaPages::ScVbaPages( const uno::Reference< vba::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("org.openoffice.msform.Pages" ) );
-+ }
-+ return aServiceNames;
-+}
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbatogglebutton.hxx 2008-03-28 22:48:49.000000000 +0000
-@@ -0,0 +1,64 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbabutton.hxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 10:45:09 $
-+ *
-+ * 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 <org/openoffice/msforms/XToggleButton.hpp>
-+
-+#include "vbacontrol.hxx"
-+#include "vbahelper.hxx"
-+
-+typedef cppu::ImplInheritanceHelper2< ScVbaControl, oo::msforms::XToggleButton, css::script::XDefaultProperty > ToggleButtonImpl_BASE;
-+
-+class ScVbaToggleButton : public ToggleButtonImpl_BASE
-+{
-+ rtl::OUString msDftPropName;
-+public:
-+ ScVbaToggleButton( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-+ const css::uno::Reference< css::uno::XInterface >& xControl );
-+ ~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
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbatogglebutton.cxx 2008-03-28 22:49:45.000000000 +0000
-@@ -0,0 +1,108 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbabutton.cxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 10:44:58 $
-+ *
-+ * 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 org::openoffice;
-+
-+
-+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 uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl ) : ToggleButtonImpl_BASE( xContext, xControl )
-+{
-+ 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("org.openoffice.msforms.ToggleButton" ) );
-+ }
-+ return aServiceNames;
-+}
-+
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbacheckbox.hxx 2008-04-02 19:50:04.000000000 +0100
-@@ -0,0 +1,59 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbaradiobutton.hxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 11:00:45 $
-+ *
-+ * 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/implbase1.hxx>
-+#include <org/openoffice/msforms/XRadioButton.hpp>
-+
-+#include "vbacontrol.hxx"
-+#include "vbahelper.hxx"
-+
-+typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XRadioButton > CheckBoxImpl_BASE;
-+
-+class ScVbaCheckbox : public CheckBoxImpl_BASE
-+{
-+public:
-+ ScVbaCheckbox( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-+ const css::uno::Reference< css::uno::XInterface >& xControl );
-+ // 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);
-+ //XHelperInterface
-+ virtual rtl::OUString& getServiceImplName();
-+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
-+};
-+#endif //SC_VBA_CHECKBOX_HXX
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbacheckbox.cxx 2008-04-02 22:48:41.000000000 +0100
-@@ -0,0 +1,110 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbaradiobutton.cxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 11:00:34 $
-+ *
-+ * 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 org::openoffice;
-+
-+
-+const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
-+const static rtl::OUString STATE( RTL_CONSTASCII_USTRINGPARAM("State") );
-+ScVbaCheckbox::ScVbaCheckbox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl ) : CheckBoxImpl_BASE( xContext, xControl )
-+{
-+}
-+
-+// 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("org.openoffice.msforms.CheckBox" ) );
-+ }
-+ return aServiceNames;
-+}
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbaframe.hxx 2008-04-02 21:26:23.000000000 +0100
-@@ -0,0 +1,59 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbalabel.hxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 10:54:46 $
-+ *
-+ * 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 <org/openoffice/msforms/XLabel.hpp>
-+
-+#include "vbacontrol.hxx"
-+#include "vbahelper.hxx"
-+
-+typedef cppu::ImplInheritanceHelper1< ScVbaControl, oo::msforms::XLabel > FrameImpl_BASE;
-+
-+class ScVbaFrame : public FrameImpl_BASE
-+{
-+public:
-+ ScVbaFrame( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-+ const css::uno::Reference< css::uno::XInterface >& xControl );
-+ // 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
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbaframe.cxx 2008-04-02 21:26:29.000000000 +0100
-@@ -0,0 +1,93 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbalabel.cxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 10:54:35 $
-+ *
-+ * 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 org::openoffice;
-+
-+
-+const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
-+ScVbaFrame::ScVbaFrame( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl ) : FrameImpl_BASE( xContext, xControl )
-+{
-+}
-+
-+// 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("org.openoffice.msforms.Frame" ) );
-+ }
-+ return aServiceNames;
-+}
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbaprogressbar.hxx 2008-04-06 16:14:29.000000000 +0100
-@@ -0,0 +1,60 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbalabel.hxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 10:54:46 $
-+ *
-+ * 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 <org/openoffice/msforms/XProgressBar.hpp>
-+
-+#include "vbacontrol.hxx"
-+#include "vbahelper.hxx"
-+#include <cppuhelper/implbase2.hxx>
-+
-+typedef cppu::ImplInheritanceHelper2< ScVbaControl, oo::msforms::XProgressBar, css::script::XDefaultProperty > ProgressBarImpl_BASE;
-+
-+class ScVbaProgressBar : public ProgressBarImpl_BASE
-+{
-+public:
-+ ScVbaProgressBar( const css::uno::Reference< css::uno::XComponentContext >& xContext,
-+ const css::uno::Reference< css::uno::XInterface >& xControl );
-+ // 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
---- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbaprogressbar.cxx 2008-04-06 16:26:30.000000000 +0100
-@@ -0,0 +1,78 @@
-+/*************************************************************************
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: vbalabel.cxx,v $
-+ *
-+ * $Revision: 1.2 $
-+ *
-+ * last change: $Author: vg $ $Date: 2007/12/07 10:54:35 $
-+ *
-+ * 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 org::openoffice;
-+
-+// uno servicename com.sun.star.awt.UnoControlProgressBarMode
-+const rtl::OUString SVALUE( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") );
-+
-+ScVbaProgressBar::ScVbaProgressBar( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl ) : ProgressBarImpl_BASE( xContext, xControl )
-+{
-+}
-+
-+// 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("org.openoffice.msforms.Label" ) );
-+ }
-+ return aServiceNames;
-+}
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/toolkit/inc/toolkit/controls/unocontrols.hxx 2008-01-24 15:27:45.000000000 +0000
-+++ toolkit/inc/toolkit/controls/unocontrols.hxx 2008-04-11 07:03:51.000000000 +0100
-@@ -734,6 +734,44 @@ public:
-
- };
-
-+class UnoMultiPageModel : public UnoControlModel
-+{
-+protected:
-+ ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
-+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
-+
-+public:
-+ UnoMultiPageModel();
-+ UnoMultiPageModel( const UnoMultiPageModel& rModel ) : UnoControlModel( rModel ) {;}
-+
-+ UnoControlModel* Clone() const { return new UnoMultiPageModel( *this ); }
-+
-+ // ::com::sun::star::io::XPersistObject
-+ ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
-+
-+ // ::com::sun::star::beans::XMultiPropertySet
-+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
-+
-+ // ::com::sun::star::lang::XServiceInfo
-+ DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageModel, UnoControlModel, szServiceName_UnoMultiPageModel )
-+
-+};
-+// ----------------------------------------------------
-+// class UnoGroupBoxControl
-+// ----------------------------------------------------
-+class UnoMultiPageControl : public UnoControlBase
-+{
-+public:
-+ UnoMultiPageControl();
-+ ::rtl::OUString GetComponentServiceName();
-+
-+ sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
-+
-+ // ::com::sun::star::lang::XServiceInfo
-+ DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageControl, UnoControlBase, szServiceName_UnoMultiPageControl )
-+
-+};
-+
- // ----------------------------------------------------
- // class UnoFixedTextControl
- // ----------------------------------------------------
--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/toolkit/source/controls/unocontrols.cxx 2008-01-24 15:30:00.000000000 +0000
+++ toolkit/source/controls/unocontrols.cxx 2008-04-11 11:07:03.000000000 +0100
@@ -1887,6 +1887,77 @@ sal_Bool UnoGroupBoxControl::isTranspare
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]