/** * * @param chpx The chpx this object is based on. * @param ss The stylesheet for the document this run belongs to. * @param istd The style index if this run's base style. * @param parent The parent range of this character run (usually a paragraph). */ CharacterRun(CHPX chpx, StyleSheet ss, short istd, Range parent) { super(Math.max(parent._start, chpx.getStart()), Math.min(parent._end, chpx.getEnd()), parent); _props = chpx.getCharacterProperties(ss, istd); _chpx = chpx.getSprmBuf(); _istd = istd; }
/** * * @param chpx The chpx this object is based on. * @param ss The stylesheet for the document this run belongs to. * @param istd The style index if this run's base style. * @param parent The parent range of this character run (usually a paragraph). */ CharacterRun(CHPX chpx, StyleSheet ss, short istd, Range parent) { super(Math.max(parent._start, chpx.getStart()), Math.min(parent._end, chpx.getEnd()), parent); _props = chpx.getCharacterProperties(ss, istd); _chpx = chpx.getSprmBuf(); }
public void dumpChpx( boolean withProperties, boolean withSprms ) { for ( CHPX chpx : _doc.getCharacterTable().getTextRuns() ) { System.out.println( chpx ); if ( withProperties ) { System.out.println( chpx.getCharacterProperties( _doc.getStyleSheet(), (short) StyleSheet.NIL_STYLE ) ); } if ( withSprms ) { SprmIterator sprmIt = new SprmIterator( chpx.getGrpprl(), 0 ); while ( sprmIt.hasNext() ) { SprmOperation sprm = sprmIt.next(); System.out.println( "\t" + sprm); } } String text = new Range( chpx.getStart(), chpx.getEnd(), _doc.getOverallRange() ) { public String toString() { return "CHPX range (" + super.toString() + ")"; } }.text(); StringBuilder stringBuilder = new StringBuilder(); for ( char c : text.toCharArray() ) { if ( c < 30 ) stringBuilder.append("\\0x").append(Integer.toHexString(c)); else stringBuilder.append( c ); } System.out.println( stringBuilder ); } }
System.out.println( chpx.getCharacterProperties( _doc.getStyleSheet(), (short) StyleSheet.NIL_STYLE ) );