https://issues.apache.org/bugzilla/show_bug.cgi?id=49820
Summary: ParagraphProperties.getLvl() returns 0 for both Level
1 and Body text
Product: POI
Version: 3.7-dev
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: HWPF
AssignedTo: [email protected]
ReportedBy: [email protected]
Created an attachment (id=25934)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=25934)
Fixed version
When you ParagraphProperties.getLvl() for any style sheet, that is a part of
the outline, it returns a value from 0 to 8 for Heading 1 to Heading 9. But for
normal styles it returns 0, which makes it indistinguishable from each other.
The MICROSOFT OFFICE WORD 97-2007 BINARY FILE FORMAT SPECIFICATION states the
following:
The standard PAP is all zeros except:
fWidowControl 1
fMultLineSpace 1
dyaLine 240 twips
Lvl 9
I solved this problem by changing the initial value for property
org.apache.poi.hwpf.model.types.PAPAbstractType#field_58_lvl to 9. After this,
I can read the same outline levels as Word shows me: getLvl() returns values
from 0 to 9; 9 is Body text and 0..8 are outline levels 1..9.
Attached is a modified version of PAPAbstractType.java, which also alters the
initial value for the property field_17_fWidowControl according to
specification. Properties for fMultLineSpace and dyaLine are not there, it is
probably for some newer version of Word.
--
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]