Преглед на файлове

You can now apply formatting to empty Paragraphs. A very interesting use case was noted by a post of stackoverflow.com

http://stackoverflow.com/posts/9636913

This post required a hidden paragraph.
master
coffeycathal_cp преди 14 години
родител
ревизия
80b48d5434
променени са 1 файла, в които са добавени 23 реда и са изтрити 1 реда
  1. 23
    1
      DocX/Paragraph.cs

+ 23
- 1
DocX/Paragraph.cs Целия файл

@@ -2375,9 +2375,31 @@ namespace Novacode
internal void ApplyTextFormattingProperty(XName textFormatPropName, string value, object content)
{
XElement rPr = null;
if (runs.Count == 0)
{
XElement pPr = Xml.Element(XName.Get("pPr", DocX.w.NamespaceName));
if (pPr == null)
{
Xml.AddFirst(new XElement(XName.Get("pPr", DocX.w.NamespaceName)));
pPr = Xml.Element(XName.Get("pPr", DocX.w.NamespaceName));
}
rPr = pPr.Element(XName.Get("rPr", DocX.w.NamespaceName));
if (rPr == null)
{
pPr.AddFirst(new XElement(XName.Get("rPr", DocX.w.NamespaceName)));
rPr = pPr.Element(XName.Get("rPr", DocX.w.NamespaceName));
}
rPr.SetElementValue(textFormatPropName, value);
return;
}
foreach (XElement run in runs)
{
XElement rPr = run.Element(XName.Get("rPr", DocX.w.NamespaceName));
rPr = run.Element(XName.Get("rPr", DocX.w.NamespaceName));
if (rPr == null)
{
run.AddFirst(new XElement(XName.Get("rPr", DocX.w.NamespaceName)));

Loading…
Отказ
Запис