oox/source/drawingml/chart/typegroupcontext.cxx |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 6161105b910df75bd60f23c0f7ed7924eca84376
Author:     Kurt Nordback <kurt.nordb...@collabora.com>
AuthorDate: Mon Jun 30 11:14:18 2025 -0600
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jul 2 10:20:51 2025 +0200

    tdf#165742 Step 4.4 follow-on: Fix a faulty assert
    
    In the earlier changes I introduced an assert that didn't properly consider
    a chart with multiple series. This is intended to fix that.
    
    Change-Id: I60f097ffae2e7f29aadc5bfaabc739c120be5fcd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187216
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit 5427624c78f879ae83b5db1f5a0f67d3b4d04e2d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187223
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx 
b/oox/source/drawingml/chart/typegroupcontext.cxx
index 779409983374..f29b42ab42bf 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -419,9 +419,21 @@ ContextHandlerRef 
ChartexTypeGroupContext::onCreateContext( [[maybe_unused]] sal
             return nullptr;
         case CX_TOKEN(series) :
             if (rAttribs.hasAttribute(XML_layoutId)) {
-                // The type ID is currently set to <cx:plotAreaRegion>. Set it
+                // If this is the first series, then the type ID is currently
+                // set to <cx:plotAreaRegion>. If this is not the first series
+                // in a multi-series chart, it should be set to the previous
+                // chart type in the series (which *should* only be another
+                // chartex type, not a <c> type). In either case, set it
                 // to the specific chart type based on the layoutId attribute
-                assert(mrModel.mnTypeId == CX_TOKEN(plotAreaRegion));
+                assert(mrModel.mnTypeId == CX_TOKEN(plotAreaRegion) ||
+                        mrModel.mnTypeId == CX_TOKEN(boxWhisker) ||
+                        mrModel.mnTypeId == CX_TOKEN(clusteredColumn) ||
+                        mrModel.mnTypeId == CX_TOKEN(funnel) ||
+                        mrModel.mnTypeId == CX_TOKEN(paretoLine) ||
+                        mrModel.mnTypeId == CX_TOKEN(regionMap) ||
+                        mrModel.mnTypeId == CX_TOKEN(sunburst) ||
+                        mrModel.mnTypeId == CX_TOKEN(treemap) ||
+                        mrModel.mnTypeId == CX_TOKEN(waterfall));
                 OUString sChartId = rAttribs.getStringDefaulted(XML_layoutId);
                 assert(!sChartId.isEmpty());
 

Reply via email to