incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Schreiber (JIRA)" <>
Subject [jira] [Created] (ODFTOOLKIT-344) NullPointerException in DefaultStyleHandler.getTextPropertiesForWrite().setFontColor()
Date Tue, 30 Oct 2012 09:24:12 GMT
Marc Schreiber created ODFTOOLKIT-344:

             Summary: NullPointerException in DefaultStyleHandler.getTextPropertiesForWrite().setFontColor()
                 Key: ODFTOOLKIT-344
             Project: ODF Toolkit
          Issue Type: Bug
          Components: simple api
    Affects Versions: 0.7
            Reporter: Marc Schreiber

I'm trying to change to font color of a certain word in a Open Document Textfile. I used the
example for changing the style of a span from here:

This is my code:

        TextNavigation navigation = new TextNavigation("Word I'm looking for", document);
        if (navigation.hasNext()) {
            TextSelection selection = (TextSelection) navigation.nextSelection();

            Span span = Span.newSpan(selection);
            DefaultStyleHandler style = span.getStyleHandler();

But the last line in the if block throws an NullPointerException. Here is the stack trace:

Exception in thread "main" java.lang.NullPointerException
	at etl.squared.informationextraction.Annotator.annotate(
	at etl.squared.informationextraction.Annotator.main(

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message