mirror of https://github.com/apache/poi.git
Same workaround for CHPX / SEPX, as for PAPX. Disable SPRM processing for Word95 files.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144689 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e9279074fb
commit
e32761be3b
|
@ -57,14 +57,16 @@ public final class CHPX extends BytePropertyNode<CHPX>
|
|||
|
||||
public CharacterProperties getCharacterProperties( StyleSheet ss, short istd )
|
||||
{
|
||||
CharacterProperties baseStyle;
|
||||
if (ss == null) {
|
||||
//old document format
|
||||
baseStyle = new CharacterProperties();
|
||||
} else {
|
||||
baseStyle = ss.getCharacterStyle(istd);
|
||||
if ( ss == null )
|
||||
{
|
||||
// TODO Fix up for Word 6/95
|
||||
return new CharacterProperties();
|
||||
}
|
||||
CharacterProperties props = CharacterSprmUncompressor.uncompressCHP(baseStyle, getGrpprl(), 0);
|
||||
|
||||
CharacterProperties baseStyle = ss.getCharacterStyle( istd );
|
||||
CharacterProperties props = CharacterSprmUncompressor.uncompressCHP(
|
||||
baseStyle, getGrpprl(), 0 );
|
||||
;
|
||||
return props;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package org.apache.poi.hwpf.usermodel;
|
||||
|
||||
import org.apache.poi.hwpf.HWPFOldDocument;
|
||||
import org.apache.poi.hwpf.model.SEPX;
|
||||
|
||||
public final class Section
|
||||
|
@ -27,7 +28,13 @@ public final class Section
|
|||
|
||||
public Section( SEPX sepx, Range parent )
|
||||
{
|
||||
super(Math.max(parent._start, sepx.getStart()), Math.min(parent._end, sepx.getEnd()), 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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue