diff options
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 23 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 14 |
4 files changed, 19 insertions, 32 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index ae3b527ff7a6..066f366b09bd 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -100,7 +100,6 @@ #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/util/XCloneable.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> -#include <com/sun/star/script/vba/XCoreEventProcessor.hpp> #include "helpid.hrc" @@ -490,21 +489,12 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) case SID_SAVEASDOC: case SID_SAVEDOC: { - // ask VBA emulation at document model whether to save the document - if( nId == SID_SAVEDOC || nId == SID_SAVEASDOC ) try + // derived class may decide to abort this + if( !QuerySlotExecutable( nId ) ) { - Reference< script::vba::XCoreEventProcessor > xEventProcessor( GetModel(), UNO_QUERY_THROW ); - xEventProcessor->processCoreVbaEvent( nId ); - } - catch( util::VetoException& ) - { - // VBA event handler indicates to cancel saving the document - rReq.SetReturnValue( SfxBoolItem( 0, TRUE ) ); + rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) ); return; } - catch( Exception& ) - { - } //!! detaillierte Auswertung eines Fehlercodes SfxObjectShellRef xLock( this ); @@ -914,13 +904,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) //------------------------------------------------------------------------- -sal_Bool SfxObjectShell::IsInPrepareClose() const -{ - return pImp->bInPrepareClose; -} - -//-------------------------------------------------------------------- - void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) { DBG_CHKTHIS(SfxObjectShell, 0); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 6e1d89f2a8cd..e1b22ca26a22 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -195,6 +195,13 @@ sal_Bool SfxObjectShell::SaveAs( SfxMedium& rMedium ) //------------------------------------------------------------------------- +sal_Bool SfxObjectShell::QuerySlotExecutable( USHORT /*nSlotId*/ ) +{ + return sal_True; +} + +//------------------------------------------------------------------------- + sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd ) { const SfxPoolItem* pItem = NULL; diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 6502eeaeb78c..f8b6cfe44407 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -524,6 +524,13 @@ SfxObjectShell* SfxObjectShell::Current() return pFrame ? pFrame->GetObjectShell() : 0; } +//------------------------------------------------------------------------- + +sal_Bool SfxObjectShell::IsInPrepareClose() const +{ + return pImp->bInPrepareClose; +} + //------------------------------------------------------------------------ struct BoolEnv_Impl diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index faf392c90f32..227099e7d783 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -29,7 +29,6 @@ #include "precompiled_sfx2.hxx" #include <com/sun/star/document/XDocumentProperties.hpp> -#include <com/sun/star/script/vba/XCoreEventProcessor.hpp> #include <com/sun/star/view/PrintableState.hpp> #include "com/sun/star/view/XRenderable.hpp" @@ -699,21 +698,12 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) { SfxObjectShell* pDoc = GetObjectShell(); - // ask VBA emulation at document model whether to print the document - try + // derived class may decide to abort this + if( !pDoc->QuerySlotExecutable( nId ) ) { - uno::Reference< script::vba::XCoreEventProcessor > xEventProcessor( pDoc->GetModel(), uno::UNO_QUERY_THROW ); - xEventProcessor->processCoreVbaEvent( nId ); - } - catch( util::VetoException& ) - { - // VBA event handler indicates to cancel printing the document rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) ); return; } - catch( uno::Exception& ) - { - } bool bDetectHidden = ( !bSilent && pDoc ); if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES ) |