Sfoglia il codice sorgente

Previously created TableBorder class has an error in setting table border colors. The generated colors are invalid according to the DOCX specification.

Fixed this by using the _Extensions methods.

Patch provided by lckuiper
master
MadBoy_cp 11 anni fa
parent
commit
d1eda4f0c7
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4
    4
      DocX/Table.cs

+ 4
- 4
DocX/Table.cs Vedi File

@@ -1870,7 +1870,7 @@ namespace Novacode
tblBorderType.SetAttributeValue(XName.Get("space", DocX.w.NamespaceName), (border.Space).ToString());
// The color attribute is used for the border color
tblBorderType.SetAttributeValue(XName.Get("color", DocX.w.NamespaceName), ColorTranslator.ToHtml(border.Color));
tblBorderType.SetAttributeValue(XName.Get("color", DocX.w.NamespaceName), border.Color.ToHex());
}
}
@@ -2004,7 +2004,7 @@ namespace Novacode
// If color is not a Color, something is wrong with this attributes value, so remove it
try
{
b.Color = ColorTranslator.FromHtml(color.Value);
b.Color = ColorTranslator.FromHtml(string.Format("#{0}", color.Value));
}
catch
{
@@ -3221,7 +3221,7 @@ namespace Novacode
tcBorderType.SetAttributeValue(XName.Get("space", DocX.w.NamespaceName), (border.Space).ToString());
// The color attribute is used for the border color
tcBorderType.SetAttributeValue(XName.Get("color", DocX.w.NamespaceName), ColorTranslator.ToHtml(border.Color));
tcBorderType.SetAttributeValue(XName.Get("color", DocX.w.NamespaceName), border.Color.ToHex());
}
@@ -3368,7 +3368,7 @@ namespace Novacode
// If color is not a Color, something is wrong with this attributes value, so remove it
try
{
b.Color = ColorTranslator.FromHtml(color.Value);
b.Color = ColorTranslator.FromHtml(string.Format("#{0}", color.Value));
}
catch
{

Loading…
Annulla
Salva