From 6b668fd04eab12d087a919a4e1f27e7b250b9ced Mon Sep 17 00:00:00 2001 From: TataMata Date: Mon, 6 Nov 2017 12:00:51 +0100 Subject: [PATCH] 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 in the collection. This is direct formatting for the cell. To apply a style to the cell, the references the style using the xfId attribute. The xfId attribute is an index into the collection, which collects the cell styles available to the user. The contains one for each style. Each such is tied to its name via an index (in its xfId attribute) from the 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.