Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Created Unassigned: Multiple TextRuns in Cell [15382]

$
0
0
When multiple textruns exist in a single cell, the loop in LoadCells() is broken, causing the rest of the <sheetData> to not be read. The applicable code is in ExcelWorksheet.cs, line 1280:

```
else if (xr.LocalName == "is") //Inline string
{
xr.Read();
if (xr.LocalName == "t")
{
_values.SetValue(address._fromRow, address._fromCol, ConvertUtil.ExcelDecodeString(xr.ReadElementContentAsString()));
//cell._value = xr.ReadInnerXml();
}
else
{
_values.SetValue(address._fromRow, address._fromCol, xr.ReadOuterXml()); // <-- this line
_types.SetValue(address._fromRow, address._fromCol, "rt");
_flags.SetFlagValue(address._fromRow, address._fromCol, true, CellFlags.RichText);
//cell.IsRichText = true;
}
}
else
{
break;
}
```

Example XML:

```
<is>
<r>
<rPr><b val="0"></b><i val="0"></i><strike val="0"></strike><sz val="9.99937011841774"></sz><color theme="1"></color><rFont val="Calibri"></rFont></rPr>
<t xml:space="preserve"> </t>
</r>
<r>
<rPr><b val="0"></b><i val="0"></i><strike val="0"></strike><u val="none"></u><sz val="8"></sz><color rgb="FF000000"></color><rFont val="Arial"></rFont></rPr>
<t xml:space="preserve">Shifra Gitelman; Meital Sari Azrieli; Moses Azriel; Asaf Azriel </t>
</r>
<r>
<rPr><b val="0"></b><i val="0"></i><strike val="0"></strike><sz val="9.99937011841774"></sz><color theme="1"></color><rFont val="Calibri"></rFont></rPr>
<t xml:space="preserve"> </t>
</r>
</is>
```

The code will read the first <r> element using xr.ReadOuterXml(), leaving the next textrun in queue. This causes the next iteration of the loop to break at line 1287.

Viewing all articles
Browse latest Browse all 2262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>