Stylesheet style issue

Hi support,

Please take a look on the following code.

Document doc = new Document("C:\Temp\headings.dot");
DocumentBuilder docBuilder = new DocumentBuilder(doc);

for (Style style: doc.getStyles())
{
    System.out.println(style.getName());
}

Style styleH1 = doc.getStyles().get("Heading 1");
Style styleComment = doc.getStyles().get("Comment text");
Style styleQuote = doc.getStyles().get("Quote");

docBuilder.writeln();
docBuilder.getParagraphFormat().setStyle(styleH1);
docBuilder.write("A");

docBuilder.writeln();
docBuilder.getParagraphFormat().setStyle(styleComment);
docBuilder.write("B");

docBuilder.writeln();
docBuilder.getParagraphFormat().setStyle(styleQuote);
docBuilder.write("C");

doc.save("C:\Temp\docSpecialStyle.doc");

The styles names found in the stylesheet are :
CharacterStyle
Default Paragraph Font
Heading 1
Heading 1 Char
Heading 2
Heading 2 Char
Heading 3
Heading 3 Char
Heading 4
Heading 4 Char
LinkedStyle
LinkedStyle Char
ListStyle
No List
Normal
ParagraphStyle
Table Normal
TableStyle

Even if “Comment text” style is not on this list, it exists in the stylesheet and I am able to apply it. But I get a null pointer exception for the “Quote” style, even if this style exists in the stylesheet also.
Another question is why the styles name list does not include all the styles that are present in the stylesheet.

Please advice,
Milan

Hi

Thanks for your inquiry. I managed to reproduce the problem with “Quote” style on my side. You will be notified as soon as it is resolved.
Also, I am unable to apply “Comment text” style on my side, because it does not exist. I used the latest version of Aspose.Words for Java for testing.
Best regards.

Hi Alexey,

Thanks for the answer. Please make a note regarding my second question, when possible.

Milan

Hi Milan,

Thanks for your inquiry. The reason is the same. For some reason Aspose.Words does not read this style during opening the document. We should investigate the issue more deeply, then we will provide you more information.
Best regards.

Hi support,

Any news regarding this thread ?

Thank you,
Milan

Hi Milan,

Thanks for your request. Unfortunately, the issue is still unresolved. We will let you know once the problem is fixed.
Best regards.

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

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