summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2024-02-16 14:11:11 -0500
committerJustin Luth <jluth@mail.com>2024-02-17 03:57:47 +0100
commit5132255021aa61f8a1fa7d8de820cb3528699812 (patch)
tree2de01c8e09c2b6588ecd3f7e5eace82bff8e261e
parent1e1072afa3726266f83d7ef8895ed406580a3450 (diff)
tdf#153761 vml export: avoid corrupt docx: don't write empty r:id
For the benefit of MSO, do not write r:id="", since MSO refuses to open such a document. Change-Id: I21887021c747fc9a9764befc7081e21d99e47545 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163523 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
-rw-r--r--oox/source/export/vmlexport.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 1090b0857f5c..8438befa62af 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -741,8 +741,11 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
Graphic aGraphic;
GraphicConverter::Import(aStream, aGraphic);
OUString aImageId = m_pTextExport->GetDrawingML().writeGraphicToStorage(aGraphic, false);
- pAttrList->add(FSNS(XML_r, XML_id), aImageId);
- imageData = true;
+ if (!aImageId.isEmpty())
+ {
+ pAttrList->add(FSNS(XML_r, XML_id), aImageId);
+ imageData = true;
+ }
}
if (rProps.GetOpt(ESCHER_Prop_fNoFillHitTest, nValue))