Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Example result:
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:
Another corner case is when the row to be removed with an displayTableRowIf expression has a cell which starts a vertical merge:
If we simply remove the row we will also lose the merged cell:
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:
See the revised ConditionalDisplayOfTableRowsTest.docx for examples covering the 2 issues.