This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch odf-devel
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 90fc5aff864fce02f033f3e7e3b40de8b75ab489
Author: Jim Jagielski <[email protected]>
AuthorDate: Thu Oct 29 08:47:05 2026 -0400

    xmloff: skip an OLE frame without link or content in ODF 1.2 strict mode
---
 main/xmloff/source/draw/shapeexport2.cxx | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/main/xmloff/source/draw/shapeexport2.cxx 
b/main/xmloff/source/draw/shapeexport2.cxx
index 7c252d99e4..25f217eeb8 100644
--- a/main/xmloff/source/draw/shapeexport2.cxx
+++ b/main/xmloff/source/draw/shapeexport2.cxx
@@ -1594,6 +1594,18 @@ void XMLShapeExport::ImpExportOLE2Shape(
                sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); 
// #86116#/#92210#
                sal_Bool bExportEmbedded(0 != (mrExport.getExportFlags() & 
EXPORT_EMBEDDED));
                OUString sPersistName;
+               if( mrExport.getDefaultVersion() == SvtSaveOptions::ODFVER_012 
&& !bIsEmptyPresObj && !bExportEmbedded )
+               {
+                       // neither link nor content is invalid in 1.2, and the 
replacement image would only name an empty object
+                       sal_Bool bIsInt = sal_False;
+                       OUString sLinkURL, sObjName;
+                       
xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("IsInternal"))) 
>>= bIsInt;
+                       if( bIsInt )
+                               xPropSet->getPropertyValue( 
OUString::createFromAscii( "LinkURL" ) ) >>= sLinkURL;
+                       
xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("PersistName")))
 >>= sObjName;
+                       if( !sLinkURL.getLength() && !sObjName.getLength() )
+                               return;
+               }
                SvXMLElementExport aElement( mrExport, XML_NAMESPACE_DRAW,
                                                                  XML_FRAME, 
bCreateNewline, sal_True );
 

Reply via email to