diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2015-07-15 18:49:51 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2015-07-17 14:51:28 +0000 |
commit | c8cd629132f5b4d879edc53911a4e4abeb8d90aa (patch) | |
tree | a0cb72483043bb19a0359b6ae580ea1ba1b54a16 | |
parent | 406a815642a7b2b34107c49856f3f25ccfd4277d (diff) |
tdf#92758: no more duplication of document in CMIS after checkin
Document now is correctly reloaded after checkin, so no copy of
closed on server private working copy remains.
Change-Id: I1625bda2f960827d60018b0702447b93886043f3
Reviewed-on: https://gerrit.libreoffice.org/17118
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index d89235a8a70e..49e7a474165d 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3640,44 +3640,41 @@ bool SfxMedium::SwitchDocumentToFile( const OUString& aURL ) uno::Reference< embed::XStorage > xStorage = GetStorage(); uno::Reference< embed::XOptimizedStorage > xOptStorage( xStorage, uno::UNO_QUERY ); - if ( xOptStorage.is() ) - { - // TODO/LATER: reuse the pImp->pTempFile if it already exists - CanDisposeStorage_Impl( false ); - Close(); - SetPhysicalName_Impl( OUString() ); - SetName( aURL ); + // TODO/LATER: reuse the pImp->pTempFile if it already exists + CanDisposeStorage_Impl( false ); + Close(); + SetPhysicalName_Impl( OUString() ); + SetName( aURL ); - // open the temporary file based document - GetMedium_Impl(); - LockOrigFileOnDemand( false, false ); - CreateTempFile( true ); - GetMedium_Impl(); + // open the temporary file based document + GetMedium_Impl(); + LockOrigFileOnDemand( false, false ); + CreateTempFile( true ); + GetMedium_Impl(); - if ( pImp->xStream.is() ) + if ( pImp->xStream.is() ) + { + try { - try - { - uno::Reference< io::XTruncate > xTruncate( pImp->xStream, uno::UNO_QUERY_THROW ); - if ( xTruncate.is() ) - xTruncate->truncate(); - + uno::Reference< io::XTruncate > xTruncate( pImp->xStream, uno::UNO_QUERY_THROW ); + if ( xTruncate.is() ) + xTruncate->truncate(); + if ( xOptStorage.is() ) xOptStorage->writeAndAttachToStream( pImp->xStream ); - pImp->xStorage = xStorage; - bResult = true; - } - catch( const uno::Exception& ) - {} - } - - if ( !bResult ) - { - Close(); - SetPhysicalName_Impl( OUString() ); - SetName( aOrigURL ); - GetMedium_Impl(); pImp->xStorage = xStorage; + bResult = true; } + catch( const uno::Exception& ) + {} + } + + if ( !bResult ) + { + Close(); + SetPhysicalName_Impl( OUString() ); + SetName( aOrigURL ); + GetMedium_Impl(); + pImp->xStorage = xStorage; } } |