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>
diff --git a/lotuswordpro/qa/cppunit/data/fail/recurse-3.lwp b/lotuswordpro/qa/cppunit/data/fail/recurse-3.lwp
new file mode 100644
index 0000000..acb8c93
--- /dev/null
+++ b/lotuswordpro/qa/cppunit/data/fail/recurse-3.lwp
Binary files differ
diff --git a/lotuswordpro/source/filter/xfilter/xfcell.hxx b/lotuswordpro/source/filter/xfilter/xfcell.hxx
index 001855e..5d7b0c9 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 d139a85..dadb434 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 )