You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/08/22 15:02:08 UTC

DO NOT REPLY [Bug 51703] New: IllegalArgumentException when applying font

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

             Bug #: 51703
           Summary: IllegalArgumentException when applying font
           Product: POI
           Version: 3.8-dev
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: jan.stette@gmail.com
    Classification: Unclassified


I have seen POI failing to read several spreadsheets, with the following stack
trace:

Caused by: java.lang.IllegalArgumentException: Start index must be less than
end index.
at
org.apache.poi.hssf.usermodel.HSSFRichTextString.applyFont(HSSFRichTextString.java:139)
at
org.apache.poi.hssf.record.TextObjectRecord.processFontRuns(TextObjectRecord.java:157)
at
org.apache.poi.hssf.record.TextObjectRecord.<init>(TextObjectRecord.java:133)
at sun.reflect.GeneratedConstructorAccessor45.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.apache.poi.hssf.record.RecordFactory$ReflectionConstructorRecordCreator.create(RecordFactory.java:57)
... 20 more 

Debugging it, it looks like there's a text record which has a font applied,
where the length of the text string is 42 characters (in one of the examples),
but the index for where to apply the font is 60.  The cases I've seen this
being a problem all seem related to a floating graphic containing a formatted
string only, but I don't know if that's definitely the cause of it as I haven't
been able to reproduce this in a simple spreadsheet that I've created myself.

I'm afraid the spreadsheets I have that produce this problem can't be provided
as they contain confidential data.

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 51703] IllegalArgumentException when applying font

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51703

--- Comment #2 from Jan <ja...@gmail.com> 2011-08-26 08:43:43 UTC ---
I tried the Microsoft validator program as suggested, and these spreadsheets
all fail with a message referring to the "DSF" record
(http://msdn.microsoft.com/en-us/library/638F5C45-2742-4681-9304-C9E2E46A52A9).
 So I guess that POI is not to blame?

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 51703] IllegalArgumentException when applying font

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51703

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Nick Burch <ni...@alfresco.com> 2011-08-22 16:41:35 UTC ---
Can you try running the Microsoft Binary File Format validator tool against one
of your problematic files, and see if that declares them to be spec-valid or
not?

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 51703] IllegalArgumentException when applying font

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51703

--- Comment #3 from Nick Burch <ni...@alfresco.com> 2011-08-26 09:26:33 UTC ---
(In reply to comment #2)
> I tried the Microsoft validator program as suggested, and these spreadsheets
> all fail with a message referring to the "DSF" record

Without the files we can't say for certain, but hat would certainly seem to
indicate that the file wasn't produced by office, and instead by a third party
program which doesn't follow the spec.

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org