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

Edited Unassigned: Drawing.GetRowWidth does not handle default row height correctly [15103]

$
0
0
First, thank you for the fantastic library!

The symptom I am seeing is that calling SetPosition on a chart correctly moves the chart but also changes the height.

I downloaded and debugged into the code and found the problem in the GetRowWidth method. After the cast to RowInternal, there should be a check that RowInternal.Height is >= 0 before using the Height value because it may be -1. Otherwise the default height should be returned.

For comparison see the ExcelRow.Height property which has this check.

I include my fixed version of the method below if it is of any use:

private double GetRowWidth(int row)
{
ExcelWorksheet ws = _drawings.Worksheet;
object o = null;
if (ws._values.Exists(row, 0, ref o) && o != null) //Check that the row exists
{
var internalRow = (RowInternal)o;
if (internalRow.Height >= 0)
{
return internalRow.Height;
}
}
return (double)ws.DefaultRowHeight;
}


Viewing all articles
Browse latest Browse all 2262

Trending Articles



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