diff options
author | Mathias Bauer <mba@openoffice.org> | 2001-07-12 09:29:49 +0000 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2001-07-12 09:29:49 +0000 |
commit | 331956ec16bf34464172f33328ce365631e68b48 (patch) | |
tree | 562932317b3aaa5d7f8f05edfbc9aee5ef487639 | |
parent | 2700d75a8d1467a04afb9f709ac5d0755f8bd8b1 (diff) |
#88062#: some problems with HandsOff
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index e5adb4ef42f4..792c2bc0e02c 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2,9 +2,9 @@ * * $RCSfile: objstor.cxx,v $ * - * $Revision: 1.52 $ + * $Revision: 1.53 $ * - * last change: $Author: dv $ $Date: 2001-07-10 10:38:18 $ + * last change: $Author: mba $ $Date: 2001-07-12 10:29:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -563,6 +563,8 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) { ::rtl::OUString aURL = GetMedium()->GetOrigURL(); SfxItemSet *pSet = GetMedium()->GetItemSet(); + if ( !GetMedium()->IsReadOnly() ) + pSet->ClearItem( SID_INPUTSTREAM ); ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs; TransformItems( SID_OPENDOC, *pSet, aArgs ); xModel->attachResource( aURL, aArgs ); @@ -940,10 +942,6 @@ sal_Bool SfxObjectShell::SaveTo_Impl if ( xNewTempRef.Is() ) // if the new object storage is a temporary one, because the target format is an alien format SaveCompleted( xNewTempRef ); - else if ( !bOk && IsHandsOff() ) - // critical case: avoid "HandsOff" states - // usually the caller doesn't know that this method has set the document into the "HandsOff" state - DoSaveCompleted( &rMedium ); } } @@ -1430,7 +1428,8 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) pMediumTmp->Close(); delete pMediumTmp; - DoHandsOff(); + if ( !IsHandsOff() ) + DoHandsOff(); sal_Bool bOpen = DoSaveCompleted(pMedium); if ( bOpen && aKey.Len() ) pMedium->GetStorage()->SetKey( aKey ); @@ -1451,7 +1450,10 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) SfxContentHelper::Kill( aTmp ); // reconnect to object storage - DoSaveCompleted( (SvStorage*)0 ); + if ( IsHandsOff() ) + DoSaveCompleted( pMedium ); + else + DoSaveCompleted( (SvStorage*)0 ); } SetModified( !bSaved ); @@ -1886,7 +1888,10 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl SetError( pNewFile->GetErrorCode() ); // reconnect to the old storage - DoSaveCompleted( (SvStorage*)0 ); + if ( IsHandsOff() ) + DoSaveCompleted( pMedium ); + else + DoSaveCompleted( (SvStorage*)0 ); } if( !bOk ) |