| } | } | ||||
| rPr.SetElementValue(textFormatPropName, value); | 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; | return; | ||||
| } | } | ||||