OpenXML: make char constraints work when translating in-place
The dynamic sizing constraints improvement to XLSX handling had another issue: it didn't work correctly if you were translating in-place.
If you did something like:
worksheetConfigurations.0.namePattern=.*?
worksheetConfigurations.0.sourceColumns=A
worksheetConfigurations.0.targetColumns=
worksheetConfigurations.0.targetColumnsMaxCharacters=Bthe filter would extract the source from column A, but not apply the constraint from column B. If, instead, you tried:
worksheetConfigurations.0.namePattern=.*?
worksheetConfigurations.0.sourceColumns=A
worksheetConfigurations.0.targetColumns=A
worksheetConfigurations.0.targetColumnsMaxCharacters=Bthis would extract nothing at all, due to pre-existing behavior that if target column is specified, we expect it to != the source column.
In this process of fixing this, we discovered another issue: the target constraints only affected columns that appeared after the constraint.
To fix this, the PR contains two changes:
- The main fix - if no
targetColumnsare specified, apply any constraints tosourceColumns. (This also works if there are multiple source columns/constraints, as you would expect. - Make the ordering independent by pre-scanning the row and applying constraints.