[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sfx2/source

Cédric Bosdonnat cedric.bosdonnat at free.fr
Tue Dec 17 02:21:25 PST 2013


 sfx2/source/doc/objserv.cxx      |    5 +++++
 sfx2/source/doc/sfxbasemodel.cxx |   12 +++---------
 2 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit b95f4fad1acc01857cdc83af23506a4bce6c4ccd
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Fri Dec 13 10:36:32 2013 +0100

    Fixed the update to working copy and back after (cancel) checkout: fdo#64533
    
    After Checkout, simply set medium name and update the medium: at least
    we are sure it works in more situations than the other function we used.
    
    After cancel checkout, call SID_RELOAD to actually revert any local
    change.
    
    Change-Id: I3dc296a74726770c4f47d9653c382108f7baccad
    (cherry picked from commit a68e0e334df02c1ca47601575523b23c6db13470)
    Reviewed-on: https://gerrit.libreoffice.org/7068
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index a6f445a..fb29227 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -897,6 +897,11 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
             if (  QueryBox( NULL, SfxResId( RID_QUERY_CANCELCHECKOUT ) ).Execute( ) == RET_YES )
             {
                 CancelCheckOut( );
+
+                // Reload the document as we may still have local changes
+                SfxViewFrame *pFrame = GetFrame();
+                if ( pFrame )
+                    pFrame->GetDispatcher()->Execute(SID_RELOAD);
             }
             break;
         }
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 44f9f92..70e9c3d 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2519,7 +2519,8 @@ void SAL_CALL SfxBaseModel::checkOut(  ) throw ( RuntimeException )
             OUString sURL;
             aResult >>= sURL;
 
-            m_pData->m_pObjectShell->GetMedium( )->SwitchDocumentToFile( sURL );
+            m_pData->m_pObjectShell->GetMedium( )->SetName( sURL );
+            m_pData->m_pObjectShell->GetMedium( )->GetMedium_Impl( );
             m_pData->m_xDocumentProperties->setTitle( getTitle( ) );
             Sequence< beans::PropertyValue > aSequence ;
             TransformItems( SID_OPENDOC, *pMedium->GetItemSet(), aSequence );
@@ -2550,14 +2551,7 @@ void SAL_CALL SfxBaseModel::cancelCheckOut(  ) throw ( RuntimeException )
             OUString sURL;
             aResult >>= sURL;
 
-            m_pData->m_pObjectShell->GetMedium( )->SwitchDocumentToFile( sURL );
-            m_pData->m_xDocumentProperties->setTitle( getTitle( ) );
-            Sequence< beans::PropertyValue > aSequence ;
-            TransformItems( SID_OPENDOC, *pMedium->GetItemSet(), aSequence );
-            attachResource( sURL, aSequence );
-
-            // Reload the CMIS properties
-            loadCmisProperties( );
+            m_pData->m_pObjectShell->GetMedium( )->SetName( sURL );
         }
         catch ( const Exception & e )
         {


More information about the Libreoffice-commits mailing list