Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/MiniPdf/DocxReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
var xpath = dataBinding.Attribute(W + "xpath")?.Value;
var prefixMappings = dataBinding.Attribute(W + "prefixMappings")?.Value ?? "";
if (string.IsNullOrEmpty(storeItemID) || string.IsNullOrEmpty(xpath)) return null;
if (!ctx.XmlStores.TryGetValue(storeItemID, out var doc) || doc.Root == null) return null;

Check warning on line 133 in src/MiniPdf/DocxReader.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'key' in 'bool Dictionary<string, XDocument>.TryGetValue(string key, out XDocument value)'.

var nsMgr = new System.Xml.XmlNamespaceManager(new System.Xml.NameTable());
foreach (System.Text.RegularExpressions.Match m in System.Text.RegularExpressions.Regex.Matches(
Expand Down Expand Up @@ -1531,7 +1531,7 @@
placeholder = instr.Contains("\\* ROMAN") ? "{PAGE:ROMAN}" : "{PAGE:roman}";
}

runs.Add(new DocxRun(placeholder, bold, italic, fontSize, color));
runs.Add(new DocxRun(placeholder, bold, italic, fontSize, color, IsPageNumberField: true));
}

private static void ExpandTocPlaceholders(List<DocxElement> elements, DocxPageLayout? pageLayout)
Expand Down Expand Up @@ -5338,7 +5338,8 @@
float VerticalPosition = 0,
string? FootnoteId = null,
PdfColor? Shading = null,
string? Link = null
string? Link = null,
bool IsPageNumberField = false
);

/// <summary>Represents a footnote definition parsed from word/footnotes.xml.</summary>
Expand Down
Loading
Loading