Procházet zdrojové kódy

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

master
MadBoy_cp před 11 roky
rodič
revize
0ca2d4250b
1 změnil soubory, kde provedl 12 přidání a 0 odebrání
  1. 12
    0
      DocX/Paragraph.cs

+ 12
- 0
DocX/Paragraph.cs Zobrazit soubor

@@ -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;
}

Načítá se…
Zrušit
Uložit