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

New commits:
commit 7f0efca2ce1f02b7d9b8af57c6d70078a14f9b5f
Author:     Noel Grandin <[email protected]>
AuthorDate: Mon Oct 27 15:08:39 2025 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Oct 29 18:00:12 2025 +0100

    mso-test: remove path attribute from v:rect shape
    
    when loading and then saving the document from tdf#135569, we add a path 
attribute,
    which is not a valie attribute for a rect element,
    which causes ms-office to think the document is corrupt
    
    Change-Id: I7705fa9d3ed86bc3aa916db4603d40cef35086af
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193038
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index fdb74b2c138a..01c3d578d1eb 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -650,9 +650,13 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, 
const tools::Rectangle&
                                     break;
                             }
                         }
-                        OString pathString = aPath.makeStringAndClear();
-                        if ( !pathString.isEmpty() && pathString != "xe" )
-                            m_pShapeAttrList->add( XML_path, pathString );
+                        // path attribute not valid for v:rect
+                        if ( m_nShapeType != ESCHER_ShpInst_Rectangle )
+                        {
+                            OString pathString = aPath.makeStringAndClear();
+                            if ( !pathString.isEmpty() && pathString != "xe" )
+                                m_pShapeAttrList->add( XML_path, pathString );
+                        }
                     }
                     else
                         SAL_WARN("oox.vml", "unhandled shape path, missing 
either pVertices or pSegmentInfo.");

Reply via email to