oox/source/export/vmlexport.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 5132255021aa61f8a1fa7d8de820cb3528699812
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Fri Feb 16 14:11:11 2024 -0500
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Sat Feb 17 03:57:47 2024 +0100

    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 <jl...@mail.com>

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))

Reply via email to