1 2 17 18 19 20 package org.apache.poi.hwpf.model; 21 22 import org.apache.poi.hwpf.usermodel.CharacterProperties; 23 import org.apache.poi.hwpf.sprm.SprmBuffer; 24 import org.apache.poi.hwpf.sprm.CharacterSprmUncompressor; 25 26 31 32 public class CHPX extends PropertyNode 33 { 34 35 public CHPX(int fcStart, int fcEnd, byte[] grpprl) 36 { 37 super(fcStart, fcEnd, new SprmBuffer(grpprl)); 38 } 39 40 public CHPX(int fcStart, int fcEnd, SprmBuffer buf) 41 { 42 super(fcStart, fcEnd, buf); 43 } 44 45 46 public byte[] getGrpprl() 47 { 48 return ((SprmBuffer)_buf).toByteArray(); 49 } 50 51 public SprmBuffer getSprmBuf() 52 { 53 return (SprmBuffer)_buf; 54 } 55 56 public CharacterProperties getCharacterProperties(StyleSheet ss, short istd) 57 { 58 CharacterProperties baseStyle = ss.getCharacterStyle(istd); 59 CharacterProperties props = CharacterSprmUncompressor.uncompressCHP(baseStyle, getGrpprl(), 0); 60 return props; 61 } 62 } 63 | Popular Tags |