https://issues.apache.org/bugzilla/show_bug.cgi?id=48325

           Summary: bad text 'Page &P of &N' and similar errors when
                    reading in spreadsheets
           Product: POI
           Version: 3.5-FINAL
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: regression
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [email protected]


We have seen this error in logs from customer sites, which prevent getting the
text out (HeaderFooter only has API for getLeft(), getCenter() and getRight(),
and all three throw the exception:

Caused by: java.lang.IllegalStateException: bad text 'Page &P of &N'.
    at
org.apache.poi.hssf.usermodel.HeaderFooter.splitParts(HeaderFooter.java:77)
    at org.apache.poi.hssf.usermodel.HeaderFooter.getLeft(HeaderFooter.java:87)
    at
com.nuix.data.file.office.poi.PoiExcelFileReader$SheetReader.createNextReader(SourceFile:273)
    at com.nuix.util.LazyCompositeReader.isReaderAvailable(SourceFile:93)
    at com.nuix.util.LazyCompositeReader.read(SourceFile:40)
    at com.nuix.util.LazyCompositeReader.read(SourceFile:42)
    at com.nuix.data.util.CachingReaderFactory.readFully(SourceFile:201)
    at com.nuix.data.util.CachingReaderFactory.createReader(SourceFile:104)
    ... 14 more

We have seen the same thing with '&A' as well.

This is a regression from before 3.5 beta 6, when these methods used to
silently return null instead.  However I'm not sure that returning null is
correct either - what would make the most sense is to match the behaviour of
Excel in this situation, which is presumably to treat all the text as if it's
the left or the center (but which?)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to