[Libreoffice-commits] core.git: sfx2/source

Vasily Melenchuk vasily.melenchuk at cib.de
Fri Jul 17 07:51:57 PDT 2015


 sfx2/source/doc/docfile.cxx |   61 ++++++++++++++++++++------------------------
 1 file changed, 29 insertions(+), 32 deletions(-)

New commits:
commit c8cd629132f5b4d879edc53911a4e4abeb8d90aa
Author: Vasily Melenchuk <vasily.melenchuk at cib.de>
Date:   Wed Jul 15 18:49:51 2015 +0200

    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 at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index d89235a..49e7a47 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;
         }
     }
 


More information about the Libreoffice-commits mailing list