[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - embeddedobj/source

Michael Stahl mstahl at redhat.com
Tue Jan 12 01:02:09 PST 2016


 embeddedobj/source/msole/oleembed.cxx |   11 -----------
 1 file changed, 11 deletions(-)

New commits:
commit 936f2b41b553a4bab1c2fb0e080e45ae2c5988ed
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sat Dec 19 16:54:20 2015 +0100

    embeddedobj: do not automatically convert alien objects to own
    
    OleEmbeddedObject::changeState() calls TryToConvertToOOo() on non-WNT
    platforms, which appears highly questionable to me, added in commit
    0c3d5fb0ad35ff7fc18917fc86fa58d9312fe3ae.
    
    What this does effectively is load the embedded object, store it as ODF,
    and then load it again as ODF.
    
    For one, it doesn't work in all cases currently.  If changeState() is
    not called from the UI but from some filter code, then no m_xClient may
    be set on the OleEmbeddedObject, hence no m_xClient will be set on the
    new m_xWrappedObject.  Then loading the embedded object will raise
    errors due to missing BaseURL, and storing it will fail in
    SfxObjectShell::SaveTo_Impl().  (It would be possible to solve that by
    copying the "DefaultParentBaseURL" handling code from
    OCommonEmbeddedObject.)
    
    The only reason why the previous code in ShapeExport::WriteOLE2Shape()
    was able to export the object despite the error is that it does not call
    SfxBaseModel functions but directly invokes the export filter, so the
    sfx2 code does not get an opportunity to check its error status.
    
    For another, doing this only on non-WNT platforms is also hazardous.
    
    It's probably better to leave conversion to own formats to an explicit
    UI action, as the OleEmbeddedObject::doVerb(-9) magic currently does,
    where it can hopefully be assumed that the caller at least established
    the client connection first.
    
    Change-Id: Ice3d8f8ceabe81b6e9025957c3eb87de9dbfe61a
    (cherry picked from commit 17662cd7d4e5a201ba85f8236d2f71f544b7931e)
    Reviewed-on: https://gerrit.libreoffice.org/21358
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index aeb7e51..d9d3ddb 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -587,17 +587,6 @@ void SAL_CALL OleEmbeddedObject::changeState( sal_Int32 nNewState )
         }
     }
     else
-#else
-    // if it is possible, the object will be converted to OOo format
-    if ( !m_bTriedConversion )
-    {
-        m_bTriedConversion = true;
-        if ( TryToConvertToOOo() )
-        {
-            changeState( nNewState );
-            return;
-        }
-    }
 #endif
     {
         throw embed::UnreachableStateException();


More information about the Libreoffice-commits mailing list