diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-12-19 16:54:20 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-12-20 00:56:06 +0100 |
commit | 17662cd7d4e5a201ba85f8236d2f71f544b7931e (patch) | |
tree | 56a96a014dfa1984520cd371de56d0188249f6ad /embeddedobj | |
parent | d54624ff7e7f97d8d7e8fd70572348f63b8a3da5 (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
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/msole/oleembed.cxx | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx index 6768940e68ab..bf5d08cc5b4b 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(); |