realgz / excellibrary

Automatically exported from code.google.com/p/excellibrary
0 stars 0 forks source link

Patch: uint in cell value #33

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Workbook workbook = new Workbook();
Worksheet worksheet = new Worksheet("Test");

worksheet.Cells[0, 0] = new Cell(101u);
workbook.Worksheets.Add(worksheet);
workbook.Save(tempFile);

What is the expected output? What do you see instead?
System.Exception: Invalid cell value.

Please provide any additional information below.
Patch included 

Original issue reported on code.google.com by Kvasov.R...@gmail.com on 29 May 2009 at 11:13

GoogleCodeExporter commented 8 years ago
Attached patch is not correct. This is correct.

Original comment by Kvasov.R...@gmail.com on 29 May 2009 at 11:30

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks.

Original comment by China.LiuJunFeng on 29 Jul 2009 at 7:40

GoogleCodeExporter commented 8 years ago
I do think the patch is not completely correct. If the value is a UInt, it 
shouldnt be converted to a int first. My suggestion would be 
(WorkSheetEncoder.cs):

if (value is uint) 
{
    RK rk = new RK();
    rk.Value = (uint) value;
    return rk;
} 
    else if (value is int || value is short)
{
...

Original comment by peter.ha...@gmail.com on 11 Feb 2011 at 10:15