}
public static CharacterProperties uncompressCHP( StyleSheet styleSheet,
CharacterProperties parStyle, byte[] grpprl, int offset )
{
CharacterProperties newProperties;
if ( parStyle == null )
{
parStyle = new CharacterProperties();
newProperties = new CharacterProperties();
}
else
{
newProperties = parStyle.clone();
}
/*
* not fully conform to specification, but the fastest way to make it
* work. Shall be rewritten if any errors would be found -- vlsergey
*/
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 );
}