warn and skip wrong type SPRM
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1142764 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
89a5e4c11c
commit
2b97a034fe
@ -17,14 +17,19 @@
|
|||||||
|
|
||||||
package org.apache.poi.hwpf.sprm;
|
package org.apache.poi.hwpf.sprm;
|
||||||
|
|
||||||
|
import org.apache.poi.hwpf.usermodel.BorderCode;
|
||||||
import org.apache.poi.hwpf.usermodel.CharacterProperties;
|
import org.apache.poi.hwpf.usermodel.CharacterProperties;
|
||||||
import org.apache.poi.hwpf.usermodel.DateAndTime;
|
import org.apache.poi.hwpf.usermodel.DateAndTime;
|
||||||
import org.apache.poi.hwpf.usermodel.BorderCode;
|
|
||||||
import org.apache.poi.hwpf.usermodel.ShadingDescriptor;
|
import org.apache.poi.hwpf.usermodel.ShadingDescriptor;
|
||||||
import org.apache.poi.util.LittleEndian;
|
import org.apache.poi.util.LittleEndian;
|
||||||
|
import org.apache.poi.util.POILogFactory;
|
||||||
|
import org.apache.poi.util.POILogger;
|
||||||
|
|
||||||
public final class CharacterSprmUncompressor
|
public final class CharacterSprmUncompressor
|
||||||
{
|
{
|
||||||
|
private static final POILogger logger = POILogFactory
|
||||||
|
.getLogger( CharacterSprmUncompressor.class );
|
||||||
|
|
||||||
public CharacterSprmUncompressor()
|
public CharacterSprmUncompressor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -47,6 +52,12 @@ public final class CharacterSprmUncompressor
|
|||||||
while (sprmIt.hasNext())
|
while (sprmIt.hasNext())
|
||||||
{
|
{
|
||||||
SprmOperation sprm = sprmIt.next();
|
SprmOperation sprm = sprmIt.next();
|
||||||
|
|
||||||
|
if (sprm.getType() != 2) {
|
||||||
|
logger.log( POILogger.WARN, "Non-CHP SPRM returned by SprmIterator" );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
unCompressCHPOperation(parent, newProperties, sprm);
|
unCompressCHPOperation(parent, newProperties, sprm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user