diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-08-03 11:54:45 +0200 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-08-03 11:54:45 +0200 |
commit | 4f34a68605ccc9219a7e93c32ef5e89ed23dd598 (patch) | |
tree | 95f024537c5493f2fc76462aab8908116b740b9f /sfx2 | |
parent | e9d1cdf5019a70a17952168410d37e2d5dc33299 (diff) | |
parent | ad7fbe5ff52f49fca835d7100e1b892b5a362c40 (diff) |
CWS-TOOLING: integrate CWS mib17
Diffstat (limited to 'sfx2')
-rw-r--r--[-rwxr-xr-x] | sfx2/inc/sfx2/objsh.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 7 | ||||
-rw-r--r--[-rwxr-xr-x] | sfx2/source/doc/objxtor.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 8 |
5 files changed, 34 insertions, 1 deletions
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 63eb9e8c876f..9473ac126bd7 100755..100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -293,6 +293,7 @@ public: sal_Bool IsReadOnlyUI() const; void SetNoName(); sal_Bool IsInModalMode() const; + sal_Bool IsInPrepareClose() const; //<!--Added by PengYunQuan for Validity Cell Range Picker virtual sal_Bool AcceptStateUpdate() const; //-->Added by PengYunQuan for Validity Cell Range Picker @@ -346,6 +347,9 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); virtual void UpdateLinks(); + // called for a few slots like SID_SAVE[AS]DOC, SID_PRINTDOC[DIRECT], derived classes may abort the action + virtual sal_Bool QuerySlotExecutable( USHORT nSlotId ); + sal_Bool SaveChildren(BOOL bObjectsOnly=FALSE); sal_Bool SaveAsChildren( SfxMedium &rMedium ); sal_Bool SwitchChildrenPersistance( diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index c063546da1c7..066f366b09bd 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -489,6 +489,13 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) case SID_SAVEASDOC: case SID_SAVEDOC: { + // derived class may decide to abort this + if( !QuerySlotExecutable( nId ) ) + { + rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) ); + return; + } + //!! detaillierte Auswertung eines Fehlercodes SfxObjectShellRef xLock( this ); @@ -895,7 +902,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) rReq.Done(); } -//-------------------------------------------------------------------- +//------------------------------------------------------------------------- void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) { diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 49188defc4f1..6c4bdf56ba26 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 f202266dd74e..b7567b89f02f 100755..100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -526,6 +526,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 5b317e4b770b..4ed0173be8e1 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -700,6 +700,14 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) case SID_PRINTDOCDIRECT: { SfxObjectShell* pDoc = GetObjectShell(); + + // derived class may decide to abort this + if( !pDoc->QuerySlotExecutable( nId ) ) + { + rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) ); + return; + } + bool bDetectHidden = ( !bSilent && pDoc ); if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES ) break; |