sw/source/filter/ww8/docxattributeoutput.cxx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
New commits: commit 661b597daf9e04d64feb9fbb1610aa5189167813 Author: Noel Grandin <[email protected]> AuthorDate: Tue Oct 28 21:22:31 2025 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Wed Oct 29 17:17:11 2025 +0100 mso-test: emit w:cnfStyle in correct order in document.xml When loading and then saving the document from forum-mso-en-18503.docx, we end up with incorrect ordering of w:cnfStyle under w:tcPr in document.xml INFO - Validating part "/word/document.xml" using schema "29500T/wml.xsd" ... ERROR - (word/document.xml:2 col:4 548) cvc-complex-type.2.4.a: Invalid content was found starting with element 'w:cnfStyle'. Change-Id: Ib4aa3b47be3060b6a9c3e69dee7aadd29072f983 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193120 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 21f4e86a33ac..756ac14a9064 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4761,6 +4761,17 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point // Output any table cell redlines if there are any attached to this specific cell TableCellRedline( pTableTextNodeInfoInner ); + if (const SfxGrabBagItem* pItem = pTableBox->GetFrameFormat()->GetAttrSet().GetItem<SfxGrabBagItem>(RES_FRMATR_GRABBAG)) + { + const std::map<OUString, uno::Any>& rGrabBag = pItem->GetGrabBag(); + std::map<OUString, uno::Any>::const_iterator it = rGrabBag.find(u"CellCnfStyle"_ustr); + if (it != rGrabBag.end()) + { + uno::Sequence<beans::PropertyValue> aAttributes = it->second.get< uno::Sequence<beans::PropertyValue> >(); + m_pTableStyleExport->CnfStyle(aAttributes); + } + } + // Cell preferred width SwTwips nWidth = GetGridCols( pTableTextNodeInfoInner )->at( nCell ); if ( nCell ) @@ -4799,18 +4810,6 @@ void DocxAttributeOutput::TableCellProperties( ww8::WW8TableNodeInfoInner::Point m_pSerializer->singleElementNS(XML_w, XML_vMerge, FSNS(XML_w, XML_val), "continue"); } - if (const SfxGrabBagItem* pItem = pTableBox->GetFrameFormat()->GetAttrSet().GetItem<SfxGrabBagItem>(RES_FRMATR_GRABBAG)) - { - const std::map<OUString, uno::Any>& rGrabBag = pItem->GetGrabBag(); - std::map<OUString, uno::Any>::const_iterator it = rGrabBag.find(u"CellCnfStyle"_ustr); - if (it != rGrabBag.end()) - { - uno::Sequence<beans::PropertyValue> aAttributes = it->second.get< uno::Sequence<beans::PropertyValue> >(); - m_pTableStyleExport->CnfStyle(aAttributes); - } - } - - const SvxBoxItem& rBox = pTableBox->GetFrameFormat( )->GetBox( ); const SvxBoxItem& rDefaultBox = (*m_TableFirstCells.rbegin())->getTableBox( )->GetFrameFormat( )->GetBox( ); {
