ooo-build r12087 - trunk/patches/test/vba
- From: noelpwer svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12087 - trunk/patches/test/vba
- Date: Wed, 2 Apr 2008 18:00:36 +0100 (BST)
Author: noelpwer
Date: Wed Apr 2 18:00:35 2008
New Revision: 12087
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12087&view=rev
Log:
fix button event problem, various fixes to api objects,
activate/deactivate events etc. ( still quite ropey )
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 2 18:00:35 2008
@@ -413,6 +413,17 @@
SFX_APP()->LeaveBasicCall();
}
return bRet;
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/svx/inc/svx/msocximex.hxx 2008-04-02 12:14:58.000000000 +0100
++++ svx/inc/svx/msocximex.hxx 2008-04-01 15:22:20.000000000 +0100
+@@ -908,7 +908,7 @@ public:
+ sal_uInt8 nKeepScrollBarsVisible;
+ sal_uInt8 nCycle;
+ sal_uInt16 nBorderStyle;
+- sal_uInt16 nSpecialEffect;
++ sal_uInt8 nSpecialEffect;
+ sal_uInt16 nPicture;
+ sal_uInt8 nPictureAlignment;
+ sal_uInt8 nPictureSizeMode;
diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/inc/document.hxx sc/inc/document.hxx
--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/inc/document.hxx 2008-03-29 23:08:24.000000000 +0000
+++ sc/inc/document.hxx 2008-03-28 10:30:33.000000000 +0000
@@ -442,8 +453,7 @@
BOOL GetTable( const String& rName, SCTAB& rTab ) const;
inline SCTAB GetTableCount() const { return nMaxTableNumber; }
SvNumberFormatterIndexTable* GetFormatExchangeList() const { return pFormatExchangeList; }
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/inc/servuno.hxx sc/inc/servuno.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/inc/servuno.hxx 2008-03-29 23:08:20.000000000 +0000
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/inc/servuno.hxx 2008-04-02 12:15:17.000000000 +0100
+++ sc/inc/servuno.hxx 2008-03-28 10:30:33.000000000 +0000
@@ -103,7 +103,9 @@ class ScDocShell;
#define SC_SERVICE_FORMULAPARS 38
@@ -456,6 +466,229 @@
#define SC_SERVICE_INVALID USHRT_MAX
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/unoobj/servuno.cxx 2008-04-02 12:07:01.000000000 +0100
++++ sc/source/ui/unoobj/servuno.cxx 2008-04-02 11:35:42.000000000 +0100
+@@ -46,10 +46,19 @@
+ #include <svx/unonrule.hxx>
+ #endif
+
++#include <com/sun/star/script/XEventAttacherManager.hpp>
++#include <com/sun/star/form/XFormsSupplier.hpp>
++#include <org/openoffice/vba/XVBAToOOEventDescGen.hpp>
++#include <org/openoffice/vba/XFakeVBAEventDescriptorSupplier.hpp>
++#include <comphelper/processfactory.hxx>
++
+ #ifndef _COM_SUN_STAR_SHEET_XSPREADSHEETDOCUMENT_HPP_
+ #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
+ #endif
+
++#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
++#include <com/sun/star/drawing/XControlShape.hpp>
++
+ #include "servuno.hxx"
+ #include "unonames.hxx"
+ #include "cellsuno.hxx"
+@@ -77,8 +86,164 @@
+ #include <svx/xmlgrhlp.hxx>
+ #endif
+
++#include "scextopt.hxx"
++#include <com/sun/star/script/XObjectProvider.hpp>
++#include <comphelper/processfactory.hxx>
++
+ using namespace ::com::sun::star;
+
++typedef ::cppu::WeakImplHelper1< org::openoffice::vba::XFakeVBAEventDescriptorSupplier > Initialization_BASE;
++
++class ScFakeVBACntrlEvtSupport : public Initialization_BASE
++{
++ ScDocShell* mpDoc;
++ ScFakeVBACntrlEvtSupport();
++ uno::Sequence< script::ScriptEventDescriptor > getFakeEvents( const uno::Reference< uno::XInterface >& xIf, sal_Int32 pageIndex )
++ {
++ rtl::OUString sServiceName;
++ uno::Reference< beans::XPropertySet > xProps( xIf, uno::UNO_QUERY );
++ xProps->getPropertyValue( rtl::OUString::createFromAscii("DefaultControl" ) ) >>= sServiceName;
++ OSL_TRACE("Control serviceName is %s", rtl::OUStringToOString( sServiceName, RTL_TEXTENCODING_UTF8 ).getStr() );
++ xProps.set( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
++ uno::Reference<uno::XComponentContext > xContext( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
++ uno::Reference< org::openoffice::vba::XVBAToOOEventDescGen > xEvtDescGen( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii( "org.openoffice.vba.VBAToOOEventDesc" ), xContext ), uno::UNO_QUERY_THROW );
++ uno::Sequence< rtl::OUString > sHandlerExtns;
++ String sLibModName;
++ mpDoc->GetDocument()->GetCodeName( pageIndex, sLibModName );
++
++ if( !sLibModName.Len() )
++ mpDoc->GetDocument()->GetName( pageIndex, sLibModName );
++
++ uno::Sequence< script::ScriptEventDescriptor > aFakeEvents = xEvtDescGen->getEventDescriptions( xContext->getServiceManager()->createInstanceWithContext( sServiceName, xContext ), sLibModName, sHandlerExtns ) ;
++ return aFakeEvents;
++ }
++public:
++ ScFakeVBACntrlEvtSupport( ScDocShell* pDoc ) : mpDoc( pDoc )
++ {
++ OSL_TRACE("*** In ScFakeVBACntrlEvtSupport ");
++ }
++ virtual uno::Sequence< com::sun::star::script::ScriptEventDescriptor > SAL_CALL getEventDescriptions( const uno::Reference< uno::XInterface >& xIf ) throw ( uno::RuntimeException )
++ {
++ OSL_TRACE( "*** In ScFakeVBACntrlEvtSupport::getEventDescriptions");
++ // need to find the page ( and index ) for this control
++ uno::Reference< drawing::XDrawPagesSupplier > xSupplier( mpDoc->GetModel(), uno::UNO_QUERY_THROW );
++
++ uno::Reference< container::XIndexAccess > xIndex( xSupplier->getDrawPages(), uno::UNO_QUERY_THROW );
++
++ sal_Int32 nLen = xIndex->getCount();
++ bool bMatched = false;
++ uno::Sequence< script::ScriptEventDescriptor > aFakeEvents;
++ for ( sal_Int32 index = 0; index < nLen; ++index )
++ {
++ try
++ {
++ uno::Reference< form::XFormsSupplier > xFormSupplier( xIndex->getByIndex( index ), uno::UNO_QUERY_THROW );
++ uno::Reference< container::XIndexAccess > xFormIndex( xFormSupplier->getForms(), uno::UNO_QUERY_THROW );
++ // get the www-standard container
++ uno::Reference< container::XIndexAccess > xFormControls( xFormIndex->getByIndex(0), uno::UNO_QUERY_THROW );
++ sal_Int32 nCntrls = xFormControls->getCount();
++ for( sal_Int32 cIndex = 0; cIndex < nCntrls; ++cIndex )
++ {
++ uno::Reference< uno::XInterface > xControl( xFormControls->getByIndex( cIndex ), uno::UNO_QUERY_THROW );
++ bMatched = ( xControl == xIf );
++ if ( bMatched )
++ {
++ aFakeEvents = getFakeEvents( xIf, index );
++ break;
++ }
++ }
++ }
++ catch( uno::Exception& ) {}
++ if ( bMatched )
++ break;
++ }
++ // Probably should throw here ( if !bMatched )
++ return aFakeEvents;
++ }
++};
++
++class ScVbaObjectProvider : public ::cppu::WeakImplHelper2< script::XObjectProvider, lang::XInitialization >
++{
++ ScDocShell* mpDocShell;
++ uno::Any aObj;
++ String msName;
++public:
++ ScVbaObjectProvider( const rtl::OUString& sName, ScDocShell* pDocShell ) : mpDocShell( pDocShell ), msName(sName) {}
++ ScVbaObjectProvider( ScDocShell* pDocShell ) : mpDocShell( pDocShell ) {}
++ virtual void SAL_CALL initialize( const uno::Sequence< uno::Any >& aArguments ) throw (uno::Exception, uno::RuntimeException)
++ {
++ OSL_TRACE("ScVbaObjectProvider::initialize ");
++ if(aArguments.getLength() != 1)
++ {
++ throw lang::IllegalArgumentException(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("give a string instanciating this component!") ), static_cast< script::XObjectProvider * >(this), 0 );
++ }
++ rtl::OUString sName;
++ aArguments[0] >>= sName;
++ msName = sName;
++ }
++ virtual uno::Any SAL_CALL getObject() throw (uno::RuntimeException)
++ {
++ if ( !aObj.hasValue() )
++ {
++ BOOL bWorkbook = FALSE;
++ uno::Type aType;
++ uno::Reference<lang::XMultiServiceFactory> xSF(comphelper::getProcessServiceFactory());
++ uno::Reference<beans::XPropertySet> xProps(xSF, uno::UNO_QUERY);
++ if( xProps.is() )
++ {
++ ScDocument* pDoc = mpDocShell->GetDocument();
++ if ( !pDoc )
++ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("")), uno::Reference< uno::XInterface >() );
++ String sGlobCodeName = pDoc->GetCodeName();
++ uno::Reference< uno::XInterface > xIf;
++
++ uno::Sequence< uno::Any > aArgs(2);
++ aArgs[0] = uno::Any( uno::Reference< uno::XInterface >() );
++ aArgs[1] = uno::Any( mpDocShell->GetModel() );
++ uno::Reference< uno::XInterface > xWorkbook( xSF->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Workbook") ), aArgs ), uno::UNO_QUERY );
++ if( sGlobCodeName == msName )
++ {
++ xIf.set( xWorkbook, uno::UNO_QUERY );
++ bWorkbook = TRUE;
++ }
++ else
++ {
++ String sCodeName;
++ SCTAB nCount = pDoc->GetTableCount();
++ for( SCTAB i = 0; i < nCount; i++ )
++ {
++ pDoc->GetCodeName( i, sCodeName );
++ if( sCodeName == msName )
++ {
++ String sSheetName;
++ if( pDoc->GetName( i, sSheetName ) )
++ {
++ uno::Reference< frame::XModel > xModel( mpDocShell->GetModel() );
++ uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( xModel, uno::UNO_QUERY_THROW );
++ uno::Reference<sheet::XSpreadsheets > xSheets( xSpreadDoc->getSheets(), uno::UNO_QUERY_THROW );
++ uno::Reference< container::XIndexAccess > xIndexAccess( xSheets, uno::UNO_QUERY_THROW );
++ uno::Reference< sheet::XSpreadsheet > xSheet( xIndexAccess->getByIndex( i ), uno::UNO_QUERY_THROW );
++ uno::Sequence< uno::Any > aArgs(3);
++ aArgs[0] = uno::Any( xWorkbook );
++ aArgs[1] = uno::Any( xModel );
++ aArgs[2] = uno::Any( rtl::OUString( sSheetName ) );
++ uno::Reference< uno::XInterface > xWorksheet( xSF->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Worksheet") ), aArgs ), uno::UNO_QUERY );
++ xIf.set( xWorksheet, uno::UNO_QUERY );
++ bWorkbook = FALSE;
++ break;
++ }
++ }
++ }
++ }
++ if( xIf.is() )
++ {
++ aObj <<= xIf;
++ }
++ }
++ }
++ return aObj;
++ }
++};
+
+ //------------------------------------------------------------------------
+
+@@ -128,7 +293,10 @@ static const sal_Char* __FAR_DATA aProvN
+
+ SC_SERVICENAME_CHDATAPROV, // SC_SERVICE_CHDATAPROV
+ SC_SERVICENAME_FORMULAPARS, // SC_SERVICE_FORMULAPARS
+- SC_SERVICENAME_OPCODEMAPPER // SC_SERVICE_OPCODEMAPPER
++ SC_SERVICENAME_OPCODEMAPPER, // SC_SERVICE_OPCODEMAPPER
++ "org.openoffice.vba.VBAObjectModuleObjectProvider",// SC_SERVICE_VBAOBJECTPROVIDER
++ "org.openoffice.vba.controlevents", // SC_SERVICE_VBACONTROL_EVENTS
++
+ };
+
+ //
+@@ -180,7 +348,9 @@ static const sal_Char* __FAR_DATA aOldNa
+ "", // SC_SERVICE_SHEETDOCSET
+ "", // SC_SERVICE_CHDATAPROV
+ "", // SC_SERVICE_FORMULAPARS
+- "" // SC_SERVICE_OPCODEMAPPER
++ "", // SC_SERVICE_OPCODEMAPPER
++ "", // SC_SERVICE_VBAOBJECTPROVIDER
++ "", // SC_SERVICE_VBACONTROL_EVENTS
+ };
+
+
+@@ -373,6 +543,12 @@ uno::Reference<uno::XInterface> ScServic
+ case SC_SERVICE_OPCODEMAPPER:
+ xRet.set(static_cast<sheet::XFormulaOpCodeMapper*>(new ScFormulaOpCodeMapperObj));
+ break;
++ case SC_SERVICE_VBAOBJECTPROVIDER:
++ xRet.set(static_cast<script::XObjectProvider*>(new ScVbaObjectProvider( pDocShell )));
++ break;
++ case SC_SERVICE_VBACONTROL_EVENTS:
++ xRet.set(static_cast<org::openoffice::vba::XFakeVBAEventDescriptorSupplier*>(new ScFakeVBACntrlEvtSupport( pDocShell ) ));
++ break;
+ }
+ return xRet;
+ }
diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/inc/table.hxx sc/inc/table.hxx
--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/inc/table.hxx 2008-03-29 23:08:24.000000000 +0000
+++ sc/inc/table.hxx 2008-03-28 10:30:33.000000000 +0000
@@ -858,236 +1091,16 @@
# --- Files --------------------------------------------------------
SLO1FILES = \
$(SLO)$/docuno.obj \
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/unoobj/servuno.cxx sc/source/ui/unoobj/servuno.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/unoobj/servuno.cxx 2008-03-29 23:08:20.000000000 +0000
-+++ sc/source/ui/unoobj/servuno.cxx 2008-03-28 10:30:33.000000000 +0000
-@@ -46,10 +46,19 @@
- #include <svx/unonrule.hxx>
- #endif
-
-+#include <com/sun/star/script/XEventAttacherManager.hpp>
-+#include <com/sun/star/form/XFormsSupplier.hpp>
-+#include <org/openoffice/vba/XVBAToOOEventDescGen.hpp>
-+#include <org/openoffice/vba/XFakeVBAEventDescriptorSupplier.hpp>
-+#include <comphelper/processfactory.hxx>
-+
- #ifndef _COM_SUN_STAR_SHEET_XSPREADSHEETDOCUMENT_HPP_
- #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
- #endif
-
-+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
-+#include <com/sun/star/drawing/XControlShape.hpp>
-+
- #include "servuno.hxx"
- #include "unonames.hxx"
- #include "cellsuno.hxx"
-@@ -77,8 +86,160 @@
- #include <svx/xmlgrhlp.hxx>
- #endif
-
-+#include "scextopt.hxx"
-+#include <com/sun/star/script/XObjectProvider.hpp>
-+#include <comphelper/processfactory.hxx>
-+
- using namespace ::com::sun::star;
-
-+typedef ::cppu::WeakImplHelper1< org::openoffice::vba::XFakeVBAEventDescriptorSupplier > Initialization_BASE;
-+
-+class ScFakeVBACntrlEvtSupport : public Initialization_BASE
-+{
-+ ScDocShell* mpDoc;
-+ ScFakeVBACntrlEvtSupport();
-+ uno::Sequence< script::ScriptEventDescriptor > getFakeEvents( const uno::Reference< uno::XInterface >& xIf, sal_Int32 pageIndex )
-+ {
-+ rtl::OUString sServiceName;
-+ uno::Reference< beans::XPropertySet > xProps( xIf, uno::UNO_QUERY );
-+ xProps->getPropertyValue( rtl::OUString::createFromAscii("DefaultControl" ) ) >>= sServiceName;
-+ OSL_TRACE("Control serviceName is %s", rtl::OUStringToOString( sServiceName, RTL_TEXTENCODING_UTF8 ).getStr() );
-+ xProps.set( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
-+ uno::Reference<uno::XComponentContext > xContext( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
-+ uno::Reference< org::openoffice::vba::XVBAToOOEventDescGen > xEvtDescGen( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii( "org.openoffice.vba.VBAToOOEventDesc" ), xContext ), uno::UNO_QUERY_THROW );
-+ uno::Sequence< rtl::OUString > sHandlerExtns;
-+ String sLibModName;
-+ mpDoc->GetDocument()->GetCodeName( pageIndex, sLibModName );
-+
-+ if( !sLibModName.Len() )
-+ mpDoc->GetDocument()->GetName( pageIndex, sLibModName );
-+
-+ uno::Sequence< script::ScriptEventDescriptor > aFakeEvents = xEvtDescGen->getEventDescriptions( xContext->getServiceManager()->createInstanceWithContext( sServiceName, xContext ), sLibModName, sHandlerExtns ) ;
-+ return aFakeEvents;
-+ }
-+public:
-+ ScFakeVBACntrlEvtSupport( ScDocShell* pDoc ) : mpDoc( pDoc )
-+ {
-+ OSL_TRACE("*** In ScFakeVBACntrlEvtSupport ");
-+ }
-+ virtual uno::Sequence< com::sun::star::script::ScriptEventDescriptor > SAL_CALL getEventDescriptions( const uno::Reference< uno::XInterface >& xIf ) throw ( uno::RuntimeException )
-+ {
-+ OSL_TRACE( "*** In ScFakeVBACntrlEvtSupport::getEventDescriptions");
-+ // need to find the page ( and index ) for this control
-+ uno::Reference< drawing::XDrawPagesSupplier > xSupplier( mpDoc->GetModel(), uno::UNO_QUERY_THROW );
-+
-+ uno::Reference< container::XIndexAccess > xIndex( xSupplier->getDrawPages(), uno::UNO_QUERY_THROW );
-+
-+ sal_Int32 nLen = xIndex->getCount();
-+ bool bMatched = false;
-+ uno::Sequence< script::ScriptEventDescriptor > aFakeEvents;
-+ for ( sal_Int32 index = 0; index < nLen; ++index )
-+ {
-+ uno::Reference< form::XFormsSupplier > xFormSupplier( xIndex->getByIndex( index ), uno::UNO_QUERY_THROW );
-+ uno::Reference< container::XIndexAccess > xFormIndex( xFormSupplier->getForms(), uno::UNO_QUERY_THROW );
-+ // get the www-standard container
-+ uno::Reference< container::XIndexAccess > xFormControls( xFormIndex->getByIndex(0), uno::UNO_QUERY_THROW );
-+ sal_Int32 nCntrls = xFormControls->getCount();
-+ for( sal_Int32 cIndex = 0; cIndex < nCntrls; ++cIndex )
-+ {
-+ uno::Reference< uno::XInterface > xControl( xFormControls->getByIndex( cIndex ), uno::UNO_QUERY_THROW );
-+ bMatched = ( xControl == xIf );
-+ if ( bMatched )
-+ {
-+ aFakeEvents = getFakeEvents( xIf, index );
-+ break;
-+ }
-+ }
-+ if ( bMatched )
-+ break;
-+ }
-+ // Probably should throw here
-+ return aFakeEvents;
-+ }
-+};
-+
-+class ScVbaObjectProvider : public ::cppu::WeakImplHelper2< script::XObjectProvider, lang::XInitialization >
-+{
-+ ScDocShell* mpDocShell;
-+ uno::Any aObj;
-+ String msName;
-+public:
-+ ScVbaObjectProvider( const rtl::OUString& sName, ScDocShell* pDocShell ) : mpDocShell( pDocShell ), msName(sName) {}
-+ ScVbaObjectProvider( ScDocShell* pDocShell ) : mpDocShell( pDocShell ) {}
-+ virtual void SAL_CALL initialize( const uno::Sequence< uno::Any >& aArguments ) throw (uno::Exception, uno::RuntimeException)
-+ {
-+ OSL_TRACE("ScVbaObjectProvider::initialize ");
-+ if(aArguments.getLength() != 1)
-+ {
-+ throw lang::IllegalArgumentException(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("give a string instanciating this component!") ), static_cast< script::XObjectProvider * >(this), 0 );
-+ }
-+ rtl::OUString sName;
-+ aArguments[0] >>= sName;
-+ msName = sName;
-+ }
-+ virtual uno::Any SAL_CALL getObject() throw (uno::RuntimeException)
-+ {
-+ if ( !aObj.hasValue() )
-+ {
-+ BOOL bWorkbook = FALSE;
-+ uno::Type aType;
-+ uno::Reference<lang::XMultiServiceFactory> xSF(comphelper::getProcessServiceFactory());
-+ uno::Reference<beans::XPropertySet> xProps(xSF, uno::UNO_QUERY);
-+ if( xProps.is() )
-+ {
-+ ScDocument* pDoc = mpDocShell->GetDocument();
-+ if ( !pDoc )
-+ throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("")), uno::Reference< uno::XInterface >() );
-+ String sGlobCodeName = pDoc->GetCodeName();
-+ uno::Reference< uno::XInterface > xIf;
-+
-+ uno::Sequence< uno::Any > aArgs(2);
-+ aArgs[0] = uno::Any( uno::Reference< uno::XInterface >() );
-+ aArgs[1] = uno::Any( mpDocShell->GetModel() );
-+ uno::Reference< uno::XInterface > xWorkbook( xSF->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Workbook") ), aArgs ), uno::UNO_QUERY );
-+ if( sGlobCodeName == msName )
-+ {
-+ xIf.set( xWorkbook, uno::UNO_QUERY );
-+ bWorkbook = TRUE;
-+ }
-+ else
-+ {
-+ String sCodeName;
-+ SCTAB nCount = pDoc->GetTableCount();
-+ for( SCTAB i = 0; i < nCount; i++ )
-+ {
-+ pDoc->GetCodeName( i, sCodeName );
-+ if( sCodeName == msName )
-+ {
-+ String sSheetName;
-+ if( pDoc->GetName( i, sSheetName ) )
-+ {
-+ uno::Reference< frame::XModel > xModel( mpDocShell->GetModel() );
-+ uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( xModel, uno::UNO_QUERY_THROW );
-+ uno::Reference<sheet::XSpreadsheets > xSheets( xSpreadDoc->getSheets(), uno::UNO_QUERY_THROW );
-+ uno::Reference< container::XIndexAccess > xIndexAccess( xSheets, uno::UNO_QUERY_THROW );
-+ uno::Reference< sheet::XSpreadsheet > xSheet( xIndexAccess->getByIndex( i ), uno::UNO_QUERY_THROW );
-+ uno::Sequence< uno::Any > aArgs(3);
-+ aArgs[0] = uno::Any( xWorkbook );
-+ aArgs[1] = uno::Any( xModel );
-+ aArgs[2] = uno::Any( rtl::OUString( sSheetName ) );
-+ uno::Reference< uno::XInterface > xWorksheet( xSF->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Worksheet") ), aArgs ), uno::UNO_QUERY );
-+ xIf.set( xWorksheet, uno::UNO_QUERY );
-+ bWorkbook = FALSE;
-+ break;
-+ }
-+ }
-+ }
-+ }
-+ if( xIf.is() )
-+ {
-+ aObj <<= xIf;
-+ }
-+ }
-+ }
-+ return aObj;
-+ }
-+};
-
- //------------------------------------------------------------------------
-
-@@ -128,7 +289,10 @@ static const sal_Char* __FAR_DATA aProvN
-
- SC_SERVICENAME_CHDATAPROV, // SC_SERVICE_CHDATAPROV
- SC_SERVICENAME_FORMULAPARS, // SC_SERVICE_FORMULAPARS
-- SC_SERVICENAME_OPCODEMAPPER // SC_SERVICE_OPCODEMAPPER
-+ SC_SERVICENAME_OPCODEMAPPER, // SC_SERVICE_OPCODEMAPPER
-+ "org.openoffice.vba.VBAObjectModuleObjectProvider",// SC_SERVICE_VBAOBJECTPROVIDER
-+ "org.openoffice.vba.controlevents", // SC_SERVICE_VBACONTROL_EVENTS
-+
- };
-
- //
-@@ -180,7 +344,9 @@ static const sal_Char* __FAR_DATA aOldNa
- "", // SC_SERVICE_SHEETDOCSET
- "", // SC_SERVICE_CHDATAPROV
- "", // SC_SERVICE_FORMULAPARS
-- "" // SC_SERVICE_OPCODEMAPPER
-+ "", // SC_SERVICE_OPCODEMAPPER
-+ "", // SC_SERVICE_VBAOBJECTPROVIDER
-+ "", // SC_SERVICE_VBACONTROL_EVENTS
- };
-
-
-@@ -373,6 +539,12 @@ uno::Reference<uno::XInterface> ScServic
- case SC_SERVICE_OPCODEMAPPER:
- xRet.set(static_cast<sheet::XFormulaOpCodeMapper*>(new ScFormulaOpCodeMapperObj));
- break;
-+ case SC_SERVICE_VBAOBJECTPROVIDER:
-+ xRet.set(static_cast<script::XObjectProvider*>(new ScVbaObjectProvider( pDocShell )));
-+ break;
-+ case SC_SERVICE_VBACONTROL_EVENTS:
-+ xRet.set(static_cast<org::openoffice::vba::XFakeVBAEventDescriptorSupplier*>(new ScFakeVBACntrlEvtSupport( pDocShell ) ));
-+ break;
- }
- return xRet;
- }
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/makefile.mk sc/source/ui/vba/makefile.mk
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/makefile.mk 2008-03-29 23:08:19.000000000 +0000
-+++ sc/source/ui/vba/makefile.mk 2008-03-28 14:09:38.000000000 +0000
-@@ -121,6 +121,9 @@ SLOFILES= \
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/makefile.mk 2008-04-02 11:08:55.000000000 +0100
++++ sc/source/ui/vba/makefile.mk 2008-04-01 16:48:08.000000000 +0100
+@@ -121,6 +121,10 @@ SLOFILES= \
$(SLO)$/vbacommandbarcontrols.obj \
$(SLO)$/vbacommandbar.obj \
$(SLO)$/vbacommandbars.obj \
+ $(SLO)$/vbauserform.obj \
+ $(SLO)$/vbacheckbox.obj \
+ $(SLO)$/vbatogglebutton.obj \
++ $(SLO)$/vbaframe.obj \
$(SLO)$/service.obj \
@@ -1176,10 +1189,9 @@
+ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
};
#endif //SC_VBA_BUTTON_HXX
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbacombobox.cxx sc/source/ui/vba/vbacombobox.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbacombobox.cxx 2007-12-07 10:48:18.000000000 +0000
-+++ sc/source/ui/vba/vbacombobox.cxx 2008-03-29 00:25:52.000000000 +0000
-@@ -39,34 +39,70 @@ using namespace com::sun::star;
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbacombobox.cxx 2008-03-31 15:23:06.000000000 +0100
++++ sc/source/ui/vba/vbacombobox.cxx 2008-04-01 22:19:50.000000000 +0100
+@@ -39,34 +39,83 @@ using namespace com::sun::star;
using namespace org::openoffice;
@@ -1203,23 +1215,57 @@
}
-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 )
--{
-- m_xProps->getPropertyValue( CONTROLSOURCEPROP ) >>= sSourceName;
--}
+// Attributes
-
-
--// Attributes
++
++
+// Value, [read] e.g. getValue returns the value of ooo Text propery e.g. the value in
+// the drop down
++uno::Any SAL_CALL
++ScVbaComboBox::getValue() throw (uno::RuntimeException)
+ {
+- 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)
++{
++ OSL_TRACE("** setListIndex() **");
++ uno::Sequence< sal_Int32 > sSelection(1);
++ _value >>= sSelection[ 0 ];
++ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( sSelection ) );
++}
+
+-// Attributes
uno::Any SAL_CALL
- ScVbaComboBox::getValue() throw (uno::RuntimeException)
+-ScVbaComboBox::getValue() throw (uno::RuntimeException)
++ScVbaComboBox::getListIndex() throw (uno::RuntimeException)
{
- return m_xProps->getPropertyValue( sSourceName );
-+ if ( mbDialogType )
-+ return m_xProps->getPropertyValue( TEXT );
-+ else
-+ return m_xProps->getPropertyValue( sSourceName );
++ OSL_TRACE("** getListIndex() **");
++ uno::Sequence< rtl::OUString > sItems;
++ m_xProps->getPropertyValue( ITEMS ) >>= sItems;
++ // should really return the item that has focus regardless of
++ // it been selected
++ if ( sItems.getLength() > 0 )
++ {
++ rtl::OUString sText = getText();
++ sal_Int32 nLen = sItems.getLength();
++ for ( sal_Int32 index = 0; sText.getLength() && index < nLen; ++index )
++ {
++ if ( sItems[ index ].equals( sText ) )
++ {
++ OSL_TRACE("getListIndex returning %d", index );
++ return uno::makeAny( index );
++ }
++
++ }
++ }
++ OSL_TRACE("getListIndex returning %d", -1 );
++ return uno::makeAny( sal_Int32( -1 ) );
}
+// Value, [write]e.g. setValue sets the value in the drop down, and if the value is one
@@ -1229,29 +1275,7 @@
{
- m_xProps->setPropertyValue( sSourceName, _value );
+ if ( mbDialogType )
-+ {
-+ uno::Sequence< sal_Int32 > sSelection;
-+ uno::Sequence< rtl::OUString > sItems;
-+ m_xProps->getPropertyValue( SELECTEDITEMS ) >>= sSelection;
-+ m_xProps->getPropertyValue( ITEMS ) >>= sItems;
-+ // Assume you can't set a value to a mulipleselection ( need to check )
-+ if ( sSelection.getLength() > 1 )
-+ throw uno::RuntimeException( rtl::OUString::createFromAscii( "Attribute use invalid." ), uno::Reference< uno::XInterface >() );
-+
-+ rtl::OUString sValue = getAnyAsString( _value );
-+ sal_Int32 nItems = sItems.getLength();
-+ for ( sal_Int32 index = 0; index < nItems; ++index )
-+ {
-+ if ( sItems[ index ].equals( sValue ) )
-+ {
-+ uno::Sequence< sal_Int32 > sSelected( 1 );
-+ sSelected[ 0 ] = index;
-+ m_xProps->setPropertyValue( SELECTEDITEMS, uno::makeAny( sSelected ) );
-+ break;
-+ }
-+ }
-+ m_xProps->setPropertyValue( TEXT, uno::makeAny( sValue ) );
-+ }
++ m_xProps->setPropertyValue( TEXT, _value );
+ else
+ m_xProps->setPropertyValue( sSourceName, _value );
}
@@ -1261,7 +1285,7 @@
::rtl::OUString SAL_CALL
ScVbaComboBox::getText() throw (uno::RuntimeException)
{
-@@ -145,3 +181,22 @@ ScVbaComboBox::Clear( ) throw (uno::Run
+@@ -145,3 +194,22 @@ ScVbaComboBox::Clear( ) throw (uno::Run
setValue( uno::makeAny( rtl::OUString() ) );
m_xProps->setPropertyValue( ITEMS, uno::makeAny( uno::Sequence< rtl::OUString >() ) );
}
@@ -1284,10 +1308,9 @@
+ }
+ return aServiceNames;
+}
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbacombobox.hxx sc/source/ui/vba/vbacombobox.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbacombobox.hxx 2007-12-07 10:48:31.000000000 +0000
-+++ sc/source/ui/vba/vbacombobox.hxx 2008-03-29 00:21:48.000000000 +0000
-@@ -49,20 +49,13 @@
+--- /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
{
@@ -1309,8 +1332,12 @@
+ 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);
-@@ -76,6 +69,9 @@ public:
+ 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"); }
@@ -1320,15 +1347,15 @@
};
#endif //
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbacontrol.cxx sc/source/ui/vba/vbacontrol.cxx
---- /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-03-29 00:27:30.000000000 +0000
-@@ -49,17 +49,21 @@
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbacontrol.cxx 2008-03-31 15:23:06.000000000 +0100
++++ sc/source/ui/vba/vbacontrol.cxx 2008-04-01 21:18:45.000000000 +0100
+@@ -49,17 +49,22 @@
#include "vbatextbox.hxx"
#include "vbaradiobutton.hxx"
#include "vbalistbox.hxx"
+#include "vbatogglebutton.hxx"
+#include "vbacheckbox.hxx"
++#include "vbaframe.hxx"
using namespace com::sun::star;
@@ -1349,7 +1376,7 @@
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 +71,18 @@ ScVbaControl::getWindowPeer( const uno::
+@@ -67,17 +72,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 );
@@ -1371,7 +1398,7 @@
}
//ScVbaControlListener
-@@ -111,67 +116,49 @@ ScVbaControlListener::disposing( const l
+@@ -111,67 +117,49 @@ ScVbaControlListener::disposing( const l
//ScVbaControl
@@ -1465,7 +1492,7 @@
}
//In design model has different behavior
-@@ -194,132 +181,156 @@ void SAL_CALL ScVbaControl::setEnabled(
+@@ -194,132 +182,160 @@ void SAL_CALL ScVbaControl::setEnabled(
sal_Bool SAL_CALL ScVbaControl::getVisible() throw (uno::RuntimeException)
{
@@ -1619,10 +1646,10 @@
+ // 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.com.sun.star.awt.UnoControlRadioButtonModel") ) ) )
++ 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 );
++ 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:
@@ -1659,6 +1686,10 @@
+ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ) )
+ //pControl = new ScVbaProgressBar( m_xContext, xControl );
+ throw uno::RuntimeException();
++ else if ( xServiceInfo->supportsService( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ) )
++ pControl = new ScVbaFrame( m_xContext, xControl );
++ else
++ throw uno::RuntimeException( rtl::OUString::createFromAscii("Unsupported control " ), uno::Reference< uno::XInterface >() );
+ return pControl;
+}
+
@@ -2176,19 +2207,52 @@
private:
protected:
css::uno::Reference< css::drawing::XShape > m_xShape;
-diff -rup /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 2007-12-07 11:03:50.000000000 +0000
-+++ sc/source/ui/vba/vbatextbox.cxx 2008-03-28 14:28:35.000000000 +0000
-@@ -42,7 +42,7 @@ using namespace org::openoffice;
+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;
-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 ) : TextBoxImpl_BASE( xContext, xControl )
++ScVbaTextBox::ScVbaTextBox( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, bool bDialog ) : TextBoxImpl_BASE( xContext, xControl ), mbDialog( bDialog )
{
}
-@@ -103,3 +103,22 @@ ScVbaTextBox::setMultiline( sal_Bool _mu
+ // Attributes
++uno::Any SAL_CALL
++ScVbaTextBox::getValue() throw (css::uno::RuntimeException)
++{
++ return uno::makeAny( getText() );
++}
++
++void SAL_CALL
++ScVbaTextBox::setValue( const uno::Any& _value ) throw (css::uno::RuntimeException)
++{
++ rtl::OUString sVal = getAnyAsString( _value );
++ setText( sVal );
++}
++
+ //getString() will cause some imfo lose.
+ rtl::OUString SAL_CALL
+ ScVbaTextBox::getText() throw (css::uno::RuntimeException)
+@@ -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);
}
@@ -2211,19 +2275,23 @@
+ }
+ return aServiceNames;
+}
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbatextbox.hxx sc/source/ui/vba/vbatextbox.hxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/sc/source/ui/vba/vbatextbox.hxx 2007-12-07 11:04:01.000000000 +0000
-+++ sc/source/ui/vba/vbatextbox.hxx 2008-03-28 14:23:42.000000000 +0000
-@@ -45,7 +45,7 @@ class ScVbaTextBox : public TextBoxImpl_
+--- /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 );
++ 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);
-@@ -53,6 +53,8 @@ public:
+ 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);
@@ -2502,8 +2570,8 @@
pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
--- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbauserform.hxx 2008-03-29 21:39:06.000000000 +0000
-@@ -0,0 +1,76 @@
++++ sc/source/ui/vba/vbauserform.hxx 2008-04-01 23:45:59.000000000 +0100
+@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
@@ -2562,6 +2630,7 @@
+ 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);
@@ -2581,8 +2650,8 @@
+};
+#endif
--- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ sc/source/ui/vba/vbauserform.cxx 2008-03-29 22:06:12.000000000 +0000
-@@ -0,0 +1,252 @@
++++ sc/source/ui/vba/vbauserform.cxx 2008-04-01 23:42:05.000000000 +0100
+@@ -0,0 +1,265 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
@@ -2629,8 +2698,8 @@
+using namespace ::org::openoffice;
+using namespace ::com::sun::star;
+
-+#define VBA_LEFT "Left"
-+#define VBA_TOP "Top"
++#define VBA_LEFT "PositionX"
++#define VBA_TOP "PositionY"
+class UserFormGeometryHelper : public AbstractGeometryAttributes
+{
+
@@ -2644,11 +2713,11 @@
+ {
+ sal_Int32 nLeft = 0;
+ mxModel->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ) ) >>= nLeft;
-+ return Millimeter::getInPoints( nLeft );
++ return nLeft;
+ }
+ virtual void setLeft( double nLeft )
+ {
-+ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ), uno::makeAny( Millimeter::getInHundredthsOfOneMillimeter( nLeft ) ) );
++ mxModel->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VBA_LEFT ) ), uno::makeAny( static_cast< sal_Int32 >( nLeft ) ) );
+ }
+ virtual double getTop()
+ {
@@ -2754,6 +2823,12 @@
+}
+
+void SAL_CALL
++ScVbaUserForm::RePaint( ) throw (uno::RuntimeException)
++{
++ // do nothing
++}
++
++void SAL_CALL
+ScVbaUserForm::UnloadObject( ) throw (uno::RuntimeException)
+{
+ mbDispose = true;
@@ -2820,9 +2895,16 @@
+::sal_Bool SAL_CALL
+ScVbaUserForm::hasProperty( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
+{
-+ uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
-+ uno::Reference< container::XNameAccess > xNameAccess( xControl->getModel(), uno::UNO_QUERY_THROW );
-+ return xNameAccess->hasByName( aName );
++ 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
@@ -3395,9 +3477,8 @@
// Sonst testen, ob das Element vorhanden ist
// GBLSEARCH-Flag rausnehmen (wg. Rekursion)
USHORT nGblFlag = p->GetFlags() & SBX_GBLSEARCH;
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/classes/sbxmod.cxx basic/source/classes/sbxmod.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/classes/sbxmod.cxx 2008-03-29 23:08:19.000000000 +0000
-+++ basic/source/classes/sbxmod.cxx 2008-03-29 21:24:15.000000000 +0000
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/basic/source/classes/sbxmod.cxx 2008-03-31 15:23:06.000000000 +0100
++++ basic/source/classes/sbxmod.cxx 2008-04-01 23:38:20.000000000 +0100
@@ -62,6 +62,9 @@
#include "sbunoobj.hxx"
#include <basic/hilight.hxx>
@@ -3436,7 +3517,7 @@
SV_DECL_VARARR(SbiBreakpoints,USHORT,4,4)
SV_IMPL_VARARR(SbiBreakpoints,USHORT)
-@@ -1903,6 +1919,230 @@ void SyntaxHighlighter::getHighlightPort
+@@ -1903,6 +1919,263 @@ void SyntaxHighlighter::getHighlightPort
m_pSimpleTokenizer->getHighlightPortions( nLine, rLine, portions );
}
@@ -3514,21 +3595,23 @@
+ }
+}
+
-+typedef ::cppu::WeakImplHelper1< lang::XEventListener > EventListener_BASE;
++typedef ::cppu::WeakImplHelper1< awt::XFocusListener > EventListener_BASE;
++//typedef ::cppu::WeakImplHelper1< lang::XEventListener > EventListener_BASE;
+
+class FormObjEventListenerImpl : public EventListener_BASE
+{
+ SbUserFormModule* mpUserForm;
+ uno::Reference< lang::XComponent > mxComponent;
+ bool mbDisposed;
-+ FormObjEventListenerImpl();// not defined
-+ FormObjEventListenerImpl(const FormObjEventListenerImpl&);// not defined
++ 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() );
+ {
-+ mxComponent->addEventListener( this );
++ uno::Reference< awt::XWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
++ xList->addFocusListener( this );
+ }
+ }
+
@@ -3542,12 +3625,26 @@
+ {
+ if ( mxComponent.is() && !mbDisposed )
+ {
-+ mxComponent->removeEventListener( this );
++ uno::Reference< awt::XWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
++ xList->addFocusListener( this );
+ mxComponent = NULL;
+ }
+ }
+ catch( uno::Exception& ) {}
++ }
++
++ virtual void SAL_CALL focusGained( const awt::FocusEvent& e ) throw (::uno::RuntimeException)
++ {
++ if ( mpUserForm )
++ mpUserForm->triggerActivateEvent();
++ }
++
++ virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw (::com::sun::star::uno::RuntimeException)
++ {
++ if ( mpUserForm )
++ mpUserForm->triggerDeActivateEvent();
+ }
++
+ virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw (uno::RuntimeException)
+ {
+ OSL_TRACE("** Userform/Dialog disposing");
@@ -3568,19 +3665,19 @@
+
+void SbUserFormModule::ResetApiObj( bool bUnload )
+{
++ if ( m_xDialog.is() ) // probably someone close the dialog window
++ {
++ triggerTerminateEvent();
++ }
+ pDocObject = NULL;
+ m_xDialog = NULL;
-+ //triggerTerminateEvent();
+}
+
-+void SbUserFormModule::triggerInitializeEvent( void )
-+
++void SbUserFormModule::triggerMethod( const String& aMethod )
+{
-+ OSL_TRACE("**** SbUserFormModule::triggerInitializeEvent");
-+ static String aInitMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Initialize") );
-+
++ OSL_TRACE("*** trigger %s ***", rtl::OUStringToOString( aMethod, RTL_TEXTENCODING_UTF8 ).getStr() );
+ // Search method
-+ SbxVariable* pMeth = SbObjModule::Find( aInitMethodName, SbxCLASS_METHOD );
++ SbxVariable* pMeth = SbObjModule::Find( aMethod, SbxCLASS_METHOD );
+ if( pMeth )
+ {
+ SbxValues aVals;
@@ -3588,24 +3685,40 @@
+ }
+}
+
++void SbUserFormModule::triggerActivateEvent( void )
++{
++ OSL_TRACE("**** SbUserFormModule::triggerActivate");
++ static String aMethodName( RTL_CONSTASCII_USTRINGPARAM("UserForm_activate") );
++ triggerMethod( aMethodName );
++}
++
++void SbUserFormModule::triggerDeActivateEvent( void )
++{
++ OSL_TRACE("**** SbUserFormModule::triggerDeActivate");
++ static String aMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_DeActivate") );
++ triggerMethod( aMethodName );
++}
++
++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") );
-+
-+ // Search method
-+ SbxVariable* pMeth = SbObjModule::Find( aTermMethodName, SbxCLASS_METHOD );
-+ if( pMeth )
-+ {
-+ SbxValues aVals;
-+ pMeth->Get( aVals );
-+ }
++ triggerMethod( aTermMethodName );
+}
+
+void SbUserFormModule::Unload()
+{
-+ OSL_TRACE("** Unload() "); // #FIXME the rtl method should just call find on "Unload"
-+ if ( m_xDialog.is() ) // this whole method can be gotten rid of
++ OSL_TRACE("** Unload() ");
++ if ( m_xDialog.is() )
+ {
+ triggerTerminateEvent();
+ }
@@ -3614,6 +3727,7 @@
+ if( pMeth )
+ {
+ OSL_TRACE("Attempting too run the UnloadObjectMethod");
++ m_xDialog = NULL; //release ref to the uno object
+ SbxValues aVals;
+ pMeth->Get( aVals );
+ }
@@ -3806,8 +3920,8 @@
NameContainerNameMap::iterator aIt = mHashMap.find( aName );
--- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ basic/inc/basic/sbobjmod.hxx 2008-03-29 21:24:47.000000000 +0000
-@@ -0,0 +1,93 @@
++++ basic/inc/basic/sbobjmod.hxx 2008-04-01 23:01:32.000000000 +0100
+@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
@@ -3888,6 +4002,9 @@
+ virtual SbxVariable* Find( const XubString& rName, SbxClassType t );
+ void ResetApiObj( bool bUnloaded = true );
+ void Unload();
++ void triggerMethod( const String& );
++ void triggerActivateEvent();
++ void triggerDeActivateEvent();
+ void triggerInitializeEvent();
+ void triggerTerminateEvent();
+};
@@ -3978,8 +4095,7 @@
}
}
}
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/msforms/makefile.mk oovbaapi/org/openoffice/msforms/makefile.mk
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/msforms/makefile.mk 2008-03-29 23:08:19.000000000 +0000
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/oovbaapi/org/openoffice/msforms/makefile.mk 2008-03-31 15:23:06.000000000 +0100
+++ oovbaapi/org/openoffice/msforms/makefile.mk 2008-03-28 18:04:39.000000000 +0000
@@ -60,7 +60,9 @@ IDLFILES=\
XPictureFormat.idl \
@@ -4014,6 +4130,27 @@
[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/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;
+ };
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
@@ -4029,12 +4166,71 @@
}; }; };
#endif
--- /dev/null 2007-05-04 11:54:36.000000000 +0100
-+++ oovbaapi/org/openoffice/msforms/XUserForm.idl 2008-03-29 21:26:04.000000000 +0000
++++ 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 $
@@ -4082,6 +4278,7 @@
+ [attribute] string Caption;
+ void Show();
+ void Hide();
++ void RePaint();
+ void UnloadObject();
+};
+}; }; };
@@ -4318,10 +4515,17 @@
//.........................................................................
namespace dlgprov
{
-diff -rup /data4/OOOBuildM12/ooo-build/build/ooh680-m12/scripting/source/vbaevents/eventhelper.cxx scripting/source/vbaevents/eventhelper.cxx
---- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/scripting/source/vbaevents/eventhelper.cxx 2008-03-29 23:08:19.000000000 +0000
-+++ scripting/source/vbaevents/eventhelper.cxx 2008-03-29 00:44:15.000000000 +0000
-@@ -94,7 +94,7 @@ Sequence< ::rtl::OUString> getEventMetho
+--- /data4/OOOBuildM12/ooo-build/build/ooh680-m12/scripting/source/vbaevents/eventhelper.cxx 2008-03-31 15:23:06.000000000 +0100
++++ scripting/source/vbaevents/eventhelper.cxx 2008-03-31 12:20:04.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;
}
@@ -4330,7 +4534,7 @@
void dumpListeners( const Reference< beans::XIntrospection >& xIntrospection, const Reference<XInterface>& xIfc)
{
Reference< beans::XIntrospectionAccess > xIntrospectionAccess;
-@@ -164,6 +164,7 @@ void dumpEvent( const ScriptEvent& evt )
+@@ -164,6 +165,7 @@ void dumpEvent( const ScriptEvent& evt )
}
}
@@ -4338,7 +4542,7 @@
bool isKeyEventOk( awt::KeyEvent& evt, const Sequence< Any >& params )
{
-@@ -277,6 +278,9 @@ EventInfoHash& getEventTransInfo()
+@@ -277,6 +279,9 @@ EventInfoHash& getEventTransInfo()
info.sVBAName = rtl::OUString::createFromAscii("_Click");
info.toVBA = NULL;
actionInfos.push_back( info );
@@ -4348,7 +4552,7 @@
eventTransInfo[ rtl::OUString::createFromAscii("actionPerformed") ] = actionInfos;
// changed ooo event
std::list< TranslateInfo > changeInfos;
-@@ -336,7 +340,7 @@ EventInfoHash& getEventTransInfo()
+@@ -336,7 +341,7 @@ EventInfoHash& getEventTransInfo()
eventTransInfo[ rtl::OUString::createFromAscii("mousePressed") ] = mousePressedInfos;
// mouseMoved ooo event
std::list< TranslateInfo > mouseMovedInfos;
@@ -4357,7 +4561,7 @@
info.toVBA = ooMouseEvtToVBAMouseEvt;
mouseMovedInfos.push_back( info );
eventTransInfo[ rtl::OUString::createFromAscii("mouseMoved") ] = mouseMovedInfos;
-@@ -393,41 +397,17 @@ eventMethodToDescriptors( const ::rtl::O
+@@ -393,41 +398,17 @@ eventMethodToDescriptors( const ::rtl::O
EventInfoHash::const_iterator eventInfo_it = infos.find( sMethodName );
EventInfoHash::const_iterator it_end = infos.end();
@@ -4407,7 +4611,7 @@
return false;
}
-@@ -522,8 +502,10 @@ ScriptEventFactory::getEventListeners( c
+@@ -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 );
@@ -4420,7 +4624,7 @@
Reference< beans::XIntrospectionAccess > xIntrospectionAccess;
if ( xIntrospection.is() )
{
-@@ -583,7 +565,8 @@ ScriptEventFactory::createEvents( const
+@@ -583,7 +566,8 @@ ScriptEventFactory::createEvents( const
::rtl::OUString sNoNameSpaceMethod = *pSrc;
if ( ( lastDotIndex = pSrc->lastIndexOf( '.' ) ) > -1 )
sNoNameSpaceMethod = sNoNameSpaceMethod.copy( lastDotIndex + 1 );
@@ -4430,7 +4634,7 @@
if ( eventMethodToDescriptors( sNoNameSpaceMethod, xControl, sLibModName, sHandlerExts, evtDescs ) )
{
sal_Int32 dIndex = nEvts;
-@@ -826,13 +809,23 @@ EventListener::getPropertySetInfo( ) th
+@@ -826,13 +810,28 @@ EventListener::getPropertySetInfo( ) th
void
EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet ) throw(RuntimeException)
{
@@ -4451,11 +4655,16 @@
+ uno::Reference< beans::XPropertySet > xProps( xControl->getModel(), uno::UNO_QUERY_THROW );
+ rtl::OUString sName;
+ OSL_TRACE("Getting Name");
-+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) >>= sName;
++
++ 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 +851,11 @@ EventListener::firing_Impl(const ScriptE
+@@ -858,14 +857,11 @@ EventListener::firing_Impl(const ScriptE
{
// see if we have a match for the handlerextension
// where ScriptCode is methodname_handlerextension
@@ -4475,7 +4684,7 @@
{
// !! translate arguments & emulate events where necessary
Sequence< Any > aArguments;
-@@ -881,7 +871,7 @@ EventListener::firing_Impl(const ScriptE
+@@ -881,7 +877,7 @@ EventListener::firing_Impl(const ScriptE
static rtl::OUString part2 = rtl::OUString::createFromAscii("?language=Basic&location=document");
// create script url
@@ -4484,7 +4693,7 @@
OSL_TRACE("script url = %s",
rtl::OUStringToOString( url,
-@@ -893,16 +883,7 @@ EventListener::firing_Impl(const ScriptE
+@@ -893,16 +889,7 @@ EventListener::firing_Impl(const ScriptE
{
uno::Reference< script::provider::XScript > xScript = xScriptProvider->getScript( url );
if ( xScript.is() )
@@ -4907,3 +5116,145 @@
+ }
+ return aServiceNames;
+}
+--- /dev/null 2007-05-04 11:54:36.000000000 +0100
++++ sc/source/ui/vba/vbaframe.hxx 2008-04-01 16:49:12.000000000 +0100
+@@ -0,0 +1,57 @@
++/*************************************************************************
++ *
++ * 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 > LabelImpl_BASE;
++
++class ScVbaFrame : public LabelImpl_BASE
++{
++public:
++ ScVbaFrame( 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);
++ //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-01 16:48:38.000000000 +0100
+@@ -0,0 +1,79 @@
++/*************************************************************************
++ *
++ * 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 ) : LabelImpl_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 ) );
++}
++
++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;
++}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]