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

[email protected] changed:

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

--- Comment #2 from [email protected] 2010-08-26 02:12:05 EDT ---
I studied the problem further and found several other problems:

- the ParagraphSprmUncompressor class sets value for operation 0x40 incorrectly
to ilvl instead of to lvl, according to binary format specification

- the lvl in operation 0x40 should be set always, not only when istd is between
1..9. The binary format specification says that, but in Word you can set
outline level for any paragraph except Heading 1..9, and with this condition in
place POI does not see it. When it is commented out, everything seems OK, see
testcase.

- I added the getLvl() method to Paragraph, which enables to read outline level
at the paragraph level.

Attached is the JUnit testcase. This is its output in current version (3.7b2,
style level shown in place of paragraph level, as current version does not
support reading level at paragraph level):
Style level: 0, paragraph level: 0, text: Heading 1
Style level: 0, paragraph level: 0, text: Heading 2
Style level: 0, paragraph level: 0, text: Heading 3
Style level: 0, paragraph level: 0, text: Heading 4
Style level: 0, paragraph level: 0, text: Heading 5
Style level: 0, paragraph level: 0, text: Heading 6
Style level: 0, paragraph level: 0, text: Heading 7
Style level: 0, paragraph level: 0, text: Heading 8
Style level: 0, paragraph level: 0, text: Heading 9
Style level: 0, paragraph level: 0, text: Body text with unchanged outline
level
Style level: 0, paragraph level: 0, text: Body text with outline level changed
to Level 1
Style level: 0, paragraph level: 0, text: Body text with outline level changed
to Level 5


This is the output after applying attached patches to version 3.7b2:
Style level: 0, paragraph level: 0, text: Heading 1
Style level: 1, paragraph level: 1, text: Heading 2
Style level: 2, paragraph level: 2, text: Heading 3
Style level: 3, paragraph level: 3, text: Heading 4
Style level: 4, paragraph level: 4, text: Heading 5
Style level: 5, paragraph level: 5, text: Heading 6
Style level: 6, paragraph level: 6, text: Heading 7
Style level: 7, paragraph level: 7, text: Heading 8
Style level: 8, paragraph level: 8, text: Heading 9
Style level: 9, paragraph level: 9, text: Body text with unchanged outline
level
Style level: 9, paragraph level: 0, text: Body text with outline level changed
to Level 1
Style level: 9, paragraph level: 4, text: Body text with outline level changed
to Level 5


Specification used:
http://download.microsoft.com/download/0/B/E/0BE8BDD7-E5E8-422A-ABFD-4342ED7AD886/Word97-2007BinaryFileFormat(doc)Specification.pdf

-- 
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