summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-26 08:57:09 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2019-08-27 14:12:26 +0200
commitee6a2ca536ffdaa7f58eb55edff6f10800e0a74c (patch)
treed47a47d053c8008a97221cdea47168b53f8b67c2
parentforcepoint #28 missing cell on abw import (diff)
downloadcore-ee6a2ca536ffdaa7f58eb55edff6f10800e0a74c.tar.gz
core-ee6a2ca536ffdaa7f58eb55edff6f10800e0a74c.zip
forcepoint #29 detect illegal self series add
Change-Id: I3bba0f942780c54951a3a810c05cc3b56ca18a5e Reviewed-on: https://gerrit.libreoffice.org/51862 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rwxr-xr-xsc/qa/unit/data/xls/pass/forcepoint-selfseriesadd.xlsbin0 -> 17920 bytes
-rw-r--r--sc/source/filter/excel/xichart.cxx5
2 files changed, 5 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/pass/forcepoint-selfseriesadd.xls b/sc/qa/unit/data/xls/pass/forcepoint-selfseriesadd.xls
new file mode 100755
index 000000000000..e5eafd262520
--- /dev/null
+++ b/sc/qa/unit/data/xls/pass/forcepoint-selfseriesadd.xls
Binary files differ
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 09bd891da9c5..adff4074cf62 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -1873,6 +1873,11 @@ void XclImpChSeries::SetDataLabel( const XclImpChTextRef& xLabel )
void XclImpChSeries::AddChildSeries( const XclImpChSeries& rSeries )
{
OSL_ENSURE( !HasParentSeries(), "XclImpChSeries::AddChildSeries - not allowed for child series" );
+ if (&rSeries == this)
+ {
+ SAL_WARN("sc.filter", "self add attempt");
+ return;
+ }
/* In Excel, trend lines and error bars are stored as own series. In Calc,
these are properties of the parent series. This function adds the