diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-05-09 10:55:39 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-05-10 19:14:52 +0000 |
commit | 930c8d14c554428e5b75a9c43d7ed349f742e1a8 (patch) | |
tree | 527af24843abd0d0c806247b6960a78117eb72d3 /lotuswordpro | |
parent | 23491789f77af6cec8f82d89cb82160b0a002614 (diff) |
fftester: subtable is a subtable of itself
Change-Id: I9de983e3c9436ab3a37d3482b0f18f04c7cdaaca
(cherry picked from commit b18d49e09a66b9ad29e1c75796ebbf75d407c8d5)
Reviewed-on: https://gerrit.libreoffice.org/24791
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/qa/cppunit/data/fail/recurse-3.lwp | bin | 0 -> 56354 bytes | |||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfcell.hxx | 2 | ||||
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xftable.cxx | 7 |
3 files changed, 9 insertions, 0 deletions
diff --git a/lotuswordpro/qa/cppunit/data/fail/recurse-3.lwp b/lotuswordpro/qa/cppunit/data/fail/recurse-3.lwp Binary files differnew file mode 100644 index 000000000000..acb8c93cedaf --- /dev/null +++ b/lotuswordpro/qa/cppunit/data/fail/recurse-3.lwp diff --git a/lotuswordpro/source/filter/xfilter/xfcell.hxx b/lotuswordpro/source/filter/xfilter/xfcell.hxx index 001855e040e9..5d7b0c9999eb 100644 --- a/lotuswordpro/source/filter/xfilter/xfcell.hxx +++ b/lotuswordpro/source/filter/xfilter/xfcell.hxx @@ -141,6 +141,8 @@ public: */ virtual void ToXml(IXFStream *pStrm) override; + const XFTable* GetSubTable() const { return m_pSubTable; } + private: XFRow *m_pOwnerRow; XFTable *m_pSubTable; diff --git a/lotuswordpro/source/filter/xfilter/xftable.cxx b/lotuswordpro/source/filter/xfilter/xftable.cxx index d139a85130c6..dadb43467210 100644 --- a/lotuswordpro/source/filter/xfilter/xftable.cxx +++ b/lotuswordpro/source/filter/xfilter/xftable.cxx @@ -91,6 +91,13 @@ void XFTable::AddRow(XFRow *pRow) { assert(pRow); + for (sal_Int32 i = 0; i < pRow->GetCellCount(); ++i) + { + XFCell* pFirstCell = pRow->GetCell(i + 1); //starts at 1, not 0 + if (pFirstCell->GetSubTable() == this) + throw std::runtime_error("table is a subtable of itself"); + } + int row = pRow->GetRow(); if( row<1 ) |