Fix for the "index out of bounds" exception while reading styles

There was a bug introduced in version 1.2 in reading styles. As from the Office Open XML documentation:
Every cell will have a reference to one <xf> in the <cellXfs> collection. This is direct formatting for the cell. To apply a style to the cell, the <xf> references the style using the xfId attribute. The xfId attribute is an index into the <cellStyleXFs> collection, which collects the cell styles available to the user. The <cellStyleXFs> contains one <xf> for each style. Each such <xf> is tied to its name via an index (in its xfId attribute) from the <cellStyles> collection. 
Existing implementation simply tried to fetch a style name by using index in the styles vector causing an index_out_of_range exception for each xfId that was ot of bounds of cellStyles collection. What was needed is to match the xfId attribute of the cellStyle element.
This commit is contained in:
TataMata 2017-11-06 12:00:51 +01:00 committed by GitHub
parent b899c9db5c
commit 6b668fd04e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

Diff Content Not Available