Incorrect paragraph style left indent and first line indent

Hi,
Please use the attached document and the following code. All I am doing is reading paragraph’s style’s indent properties (left indent and the first line indent) and assign them back to the paragraphs. Logically, the result document should remain unchanged, which works OK in 15.2 version, but does not work OK in later versions (we noticed the issue at 16.1 and it is still an issue with 16.11 version), where the indents for list paragraphs are off and do not represent styling of the associated paragraph style.
Here is the code:

Document doc = new Document("src/data/TestFile1.docx");
for (Node node : doc.getSections().get(0).getBody().getChildNodes(NodeType.PARAGRAPH, true).toArray())
{
    Paragraph para = (Paragraph)node;
    Style nodeStyle = para.getParagraphFormat().getStyle();
    if (para.getParagraphFormat().isListItem() == true)
    {
        para.getParagraphFormat().setLeftIndent(nodeStyle.getParagraphFormat().getLeftIndent());
        para.getParagraphFormat().setFirstLineIndent(nodeStyle.getParagraphFormat().getFirstLineIndent());
    }
}
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions(SaveFormat.DOCX);
saveOptions.setCompliance(OoxmlCompliance.ISO_29500_2008_TRANSITIONAL);
doc.save("src/data/TestFile1_output.docx", saveOptions);

We managed to work around this issue by changing styling properties of the “list” associated with these styles in the source document, which helped in this case. We would however appreciate if this can be fixed as we don’t always have an option to affect styling of the source document that we use.
Thank you very much,
Natasa

Hi Natasa,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-14454. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-14454) have been fixed in this Aspose.Words for .NET 17.3.0 update and this Aspose.Words for Java 17.3.0 update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.