diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2020-10-09 10:20:49 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-10-13 13:52:49 +0200 |
commit | a41cf57c1eb4cabe5afc1a45d6fe535dbb935217 (patch) | |
tree | 08d184ba44054c83fc440ea47078ec4b2af08f96 /comphelper | |
parent | 51f807841a9242eec85172c6503083294c0c0042 (diff) |
tdf#134987 convert DOCX to ODT: fix lost charts
Embedded charts of DOCX documents were lost or replaced
by images during conversion to native ODT format,
resulted by bad handling of XEmbedPersist objects in
EmbeddedObjectContainer.
Note: Add missing loext:external-data to ODF 1.3 schema
definition to fix ODF validation error in gerrit.
See commit 2054af83fefb955e20de2b40178a11726525057e
(fdo#72520 : Added property to store external data path in chart)
and commit a49a9dab3168c03a539adc131f2ade03236edb69
(fix one more ODF validation error).
Change-Id: I9edff9af3a79370ea447ffc6078da3520d0c6f63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104104
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/container/embeddedobjectcontainer.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index 944a4dd5b25f..faed14065082 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -931,6 +931,14 @@ bool EmbeddedObjectContainer::RemoveEmbeddedObject( const uno::Reference < embed } OUString aTempName, aMediaType; + /* Do not create a new name for a removed object, in the pImpl->mpTempObjectContainer, + because the original m_aEntryName of xObj will be overwritten by InsertEmbeddedObject(), + so uno::Reference < embed::XEmbeddedObject >& xObj will misbehave in + EmbeddedObjectContainer::StoreAsChildren and SfxObjectShell::SaveCompletedChildren + and will throw an exception because of objects with the same names! */ + if( !pImpl->mpTempObjectContainer->HasEmbeddedObject(aName) ) + aTempName = aName; + pImpl->mpTempObjectContainer->InsertEmbeddedObject( xObj, aTempName ); uno::Reference < io::XInputStream > xStream = GetGraphicStream( xObj, &aMediaType ); |