diff options
author | os <os@openoffice.org> | 2010-10-05 14:50:49 +0200 |
---|---|---|
committer | os <os@openoffice.org> | 2010-10-05 14:50:49 +0200 |
commit | 3d5ad5eea711f9f4c70f537be81218c3d3729cd8 (patch) | |
tree | d74de6ca5797ab2a62330ad3fafcdc2aff626584 /sw/source/ui/app | |
parent | 741b92c15a133ddbc343916d913e35ddd2e4d91b (diff) | |
parent | 90a45727e45941abef69c1827a646cf64bb70d96 (diff) |
m89 merged
Diffstat (limited to 'sw/source/ui/app')
-rw-r--r-- | sw/source/ui/app/docsh2.cxx | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index cb21c8939bd1..99eda0acf1e2 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -119,7 +119,10 @@ #include <com/sun/star/ui/dialogs/ListboxControlActions.hpp> #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" - +#ifdef FUTURE_VBA +#include <com/sun/star/script/vba/XVBAEventProcessor.hpp> +#include <com/sun/star/script/vba/VBAEventId.hpp> +#endif #include <editeng/acorrcfg.hxx> #include <SwStyleNameMapper.hxx> @@ -137,7 +140,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star; using ::rtl::OUString; using namespace ::sfx2; - extern BOOL FindPhyStyle( SwDoc& , const String& , SfxStyleFamily ); /*-------------------------------------------------------------------- @@ -188,6 +190,26 @@ void SwDocShell::DoFlushDocInfo() } } +#ifdef FUTURE_VBA +void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventProcessor >& xVbaEvents, const SfxHint& rHint ) +{ + using namespace com::sun::star::script::vba::VBAEventId; + if ( rHint.ISA( SfxEventHint ) ) + { + uno::Sequence< uno::Any > aArgs; + ULONG nEventId = ((SfxEventHint&)rHint).GetEventId(); + switch( nEventId ) + { + case SFX_EVENT_CREATEDOC: + xVbaEvents->processVbaEvent( DOCUMENT_NEW, aArgs ); + break; + case SFX_EVENT_OPENDOC: + xVbaEvents->processVbaEvent( DOCUMENT_OPEN, aArgs ); + break; + } + } +} +#endif /*-------------------------------------------------------------------- Beschreibung: Benachrichtigung bei geaenderter DocInfo @@ -202,6 +224,12 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) return ; } +#ifdef FUTURE_VBA + uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor(); + if( xVbaEvents.is() ) + lcl_processCompatibleSfxHint( xVbaEvents, rHint ); +#endif + USHORT nAction = 0; if( rHint.ISA(SfxSimpleHint) ) { @@ -283,6 +311,18 @@ USHORT SwDocShell::PrepareClose( BOOL bUI, BOOL bForBrowsing ) if( TRUE == nRet ) //Unbedingt auf TRUE abfragen! (RET_NEWTASK) EndListening( *this ); +#ifdef FUTURE_VBA + if( pDoc && IsInPrepareClose() ) + { + uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor(); + if( xVbaEvents.is() ) + { + using namespace com::sun::star::script::vba::VBAEventId; + uno::Sequence< uno::Any > aArgs; + xVbaEvents->processVbaEvent( DOCUMENT_CLOSE, aArgs ); + } + } +#endif return nRet; } |