diff options
author | Daniel Rentz <dr@openoffice.org> | 2010-07-06 19:34:53 +0200 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2010-07-06 19:34:53 +0200 |
commit | d5bbb90b33416ad70987ab6725e41c1ce673ab93 (patch) | |
tree | ef4ed55c797fd6ba98c5ef29c36c6ff64dc7ad60 /sc/inc | |
parent | bee21111f8c0d5974031722236ae52bdb0d65b97 (diff) |
mib17: #i112634# add VBA sheet event handling, based on a patch from Noel Power
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/document.hxx | 13 | ||||
-rw-r--r-- | sc/inc/docuno.hxx | 9 | ||||
-rwxr-xr-x | sc/inc/sheetevents.hxx | 2 |
3 files changed, 23 insertions, 1 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 0f22b40eef1d..a829787aac2f 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -159,6 +159,9 @@ namespace com { namespace sun { namespace star { namespace embed { class XEmbeddedObject; } + namespace script { namespace vba { + class XEventProcessor; + } } } } } #include <svl/zforlist.hxx> @@ -329,6 +332,10 @@ private: Timer aTrackTimer; + // mutable for lazy construction + mutable com::sun::star::uno::Reference< com::sun::star::script::vba::XEventProcessor > + mxVbaEvents; + public: ScTabOpList aTableOpList; // list of ScInterpreterTableOpParams currently in use ScInterpreterTableOpParams aLastTableOpParams; // remember last params @@ -733,7 +740,8 @@ public: const ScSheetEvents* GetSheetEvents( SCTAB nTab ) const; void SetSheetEvents( SCTAB nTab, const ScSheetEvents* pNew ); - bool HasSheetEventScript( sal_Int32 nEvent ) const; // on any sheet + bool HasSheetEventScript( SCTAB nTab, sal_Int32 nEvent, bool bWithVbaEvents = false ) const; + bool HasAnySheetEventScript( sal_Int32 nEvent, bool bWithVbaEvents = false ) const; // on any sheet BOOL HasCalcNotification( SCTAB nTab ) const; void SetCalcNotification( SCTAB nTab ); @@ -1751,6 +1759,9 @@ public: void GetSortParam( ScSortParam& rParam, SCTAB nTab ); void SetSortParam( ScSortParam& rParam, SCTAB nTab ); + com::sun::star::uno::Reference< com::sun::star::script::vba::XEventProcessor > + GetVbaEventProcessor() const; + /** Should only be GRAM_PODF or GRAM_ODFF. */ void SetStorageGrammar( formula::FormulaGrammar::Grammar eGrammar ); formula::FormulaGrammar::Grammar GetStorageGrammar() const diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 2c3ecee39e32..fd2d9a706556 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -53,6 +53,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/sheet/XCellRangesAccess.hpp> #include <com/sun/star/util/XChangesNotifier.hpp> +#include <com/sun/star/script/vba/XCoreEventProcessor.hpp> #include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase4.hxx> @@ -88,6 +89,7 @@ class SC_DLLPUBLIC ScModelObj : public SfxBaseModel, public com::sun::star::view::XRenderable, public com::sun::star::document::XLinkTargetSupplier, public com::sun::star::beans::XPropertySet, + public com::sun::star::script::vba::XCoreEventProcessor, public SvxFmMSFactory, // derived from XMultiServiceFactory public com::sun::star::lang::XServiceInfo, public ::com::sun::star::util::XChangesNotifier @@ -321,6 +323,13 @@ public: virtual void SAL_CALL removeChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XCoreEventProcessor + virtual void SAL_CALL processCoreVbaEvent( sal_Int32 nSlotId ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::script::provider::ScriptFrameworkErrorException, + ::com::sun::star::util::VetoException, + ::com::sun::star::uno::RuntimeException); }; diff --git a/sc/inc/sheetevents.hxx b/sc/inc/sheetevents.hxx index 8f52efb990f7..bb27f5cf2068 100755 --- a/sc/inc/sheetevents.hxx +++ b/sc/inc/sheetevents.hxx @@ -59,6 +59,8 @@ public: void SetScript(sal_Int32 nEvent, const rtl::OUString* pNew); static rtl::OUString GetEventName(sal_Int32 nEvent); + static sal_Int32 GetVbaSheetEventId(sal_Int32 nEvent); + static sal_Int32 GetVbaDocumentEventId(sal_Int32 nEvent); }; #endif |