Skip to content

Commit

Permalink
Merge pull request #1391 from iain-mcandrew/find-replace-header-foote…
Browse files Browse the repository at this point in the history
…r-tables-fix

FindAndReplaceText will now also work for tables within a documents h…
  • Loading branch information
tonyqus committed Jul 24, 2024
2 parents 9eca322 + f0663a5 commit aa33d87
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ooxml/XWPF/Usermodel/XWPFDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1958,13 +1958,22 @@ public void FindAndReplaceText(string oldValue, string newValue)
{
FindAndReplaceTextInParagraph(paragraph, oldValue, newValue);
}
foreach(var table in footer.Tables)
{
FindAndReplaceTextInTable(table, oldValue, newValue);
}
}

foreach (var header in this.HeaderList)
{
foreach (var paragraph in header.Paragraphs)
{
FindAndReplaceTextInParagraph(paragraph, oldValue, newValue);
}
foreach(var table in header.Tables)
{
FindAndReplaceTextInTable(table, oldValue, newValue);
}
}
}
public void Dispose()
Expand Down

0 comments on commit aa33d87

Please sign in to comment.