Workbook do not write correct information about font's underline.
I made some changes which allow workbook to save information correctly.
__Styles.cs__
```
// why to set single line as as default option ?
public CT_UnderlineProperty()
{
// this.valField = ST_UnderlineValues.single;
this.valField = ST_UnderlineValues.none;
}
public ST_UnderlineValues val
{
get
{
// return (null == valField) ? ST_UnderlineValues.single : (ST_UnderlineValues)this.valField;
return (null == valField) ? ST_UnderlineValues.none : (ST_UnderlineValues)this.valField;
}
set
{
this.valField = value;
}
}
```
__XSSFFont__
```
public FontUnderlineType Underline
{
get
{
CT_UnderlineProperty underline = _ctFont.sizeOfUArray() == 0 ? null : _ctFont.GetUArray(0);
if (underline != null)
{
return (FontUnderlineType)underline.val;
//FontUnderline val = FontUnderline.ValueOf((int)underline.val);
//return (FontUnderlineType)val.ByteValue;
}
return (FontUnderlineType)FontUnderline.NONE.ByteValue;
}
set
{
SetUnderline(value);
}
}
internal void SetUnderline(FontUnderlineType underline)
{
if (underline == FontUnderlineType.None && _ctFont.sizeOfUArray() > 0)
{
_ctFont.SetUArray(null);
}
else
{
CT_UnderlineProperty ctUnderline = _ctFont.sizeOfUArray() == 0 ? _ctFont.AddNewU() : _ctFont.GetUArray(0);
ST_UnderlineValues val = (ST_UnderlineValues)FontUnderline.ValueOf(underline).ByteValue; //.Value;
ctUnderline.val = val;
}
}
```
Comments: ** Comment from web user: serjn **
I made some changes which allow workbook to save information correctly.
__Styles.cs__
```
// why to set single line as as default option ?
public CT_UnderlineProperty()
{
// this.valField = ST_UnderlineValues.single;
this.valField = ST_UnderlineValues.none;
}
public ST_UnderlineValues val
{
get
{
// return (null == valField) ? ST_UnderlineValues.single : (ST_UnderlineValues)this.valField;
return (null == valField) ? ST_UnderlineValues.none : (ST_UnderlineValues)this.valField;
}
set
{
this.valField = value;
}
}
```
__XSSFFont__
```
public FontUnderlineType Underline
{
get
{
CT_UnderlineProperty underline = _ctFont.sizeOfUArray() == 0 ? null : _ctFont.GetUArray(0);
if (underline != null)
{
return (FontUnderlineType)underline.val;
//FontUnderline val = FontUnderline.ValueOf((int)underline.val);
//return (FontUnderlineType)val.ByteValue;
}
return (FontUnderlineType)FontUnderline.NONE.ByteValue;
}
set
{
SetUnderline(value);
}
}
internal void SetUnderline(FontUnderlineType underline)
{
if (underline == FontUnderlineType.None && _ctFont.sizeOfUArray() > 0)
{
_ctFont.SetUArray(null);
}
else
{
CT_UnderlineProperty ctUnderline = _ctFont.sizeOfUArray() == 0 ? _ctFont.AddNewU() : _ctFont.GetUArray(0);
ST_UnderlineValues val = (ST_UnderlineValues)FontUnderline.ValueOf(underline).ByteValue; //.Value;
ctUnderline.val = val;
}
}
```
Comments: ** Comment from web user: serjn **
I use 2.0.6