diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-05-09 10:55:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-05-09 11:00:43 +0100 |
commit | b18d49e09a66b9ad29e1c75796ebbf75d407c8d5 (patch) | |
tree | 4d3e5743a8a7c161d37421fa48c104f89eb1f095 /lotuswordpro | |
parent | 50ac0f503b763d08aef4a193c38e64b70220bfba (diff) |
fftester: subtable is a subtable of itself
Change-Id: I9de983e3c9436ab3a37d3482b0f18f04c7cdaaca
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 ) |