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:
Sergey Vladimirov 2011-07-04 19:06:20 +00:00
parent 89a5e4c11c
commit 2b97a034fe

View File

@ -17,14 +17,19 @@
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.DateAndTime;
import org.apache.poi.hwpf.usermodel.BorderCode;
import org.apache.poi.hwpf.usermodel.ShadingDescriptor;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
public final class CharacterSprmUncompressor
{
private static final POILogger logger = POILogFactory
.getLogger( CharacterSprmUncompressor.class );
public CharacterSprmUncompressor()
{
}
@ -47,6 +52,12 @@ public final class CharacterSprmUncompressor
while (sprmIt.hasNext())
{
SprmOperation sprm = sprmIt.next();
if (sprm.getType() != 2) {
logger.log( POILogger.WARN, "Non-CHP SPRM returned by SprmIterator" );
continue;
}
unCompressCHPOperation(parent, newProperties, sprm);
}