summaryrefslogtreecommitdiff
path: root/sc
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-12 10:54:29 +0200
commitc9ab49f0eff4005bf273057b9f6b4e3f8099acdb (patch)
treee3ce36c08062217b46923d7d7ed387da80c186b7 /sc
parent39157cabb552f0a79dc6cb723367eb4dba5f0dde (diff)
forcepoint #29 detect illegal self series add
Change-Id: I3bba0f942780c54951a3a810c05cc3b56ca18a5e Reviewed-on: https://gerrit.libreoffice.org/51861 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 06af4f16ec1a6bfc93d5f22dba073a1f7093df8d)
Diffstat (limited to 'sc')
-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 4243fd08221e..5cef222d07ce 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -1872,6 +1872,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