Closed GoogleCodeExporter closed 8 years ago
SimpleTest.WriteLongTextTest() is failing at r35
Original comment by jetcat
on 24 Feb 2009 at 12:58
SimpleTest.WriteLongTextTest() passed on my machine.
Original comment by China.LiuJunFeng
on 24 Feb 2009 at 3:01
I am getting the following error:
TestCase 'ExcelLibrary.Test.SimpleTest.WriteLongTextTest'
failed: System.Exception : invalid size of rich text formatting information
C:\excellibrary\trunk\src\ExcelLibrary\Office\Excel\BinaryFileFormat\Decode\StringDecoder.cs(176,0): at ExcelLibrary.BinaryFileFormat.StringDecoder.ReadString(Int32 lengthbits, RichTextFormat& rtf)
C:\excellibrary\trunk\src\ExcelLibrary\Office\Excel\BinaryFileFormat\Extended\SST.cs(24,0): at ExcelLibrary.BinaryFileFormat.SST.Decode()
C:\excellibrary\trunk\src\ExcelLibrary\Office\Excel\BinaryFileFormat\Decode\WorkbookDecoder.cs(85,0): at ExcelLibrary.BinaryFileFormat.WorkbookDecoder.DecodeRecords(List`1 records, SharedResource& sharedResource)
C:\excellibrary\trunk\src\ExcelLibrary\Office\Excel\BinaryFileFormat\Decode\WorkbookDecoder.cs(19,0): at ExcelLibrary.BinaryFileFormat.WorkbookDecoder.Decode(Stream stream)
C:\excellibrary\trunk\src\ExcelLibrary\Office\Excel\SpreadSheet\Workbook.cs(29,0):
at ExcelLibrary.SpreadSheet.Workbook.Open(String file)
C:\excellibrary\trunk\src\ExcelLibrary.Test\SimpleTest.cs(86,0): at
ExcelLibrary.Test.SimpleTest.WriteLongTextTest()
===
It appears that when decoding string that is longer than 2000 character, then
StringDecoder throws exception (line 174)
Original comment by jetcat
on 26 Feb 2009 at 12:40
Yes, the following debug purpose code can be removed.
if (stringlength > 2000 || firstpart.Length > 2000 || size > 2000)
{
throw new Exception("invalid size of rich text formatting information");
}
Original comment by China.LiuJunFeng
on 26 Feb 2009 at 2:34
Original issue reported on code.google.com by
sunilshe...@gmail.com
on 19 Feb 2009 at 2:22Attachments: