Bug 45522: Crash when copying table between Writer and other LibreOffice programs

Dézsi Szabolcs dezsiszabi at hotmail.com
Thu Mar 8 08:23:59 PST 2012



There's an attached odt file with a table in it. Copying the table to other LO programs (Calc, etc) causes LO to crash.
After inspection I realized that the problem is in sw/source/core/table/swtable.cxx
There is a struct definition in that file SwTableCellInfo::Impl with a void setTable(const SwTable * pTable) method.

Error is in if (m_pTabFrm->IsFollow()) line.
m_pTabFrm = SwIterator<SwTabFrm,SwFmt>::FirstElement(*pFrmFmt);
Problem is that SwIterator<SwTabFrm,SwFmt>::FirstElement(*pFrmFmt); can return with NULL, so asking for ->IsFollow() can cause errors.

After adding a check ( if ( m_pTabFrm ) ), crash is gone, although copying the table is still buggy. In the pasted table the whole layout is gone. All the data are in the first column in Calc and only the upper part of the table is copied in Draw and Impress.
If I copy the table without the cell containing 'Wind Class', than it's ok, so that cell somehow ruins the copy mechanism.

Someone has any idea why?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120308/c3bf65ab/attachment.html>

More information about the LibreOffice mailing list