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

Created Unassigned: Modyfying the comments collection causes document corruption [15190]

$
0
0
There is a bug with reusing the memory stream on save when the comments collection is modified. If the new comment xml byte stream is shorter than what was previously read, the old content will spill over ( Part.GetStream() sets the existing stream to position 0). In most cases the result is an invalid xml causing Excel to throw "Excel found unreadable content in....." when trying to parse xl\comments{SheetId}.xml when opening the file.

Solution:

At ExcelWorkSheet.cs line 2878:

_comments.CommentXml.Save(_comments.Part.GetStream());

needs to be:

_comments.CommentXml.Save(_comments.Part.GetStream(FileMode.Create));

in order to get a new memory stream

regards // Fredrik

Viewing all articles
Browse latest Browse all 2262

Trending Articles



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