summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-26 08:57:09 +0100
committerAndras Timar <andras.timar@collabora.com>2018-04-07 17:46:41 +0200
commite181212ead9d7acbfc48c852985af194e6d4496a (patch)
treeceb40f4f05a375f56ec34576c83fbc9880355778
parent858125f6a606ae515f9c2c68b8736b4bd1b2dfd3 (diff)
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> (cherry picked from commit a471620af5099c960e22b46fad6e6f92a5055dbd)
-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 1dcde34ff7ff..6358cfa53a43 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -1867,6 +1867,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