[PATCH] test on the return of pOleObject->Close

Julien Nabet (via Code Review) gerrit at gerrit.libreoffice.org
Mon Jan 7 13:18:10 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1567

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/67/1567/1

test on the return of pOleObject->Close

Change-Id: Iee64f6f369e2312d479fa81e7a59fb962ed8d90e
---
M embedserv/source/inprocserv/inprocembobj.cxx
1 file changed, 6 insertions(+), 1 deletion(-)



diff --git a/embedserv/source/inprocserv/inprocembobj.cxx b/embedserv/source/inprocserv/inprocembobj.cxx
index c6bad46..27c28ad 100644
--- a/embedserv/source/inprocserv/inprocembobj.cxx
+++ b/embedserv/source/inprocserv/inprocembobj.cxx
@@ -771,6 +771,7 @@
 //-------------------------------------------------------------------------------
 STDMETHODIMP InprocEmbedDocument_Impl::Close( DWORD dwSaveOption )
 {
+    HRESULT ret = S_OK;
     if ( m_pDefHandler && CheckDefHandler() )
     {
         // no need to close if there is no default handler.
@@ -781,14 +782,18 @@
         if ( SUCCEEDED( hr ) && pOleObject )
         {
             hr = pOleObject->Close( dwSaveOption );
+            if (!SUCCEEDED(hr))
+               ret = hr;
             hr = CoDisconnectObject( (IUnknown*)(IPersistStorage*)this, 0 );
+            if (!(SUCCEEDED(hr) && SUCCEEDED(ret)))
+               ret = hr;
         }
     }
 
     // if the object is closed from outside that means that it should go to uninitialized state
     Clean();
 
-    return S_OK;
+    return ret;
 }
 
 //-------------------------------------------------------------------------------

-- 
To view, visit https://gerrit.libreoffice.org/1567
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee64f6f369e2312d479fa81e7a59fb962ed8d90e
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Julien Nabet <serval2412 at yahoo.fr>



More information about the LibreOffice mailing list