diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-10-21 17:53:07 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-10-22 09:38:19 +0200 |
commit | fc872146845e4d77ff404d0929f28abf2d3a1c51 (patch) | |
tree | 96803522a9404360df0b731993dd9a7d9d0e1403 /writerfilter/source/rtftok | |
parent | b6fb3551d890f0ccbb88eb7ab81c83f9a2b1694c (diff) |
tdf#137085 writerfilter: RTF import: \trpaddfl and \trpaddl are row...
...properties, not cell properties.
What is supposed to happen here, afaict:
1. \trpaddfr3 either has an effect on the left margin too (despite being
defined for right), or \trpaddfl3 is the default, 0 is not the
default
2. \trgaph600 should be ignored if the \trpaddfl3 is in effect
3. \trpaddl0 should be in effect, overriding both the value from
\trgaph600 and the built-in default of #define DEF_BORDER_DIST 190
CellMarginHandler::lcl_sprm() needs to distinguish between \trpaddfl0
and \trpaddfl3 cases, but its not possible currently because a)
\trpaddfl is processed after \trgaph/\trpaddl, and b) both \trgaph and
\trpaddl produce the same srpm-id.
This fixes \trpaddl handling just enough to import the bugdoc properly,
for more fixing a new sprm-id for \trgaph would be needed at least.
At the other end, there is a line in DomainMapperTableHandler.cxx:
m_aTableProperties->getValue( TablePropertyMap::GAP_HALF, nGapHalf )
... but nothing that would initialize the GAP_HALF there.
That this bugdoc looked right before commit
c2a5346b19c57f93f210b76c15cdba64f6871203 appears to be entirely
accidental.
Change-Id: I80dc34bdd5dadb7d7d7f5ec595907035d621a656
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104638
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'writerfilter/source/rtftok')
-rw-r--r-- | writerfilter/source/rtftok/rtfdispatchvalue.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx index d6b0fc79b21a..b43e85a2352a 100644 --- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx +++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx @@ -624,6 +624,11 @@ bool RTFDocumentImpl::dispatchTableValue(RTFKeyword nKeyword, int nParam) default: break; } + putNestedAttribute(m_aStates.top().getTableRowSprms(), + NS_ooxml::LN_CT_TblPrBase_tblCellMar, nSprm, + new RTFValue(aAttributes)); + // tdf#74795 also set on current cell, and as default for table cells + // (why isn't this done by domainmapper?) putNestedAttribute(m_aStates.top().getTableCellSprms(), NS_ooxml::LN_CT_TcPrBase_tcMar, nSprm, new RTFValue(aAttributes)); putNestedAttribute(m_aDefaultState.getTableCellSprms(), NS_ooxml::LN_CT_TcPrBase_tcMar, @@ -655,6 +660,10 @@ bool RTFDocumentImpl::dispatchTableValue(RTFKeyword nKeyword, int nParam) default: break; } + putNestedSprm(m_aStates.top().getTableRowSprms(), NS_ooxml::LN_CT_TblPrBase_tblCellMar, + nSprm, new RTFValue(aAttributes)); + // tdf#74795 also set on current cell, and as default for table cells + // (why isn't this done by domainmapper?) putNestedSprm(m_aStates.top().getTableCellSprms(), NS_ooxml::LN_CT_TcPrBase_tcMar, nSprm, new RTFValue(aAttributes)); putNestedSprm(m_aDefaultState.getTableCellSprms(), NS_ooxml::LN_CT_TcPrBase_tcMar, @@ -670,6 +679,7 @@ bool RTFDocumentImpl::dispatchTableValue(RTFKeyword nKeyword, int nParam) aAttributes.set(NS_ooxml::LN_CT_TblWidth_type, new RTFValue(NS_ooxml::LN_Value_ST_TblWidth_dxa)); aAttributes.set(NS_ooxml::LN_CT_TblWidth_w, pIntValue); + // FIXME: this is wrong, it is half-gap, needs to be distinguished from margin! depending on TRPADDFL/TRPADDFR putNestedSprm(m_aStates.top().getTableRowSprms(), NS_ooxml::LN_CT_TblPrBase_tblCellMar, NS_ooxml::LN_CT_TblCellMar_left, new RTFValue(aAttributes)); |