Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisplayIfProcessor fixes #132

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

bitblaster
Copy link

I made 2 small fixes for the displayTableRowIf expression.

If such an expression is added after a repeatTableRow expression, the row index of the original file is used when removing the row, resulting in a wrong output (a previous row is removed and the intended row remains).
Example template document:
image

Example result:
image
The reason is that the row index is computed on the original file but the model is altered by the other processors before the DisplayIfProcessor commits its changes. The solution is simply to register the DisplayIfProcessor as the first one, so that the model has still the exact row index as the original file:
image


Another corner case is when the row to be removed with an displayTableRowIf expression has a cell which starts a vertical merge:
image

If we simply remove the row we will also lose the merged cell:
image

The solution is to keep the row but set its height to 0, so that the cell still remains (and spans across the following rows) but the row content is hidden:
image

See the revised ConditionalDisplayOfTableRowsTest.docx for examples covering the 2 issues.

…peat*Processors

fix: displayTableRowIf not working correctly with merged cells
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants