Author: sergey
Date: Mon Nov 5 16:06:36 2012
New Revision: 1405861
URL: http://svn.apache.org/viewvc?rev=1405861&view=rev
Log:
52863 - add workaround for files with broken CHP SPRMs
Modified:
poi/trunk/src/documentation/content/xdocs/status.xml
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java
Modified: poi/trunk/src/documentation/content/xdocs/status.xml
URL:
http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=1405861&r1=1405860&r2=1405861&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Mon Nov 5 16:06:36
2012
@@ -34,6 +34,7 @@
<changes>
<release version="3.9-beta1" date="2012-??-??">
+ <action dev="poi-developers" type="add">52863 - add workaround for
files with broken CHP SPRMs</action>
<action dev="poi-developers" type="fix">53182 - Reading combined
character styling and direct formatting of a character run</action>
<action dev="poi-developers" type="fix">52311 - Conversion to html :
Problem in titles number </action>
<action dev="poi-developers" type="fix">53914 -
TableRow#getTopBorder() return bottom's border</action>
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java?rev=1405861&r1=1405860&r2=1405861&view=diff
==============================================================================
---
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java
(original)
+++
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java
Mon Nov 5 16:06:36 2012
@@ -71,14 +71,30 @@ public final class CharacterSprmUncompre
Integer style = getIstd( grpprl, offset );
if ( style != null )
{
- applySprms( parStyle, styleSheet.getCHPX( style ), 0, false,
- newProperties );
+ try
+ {
+ applySprms( parStyle, styleSheet.getCHPX( style ), 0, false,
+ newProperties );
+ }
+ catch ( Exception exc )
+ {
+ logger.log( POILogger.ERROR, "Unable to apply all style ",
+ style, " CHP SPRMs to CHP: ", exc, exc );
+ }
}
CharacterProperties styleProperties = newProperties;
newProperties = styleProperties.clone();
- applySprms( styleProperties, grpprl, offset, true, newProperties );
+ try
+ {
+ applySprms( styleProperties, grpprl, offset, true, newProperties );
+ }
+ catch ( Exception exc )
+ {
+ logger.log( POILogger.ERROR,
+ "Unable to process all direct CHP SPRMs: ", exc, exc );
+ }
return newProperties;
}
@@ -109,6 +125,7 @@ public final class CharacterSprmUncompre
private static Integer getIstd( byte[] grpprl, int offset )
{
Integer style = null;
+ try
{
SprmIterator sprmIt = new SprmIterator( grpprl, offset );
while ( sprmIt.hasNext() )
@@ -122,6 +139,11 @@ public final class CharacterSprmUncompre
}
}
}
+ catch ( Exception exc )
+ {
+ logger.log( POILogger.ERROR,
+ "Unable to extract istd from direct CHP SPRM: ", exc, exc
);
+ }
return style;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]