summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2005-11-11 08:06:33 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2005-11-11 08:06:33 +0000
commit4f2782f07b99b68e872b85444e74af332d934bb2 (patch)
tree2b228e9425474e258b46b7da2a2f74dce9f086de /sfx2
parent779f37e69529f5c0f73bbb237365eaed7bc2111e (diff)
INTEGRATION: CWS perform06 (1.101.6); FILE MERGED
2005/10/27 12:54:16 mav 1.101.6.1: #120150# the temporary file from crashrecovery is not owned by document
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx35
1 files changed, 28 insertions, 7 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 408f79f2e071..bbe99eb496e9 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sfxbasemodel.cxx,v $
*
- * $Revision: 1.102 $
+ * $Revision: 1.103 $
*
- * last change: $Author: kz $ $Date: 2005-11-03 12:06:00 $
+ * last change: $Author: rt $ $Date: 2005-11-11 09:06:33 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -2360,6 +2360,32 @@ void SAL_CALL SfxBaseModel::load( const SEQUENCE< PROPERTYVALUE >& seqArgument
throw ILLEGALARGUMENTIOEXCEPTION();
}
+ sal_Bool bSalvage = sal_False;
+ SFX_ITEMSET_ARG( pParams, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False );
+ if( pSalvageItem )
+ {
+ bSalvage = sal_True;
+ if ( pSalvageItem->GetValue().Len() )
+ {
+ // if an URL is provided in SalvageItem that means that the FileName refers to a temporary file
+ // that must be copied here
+
+ SFX_ITEMSET_ARG( pParams, pFileNameItem, SfxStringItem, SID_FILE_NAME, FALSE );
+ ::rtl::OUString aNewTempFileURL = SfxMedium::CreateTempCopyWithExt( pFileNameItem->GetValue() );
+ if ( aNewTempFileURL.getLength() )
+ {
+ pParams->Put( SfxStringItem( SID_FILE_NAME, aNewTempFileURL ) );
+ pParams->ClearItem( SID_INPUTSTREAM );
+ pParams->ClearItem( SID_STREAM );
+ pParams->ClearItem( SID_CONTENT );
+ }
+ else
+ {
+ OSL_ENSURE( sal_False, "Can not create a new temporary file for crash recovery!\n" );
+ }
+ }
+ }
+
BOOL bReadOnly = FALSE;
SFX_ITEMSET_ARG( pParams, pReadOnlyItem, SfxBoolItem, SID_DOC_READONLY, FALSE );
if ( pReadOnlyItem && pReadOnlyItem->GetValue() )
@@ -2433,11 +2459,6 @@ void SAL_CALL SfxBaseModel::load( const SEQUENCE< PROPERTYVALUE >& seqArgument
if ( !nError )
{
- BOOL bSalvage = FALSE;
- SFX_ITEMSET_ARG( pParams, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False );
- if( pSalvageItem )
- bSalvage = TRUE;
-
if( bTemplate )
{
//TODO/LATER: make sure that templates always are XML docs!