summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-07-09 11:29:33 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-07-09 12:58:55 +0200
commitf6a00c88482ec30b61855cb6a95a5ad240b7a517 (patch)
tree7748ecd8e3e6b3bc0cf7119ad7231433aa44aa68 /writerfilter
parent2b62198dfcfd3fe738382207235a68cdc9b40d30 (diff)
fdo#66565 RTF import: don't produce cell widths smaller than MINLAY
In case we have a table of a given width and the second (or later) row has fewer cells, we have to add a fake cell to such a row. However, it doesn't make sense to do this when the difference is only a few twips: we can't create such a small frame inside the cell later anyway. Regression from c3b0f13546b30e5db3aecd311c7178e4e0933208. Change-Id: Ibc0f02d4184b58bd423c3405e786e1ec25b9dd13
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 1cd2ad2d9b88..38dd6dc1c6bb 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1830,8 +1830,9 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
case RTF_ROW:
case RTF_NESTROW:
{
- // If the right edge of the last cell (row width) is smaller than the width of some other row, mimic the WW8 import: add a fake cell.
- if (nKeyword == RTF_ROW && m_aStates.top().nCellX < m_nCellxMax)
+ // If the right edge of the last cell (row width) is smaller than the width of some other row, mimic WW8TabDesc::CalcDefaults(): add a fake cell.
+ const int MINLAY = 23; // sw/inc/swtypes.hxx, minimal possible size of frames.
+ if (nKeyword == RTF_ROW && (m_nCellxMax - m_aStates.top().nCellX) >= MINLAY)
dispatchValue(RTF_CELLX, m_nCellxMax);
if (m_aStates.top().nCells)