summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-12-19 16:54:20 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-01-12 09:01:45 +0000
commit936f2b41b553a4bab1c2fb0e080e45ae2c5988ed (patch)
treef75669193799cfa15740950a130f46b45632bf2f /embeddedobj
parent4442e602e9b12be86f8a403230a2c7741c9da373 (diff)
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@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/msole/oleembed.cxx11
1 files changed, 0 insertions, 11 deletions
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index aeb7e5148a35..d9d3ddb34d3c 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();