StyleCollection.addCopy() not copying style correctly!

Hi there,
We’re using StyleCollection.addCopy() for copying a style from one word document to another and facing few inconsistencies with styles - {H2, H3 and H4} particularly. Please find the attached document and code below to reproduce the same.

public static void main(String[] args) {
String dirUrl = "Desktop\Iteration33\\TextComparison\\New folder\\";
String docxUrl = "Bug in h2 h3 and h4";
String doclet = "Blank";

Document doc, docletDoc, pageDoc = null;
DocumentBuilder db = null;
try {
doc = new com.aspose.words.Document(dirUrl + docxUrl + ".docx");

docletDoc = new com.aspose.words.Document(dirUrl + doclet + ".docx");

db = new DocumentBuilder(doc);

System.out.println(System.currentTimeMillis());

docletDoc.getStyles().addCopy(doc.getStyles().get("H2"));

System.out.println(doc.getStyles().get("H2").getParagraphFormat().getFirstLineIndent()); // -18.0
System.out.println(docletDoc.getStyles().get("H2").getParagraphFormat().getFirstLineIndent()); //-21.6

System.out.println(doc.getStyles().get("H2").getParagraphFormat().getLeftIndent()); //18.0
System.out.println(docletDoc.getStyles().get("H2").getParagraphFormat().getLeftIndent()); // 39.6

System.out.println(doc.getStyles().get("H2").getListFormat().getListLevel().getNumberFormat());
System.out.println(docletDoc.getStyles().get("H2").getListFormat().getListLevel().getNumberFormat());

System.out.println(doc.getStyles().get("H2").getListFormat().getListLevel().getNumberPosition());
System.out.println(docletDoc.getStyles().get("H2").getListFormat().getListLevel().getNumberPosition());

System.out.println(doc.getStyles().get("H2").getListFormat().getListLevel().getTabPosition());
System.out.println(docletDoc.getStyles().get("H2").getListFormat().getListLevel().getTabPosition());

System.out.println(doc.getStyles().get("H2").getListFormat().getListLevel().getTextPosition());
System.out.println(docletDoc.getStyles().get("H2").getListFormat().getListLevel().getTextPosition());

docletDoc.getStyles().addCopy(doc.getStyles().get("H3"));
System.out.println(doc.getStyles().get("H3").getParagraphFormat().getFirstLineIndent());
System.out.println(docletDoc.getStyles().get("H3").getParagraphFormat().getFirstLineIndent());

docletDoc.getStyles().addCopy(doc.getStyles().get("H4"));
System.out.println(doc.getStyles().get("H4").getParagraphFormat().getFirstLineIndent());
System.out.println(docletDoc.getStyles().get("H4").getParagraphFormat().getFirstLineIndent());

System.out.println(System.currentTimeMillis());
}

catch (Exception e) {
throw new RuntimeException("Aspose document instance problem", e);
}

Please note that differing attributes are as listed above in code:

{Style.ParagraphFormat.getFirstLineIndent(), Style.ParagraphFormat.getLeftIndent(), Style.ListFormat().getListLevel().getNumberFormat(), Style.ListFormat().getListLevel().getNumberPosition(), Style.ListFormat().getListLevel().getTabPosition(), Style.ListFormat().getListLevel().getTextPosition()}

for all: {H2, H3 and H4}.

Please have a look. Thanks.

Hi Praneeth,

Thanks for your inquiry. We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-11258. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-11258) have been fixed in this .NET update and this Java update.