sc/source/filter/xml/XMLExportDataPilot.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 79d13cbd68421df1d4938525e46600ae42642cab
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Jun 23 11:26:03 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Jun 24 09:44:23 2022 +0200

    crashtesting: forum-mso-en-13233.xlsx exports duplicate grouped-by 
attributes
    
    there is a warning that "there should be no NumGroup and Group at the
    same field", here just prefer Group to Numgroup if both are present.
    
    Change-Id: If887f865ca2f1e4c6467a6f7d879c15dd55ab244
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136305
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx 
b/sc/source/filter/xml/XMLExportDataPilot.cxx
index 7f0e7b4b4fa8..cd6f26b1135e 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.cxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.cxx
@@ -631,11 +631,12 @@ void ScXMLExportDataPilot::WriteGroupDimElements(const 
ScDPSaveDimension* pDim,
     if (pDimData)
     {
         pGroupDim = pDimData->GetNamedGroupDim(pDim->GetName());
-        WriteGroupDimAttributes(pGroupDim);
         pNumGroupDim = pDimData->GetNumGroupDim(pDim->GetName());
-        WriteNumGroupDim(pNumGroupDim);
-
         OSL_ENSURE((!pGroupDim || !pNumGroupDim), "there should be no NumGroup 
and Group at the same field");
+        if (pGroupDim)
+            WriteGroupDimAttributes(pGroupDim);
+        else if (pNumGroupDim)
+            WriteNumGroupDim(pNumGroupDim);
     }
     if (!(pGroupDim || pNumGroupDim))
         return;

Reply via email to