52863 - add workaround for files with broken CHP SPRMs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1405861 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2f9f29380a
commit
110ef33b6e
@ -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>
|
||||
|
@ -70,15 +70,31 @@ public final class CharacterSprmUncompressor extends SprmUncompressor
|
||||
*/
|
||||
Integer style = getIstd( grpprl, offset );
|
||||
if ( style != null )
|
||||
{
|
||||
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();
|
||||
|
||||
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 CharacterSprmUncompressor extends SprmUncompressor
|
||||
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 CharacterSprmUncompressor extends SprmUncompressor
|
||||
}
|
||||
}
|
||||
}
|
||||
catch ( Exception exc )
|
||||
{
|
||||
logger.log( POILogger.ERROR,
|
||||
"Unable to extract istd from direct CHP SPRM: ", exc, exc );
|
||||
}
|
||||
return style;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user