Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Due to some mismatch between the style in the default exported construct and the default values computed for a cell style, we were creating useless style entries at export. By setting a style index on a worksheet cell entry, our import code would then apply this style to the cell even though that same cell, when exported, had no style whatsoever. Furthermore, we did not process Excel default color properly. In Xlsx file, the color is sometimes set specifically to "FF000000" in the style sheet. However, that color (black) is not applied as a user-defined color in Excel (i.e. it's importance is lower than the color applied by a table[^1]). Instead, a user-defined "black" will be referred to via a theme property[^2]. Since we did not detect this "default color" pattern, we would consider the attribute `rgb=FF000000` as a user-defined color an ultimately set it in the plugin structure at import. This revision detects the "default color" situation and discards the given color to let the library (and specifically the CellPlugin as that issue affects the cell font color in particular) use its own default behaviour. [^1]: To test this out: - Go to Excel and create a sheet on which you put a table. - Apply a style such that the text turns white - On the cells with white text, manually apply an italic format - Import the xlsx file inside o-spreadsheet ==> the text turned black in o-spreadsheet [^2]: This situation seems to only concern that specific color and might encompass a broader scope but I haven't been able to find proper documentation about this. closes #3799 Signed-off-by: Rémi Rahir (rar) <[email protected]>
- Loading branch information