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 67a7f100a15a4b1bebee45216726ca9b69f6a5e3 Author: Jim Jagielski <[email protected]> AuthorDate: Wed Oct 28 08:17:04 2026 -0400 sc: valid pivot table export (level order, empty condition range, source-field-name) --- main/sc/source/filter/xml/XMLExportDataPilot.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main/sc/source/filter/xml/XMLExportDataPilot.cxx b/main/sc/source/filter/xml/XMLExportDataPilot.cxx index 72b8d047a0..81bb06aa48 100644 --- a/main/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/main/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -191,7 +191,8 @@ void ScXMLExportDataPilot::WriteDPFilter(const ScQueryParam& aQueryParam) aQueryParam.nCol2, aQueryParam.nRow2, aQueryParam.nTab); rtl::OUString sConditionRange; ScRangeStringConverter::GetStringFromRange( sConditionRange, aConditionRange, pDoc, ::formula::FormulaGrammar::CONV_OOO ); - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CONDITION_SOURCE_RANGE_ADDRESS, sConditionRange); + if (sConditionRange.getLength()) + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_CONDITION_SOURCE_RANGE_ADDRESS, sConditionRange); } if (!aQueryParam.bDuplicate) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_DUPLICATES, XML_FALSE); @@ -627,6 +628,8 @@ void ScXMLExportDataPilot::WriteNumGroupDim(const ScDPSaveNumGroupDimension* pNu if (pNumGroupDim) { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_IS_GROUP_FIELD, XML_TRUE); + // required by the schema; empty marks a numeric or date group + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, rtl::OUString()); if (pNumGroupDim->GetDatePart()) { WriteDatePart(pNumGroupDim->GetDatePart()); @@ -716,8 +719,8 @@ void ScXMLExportDataPilot::WriteDimension(ScDPSaveDimension* pDim, const ScDPDim rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_FUNCTION, sValueStr); SvXMLElementExport aElemDPF(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_FIELD, sal_True, sal_True); - WriteFieldReference(pDim); WriteLevels(pDim); + WriteFieldReference(pDim); if( pDim->GetOrientation() != sheet::DataPilotFieldOrientation_DATA ) WriteGroupDimElements(pDim, pDimData); }
