DocX
DocX copied to clipboard
Bug: InsertParagraphBeforeSelf(Paragraph) returns Paragraph with wrong content
The InsertBeforeOrAfter.InsertParagraphBeforeSelf(Paragraph p) method returns the content of the first previous sibling instead of the last like the other InsertXBeforeSelf methods.
Current:
XElement newlyInserted = Xml.ElementsBeforeSelf().First();
Should be:
XElement newlyInserted = Xml.ElementsBeforeSelf().Last();
I also think the method should return a new Paragraph instance like its companion InsertParagraphAfterSelf(Paragraph p). To get the same instance back was unexpected.
Hi, Thank you for pointing this out. This will be fixed in v1.9.
Thank you.