Sfoglia il codice sorgente

Fix for Resize FontSize of Paragraph crashes document, fix provided by tahansen

master
MadBoy_cp 11 anni fa
parent
commit
0ca2d4250b
1 ha cambiato i file con 12 aggiunte e 0 eliminazioni
  1. 12
    0
      DocX/Paragraph.cs

+ 12
- 0
DocX/Paragraph.cs Vedi File

@@ -2523,6 +2523,18 @@ namespace Novacode
}
rPr.SetElementValue(textFormatPropName, value);
var last = rPr.Elements().Last();
if (content as System.Xml.Linq.XAttribute != null)//If content is an attribute
{
if (last.Attribute(((System.Xml.Linq.XAttribute)(content)).Name) == null)
{
last.Add(content); //Add this attribute if element doesn't have it
}
else
{
last.Attribute(((System.Xml.Linq.XAttribute)(content)).Name).Value = ((System.Xml.Linq.XAttribute)(content)).Value; //Apply value only if element already has it
}
}
return;
}

Loading…
Annulla
Salva