Cell.HtmlString color:inherit throws an Exception

Hi,

The following Aspose.Cells code throws an error.

The cause is the color:inherit part of the HTML

var xls = new Workbook();
var sheet = xls.Worksheets.First();

var row = sheet.Cells.Rows[0];
row[0].HtmlString = @"<span style=""color:#ff0000;"">TEST</span>"; // OK
row[1].HtmlString = @"<span style=""color:inherit;"">TEST</span>"; // <---- Error

The error is:

.(S.(S.(S.(S.(S.(SUnhandled exception. System.ArgumentException: Convert invalid primitive (Parameter 'text') (Parameter 'htmlColor')
 ---> System.ArgumentException: Convert invalid primitive (Parameter 'text')
 ---> System.FormatException: The input string 'inherit' was not in a correct format.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, ReadOnlySpan`1 value, TypeCode type)
   at System.Int32.Parse(String s, NumberStyles style, IFormatProvider provider)
   at ♥☻tring ☻, NumberFormatInfo ♥)
   at ♥♥tring ☻, CultureInfo ♥)
   --- End of inner exception stack trace ---
   at ♥♥tring ☻, CultureInfo ♥)
   at ♥☻tring ☻, CultureInfo ♥)
   at ♥☻tring ☻)
   --- End of inner exception stack trace ---
   at ♥☻tring ☻)
   at Aspose.Cells.Drawing.ColorHelper.☻(String ☻)
   at ☻▬☻.☻(String ☻)
   at ☻▬☻.☻(WorksheetCollection ☻, Font ♥, Hashtable ♣, Hashtable)
   at ☻▬☻.☻(Boolean ☻, WorksheetCollection ♥, Font ♣, Char[], ArrayList ♠, Hashtable )
   at ☻▬☻.☻(Cell ☻, String ♥, Hashtable ♣)
   at Aspose.Cells.Cell.set_HtmlString(String value)

color:inherit is a valid value and should be supported, or at the very least, not throw an error.


Also tested in latest Aspose Cells (v23.9.0.0)

@dstj,

I am able to reproduce the issue as you mentioned by using your code segment. I found Cell.HtmlString color:inherit throws an exception “System.ArgumentException: Convert invalid primitive (Parameter ‘text’)”.
We need to evaluate your issue in details. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-54204

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@dstj ,

This is to inform you that your issue has been resolved. The fix will be included in an upcoming release (Aspose.Cells v23.11) that we plan to release in the first half of November 2023. You will be notified when the next version is released.

The issues you have found earlier (filed as CELLSNET-54204) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi