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

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

commit 2e1b471dd26be6fbf5139303f32b47d2aebebbca
Author: Jim Jagielski <[email protected]>
AuthorDate: Wed Nov 4 08:28:04 2026 -0500

    xmloff: do not write a style:background-fill that has no draw:fill
    
    (cherry picked from commit b653ec0bd05452872eaa4fd3cde70926337a18b2)
---
 main/xmloff/source/style/xmlexppr.cxx | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/main/xmloff/source/style/xmlexppr.cxx 
b/main/xmloff/source/style/xmlexppr.cxx
index 45e9bd61ca..3988debcd1 100644
--- a/main/xmloff/source/style/xmlexppr.cxx
+++ b/main/xmloff/source/style/xmlexppr.cxx
@@ -115,6 +115,14 @@ static sal_Bool lcl_IsTableCellFill( const UniReference< 
XMLPropertySetMapper >&
                        IsXMLToken( rMapper->GetEntryXMLName( nIdx ), 
XML_REPEAT ) ) );
 }
 
+// style:background-fill requires draw:fill; style:repeat alone (the default 
bitmap mode) is not a fill.
+static void lcl_DropFillWithoutStyle( SvXMLAttributeList& rAttrs, const 
SvXMLNamespaceMap& rNamespaceMap )
+{
+       if( rAttrs.getLength() > 0 &&
+               rAttrs.getValueByName( rNamespaceMap.GetQNameByKey( 
XML_NAMESPACE_DRAW, GetXMLToken( XML_FILL ) ) ).getLength() == 0 )
+               rAttrs.Clear();
+}
+
 static sal_Bool lcl_HasTableCellProperties( const UniReference< 
XMLPropertySetMapper >& rMapper )
 {
        for( sal_Int32 n = 0; n < rMapper->GetEntryCount(); ++n )
@@ -941,6 +949,7 @@ void SvXMLExportPropertyMapper::exportXML(
                                                        
rExport.GetNamespaceMap(),
                                                        nFlags, 0,
                                                        nPropMapStartIdx, 
nPropMapEndIdx );
+                               lcl_DropFillWithoutStyle( *pFillAttrs, 
rExport.GetNamespaceMap() );
                        }
                        else if( aPropTokens[i].eToken == 
XML_HEADER_FOOTER_PROPERTIES && b014 )
                        {
@@ -971,6 +980,7 @@ void SvXMLExportPropertyMapper::exportXML(
                                                                
rExport.GetNamespaceMap(),
                                                                nFlags, 0,
                                                                
nPropMapStartIdx, nPropMapEndIdx );
+                                       lcl_DropFillWithoutStyle( *pFillAttrs, 
rExport.GetNamespaceMap() );
                                }
                        }
 

Reply via email to