summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/docfile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc/docfile.cxx')
-rw-r--r--sfx2/source/doc/docfile.cxx39
1 files changed, 23 insertions, 16 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 3ca1d1a2d2f9..2e4ac54ba75c 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1721,29 +1721,36 @@ void SfxMedium::TransactedTransferForFS_Impl( const INetURLObject& aSource,
try
{
- if( bOverWrite && ::utl::UCBContentHelper::IsDocument( aDest.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) )
+ OUString aSourceMainURL = aSource.GetMainURL(INetURLObject::DecodeMechanism::NONE);
+ OUString aDestMainURL = aDest.GetMainURL(INetURLObject::DecodeMechanism::NONE);
+ if (comphelper::isFileUrl(aDestMainURL) && osl::File::move(aSourceMainURL, aDestMainURL) == osl::FileBase::E_None)
+ bResult = true;
+ else
{
- if( pImpl->m_aBackupURL.isEmpty() )
- DoInternalBackup_Impl( aOriginalContent );
+ if (bOverWrite && ::utl::UCBContentHelper::IsDocument(aDestMainURL))
+ {
+ if( pImpl->m_aBackupURL.isEmpty() )
+ DoInternalBackup_Impl( aOriginalContent );
- if( !pImpl->m_aBackupURL.isEmpty() )
+ if( !pImpl->m_aBackupURL.isEmpty() )
+ {
+ Reference< XInputStream > aTempInput = aTempCont.openStream();
+ bTransactStarted = true;
+ aOriginalContent.setPropertyValue( "Size", uno::makeAny( (sal_Int64)0 ) );
+ aOriginalContent.writeStream( aTempInput, bOverWrite );
+ bResult = true;
+ }
+ else
+ {
+ pImpl->m_eError = ERRCODE_SFX_CANTCREATEBACKUP;
+ }
+ }
+ else
{
Reference< XInputStream > aTempInput = aTempCont.openStream();
- bTransactStarted = true;
- aOriginalContent.setPropertyValue( "Size", uno::makeAny( (sal_Int64)0 ) );
aOriginalContent.writeStream( aTempInput, bOverWrite );
bResult = true;
}
- else
- {
- pImpl->m_eError = ERRCODE_SFX_CANTCREATEBACKUP;
- }
- }
- else
- {
- Reference< XInputStream > aTempInput = aTempCont.openStream();
- aOriginalContent.writeStream( aTempInput, bOverWrite );
- bResult = true;
}
}
catch ( const css::ucb::CommandAbortedException& )