return (SprmBuffer)_buf;
}
- public CharacterProperties getCharacterProperties(StyleSheet ss, short istd)
- {
- CharacterProperties baseStyle;
- if (ss == null) {
- //old document format
- baseStyle = new CharacterProperties();
- } else {
- baseStyle = ss.getCharacterStyle(istd);
+ public CharacterProperties getCharacterProperties( StyleSheet ss, short istd )
+ {
+ if ( ss == null )
+ {
+ // TODO Fix up for Word 6/95
+ return new CharacterProperties();
+ }
+
+ CharacterProperties baseStyle = ss.getCharacterStyle( istd );
+ CharacterProperties props = CharacterSprmUncompressor.uncompressCHP(
+ baseStyle, getGrpprl(), 0 );
+ ;
+ return props;
}
- CharacterProperties props = CharacterSprmUncompressor.uncompressCHP(baseStyle, getGrpprl(), 0);
- return props;
- }
public String toString() {
return "CHPX from " + getStart() + " to " + getEnd() +
package org.apache.poi.hwpf.usermodel;
+import org.apache.poi.hwpf.HWPFOldDocument;
import org.apache.poi.hwpf.model.SEPX;
public final class Section
private SectionProperties _props;
- public Section(SEPX sepx, Range parent)
- {
- super(Math.max(parent._start, sepx.getStart()), Math.min(parent._end, sepx.getEnd()), parent);
- _props = sepx.getSectionProperties();
- }
+ public Section( SEPX sepx, Range parent )
+ {
+ super( Math.max( parent._start, sepx.getStart() ), Math.min(
+ parent._end, sepx.getEnd() ), parent );
+
+ // XXX: temporary workaround for old Word95 document
+ if ( parent.getDocument() instanceof HWPFOldDocument )
+ _props = new SectionProperties();
+ else
+ _props = sepx.getSectionProperties();
+ }
public int type()
{