Created attachment 54694 [details]
file showing the bug
In the attached document the column entry Cell1 should be directly below Name.
Word shows this document correctly.
Confirmed - here is my analysis so far:
The problem is that the first row has two columns, while the second has four, but the document contains no merge control words (\clmrg). It seems that Word writes tables like this when the horizontal span of a cell is grather than 1.
The docx version of this document is imported properly, as there the docx has a table with 4 columns and has the proper span declarations, so the number of cols does not differ in the two rows.
Now what we support is different number of cells in rows, but the width of such cells is parsed only in the first row by dmapper. Given this fact, the tokenizer doesn't even send the width of cells in non-first rows, that's what RTFDocumentImpl::m_bFirstRow does. So sending the info that is not shown, but should be shown is a oneliner change in the tokenizer, but then the dmapper part is harder, since docx doesn't need this feature.
BTW, of course it's possible to add heuristics in the tokenizer to reconstruct the spans when it makes sense, but that would mean keeping the whole table in the memory at the tokenizer level. (Right now we keep a row in the memory, but Cedric has plans to remove even that to have nothing table-related buffered at a tokenizer level.)
A2\cell B2\cell C2\cell\row
The bug is that the A2 cell is wider than A1, while they should have the same width.
Fixed in master: http://cgit.freedesktop.org/libreoffice/core/commit/?id=01292f171cc851ba092510f10a97cd293670829e
Cherry-picked to -3-5: http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5&id=4b6f8b09e6823dfb237a4b9ea5c2abc21ccf030a
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":
fdo#44053 fix this again and this time add a testcase as well
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.