Compare and reject issue

Hi,

Aspose Words for Java (tested v15.12.0.0) has issue with the compare and reject feature.
The resulting file is not equal to the original document, see attached image.
The following code was used to create the files:

DocumentBuilder v1 = new DocumentBuilder();
v1.getDocument().getStyles().getByStyleIdentifier(StyleIdentifier.HEADING_1).getFont().setColor(Color.GRAY);
v1.getParagraphFormat().setStyleIdentifier(StyleIdentifier.HEADING_1);
v1.write("Technical");
v1.getDocument().save("v1.rtf");
DocumentBuilder v2 = new DocumentBuilder();
v2.getFont().setColor(Color.GREEN);
v2.writeln("This is");
v2.getFont().clearFormatting();
v2.getFont().setUnderline(Underline.SINGLE);
v2.getFont().setColor(Color.GREEN);
v2.writeln("Underlined");
v2.getFont().clearFormatting();
v2.getFont().setSuperscript(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("superscript");
v2.getFont().clearFormatting();
v2.getFont().setSubscript(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("hello");
v2.getFont().clearFormatting();
v2.getFont().setStrikeThrough(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("change");
v2.getFont().clearFormatting();
v2.getFont().setItalic(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("italic");
v2.getFont().clearFormatting();
v2.getDocument().getStyles().getByStyleIdentifier(StyleIdentifier.HEADING_1).getFont().setColor(Color.GRAY);
v2.getParagraphFormat().setStyleIdentifier(StyleIdentifier.HEADING_1);
v2.writeln("Technical");
v2.getDocument().save("v2.rtf");
v1.getDocument().compare(v2.getDocument(), "author", new Date());
v1.getDocument().save("diffAspose.rtf");
Document diffReject = new Document("diffAspose.rtf");
diffReject.getRevisions().rejectAll();
diffReject.save("diffReject.rtf");

Thanks

Romain

Hi Romain,

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-13111. 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-13111) 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.