StyleDescription style = document.getStyleSheet().getStyleDescription(p.getStyleIndex()); TagAndStyle tas = buildParagraphTagAndStyle( style.getName(), (parentTableLevel>0) );
@Override public boolean equals(Object o) { if (!(o instanceof StyleSheet)) return false; StyleSheet ss = (StyleSheet) o; if (!ss._stshif.equals(this._stshif) || ss._cbStshi != this._cbStshi || ss._styleDescriptions.length != this._styleDescriptions.length ) return false; for (int i = 0; i < _styleDescriptions.length; i++) { StyleDescription tsd = this._styleDescriptions[i]; StyleDescription osd = ss._styleDescriptions[i]; if (tsd == null && osd == null) continue; if (tsd == null || osd == null || !osd.equals(tsd)) return false; } return true; }
@Deprecated public CharacterProperties getCharacterStyle(int styleIndex) { if (styleIndex == NIL_STYLE) { return NIL_CHP; } if (styleIndex >= _styleDescriptions.length) { return NIL_CHP; } if (styleIndex == -1) { return NIL_CHP; } return (_styleDescriptions[styleIndex] != null ? _styleDescriptions[styleIndex] .getCHP() : NIL_CHP); }
private void dumpStyles() { if ( _doc instanceof HWPFOldDocument ) { System.out.println( "Word 95 not supported so far" ); return; } HWPFDocument hwpfDocument = (HWPFDocument) _doc; for ( int s = 0; s < hwpfDocument.getStyleSheet().numStyles(); s++ ) { StyleDescription styleDescription = hwpfDocument.getStyleSheet() .getStyleDescription( s ); if ( styleDescription == null ) continue; System.out.println( "=== Style #" + s + " '" + styleDescription.getName() + "' ===" ); System.out.println( styleDescription ); if ( styleDescription.getPAPX() != null ) dumpSprms( new SprmIterator( styleDescription.getPAPX(), 2 ), "Style's PAP SPRM: " ); if ( styleDescription.getCHPX() != null ) dumpSprms( new SprmIterator( styleDescription.getCHPX(), 0 ), "Style's CHP SPRM: " ); } }
private void createPap(int istd) { StyleDescription sd = _styleDescriptions[istd]; ParagraphProperties pap = sd.getPAP(); byte[] papx = sd.getPAPX(); int baseIndex = sd.getBaseStyle(); if (pap == null && papx != null) { ParagraphProperties parentPAP = new ParagraphProperties(); if (baseIndex != NIL_STYLE) { parentPAP = _styleDescriptions[baseIndex].getPAP(); if (parentPAP == null) { if (baseIndex == istd) { parentPAP = _styleDescriptions[baseIndex].getPAP(); sd.setPAP(pap);
public byte[] getCHPX(int styleIndex) { if (styleIndex == NIL_STYLE) { return NIL_CHPX; } if (styleIndex >= _styleDescriptions.length) { return NIL_CHPX; } if (styleIndex == -1) { return NIL_CHPX; } if (_styleDescriptions[styleIndex] == null) { return NIL_CHPX; } if (_styleDescriptions[styleIndex].getCHPX() == null) { return NIL_CHPX; } return _styleDescriptions[styleIndex].getCHPX(); }
@Deprecated public ParagraphProperties getParagraphStyle(int styleIndex) { if (styleIndex == NIL_STYLE) { return NIL_PAP; } if (styleIndex >= _styleDescriptions.length) { return NIL_PAP; } if (styleIndex == -1) { return NIL_PAP; } if (_styleDescriptions[styleIndex] == null) { return NIL_PAP; } if (_styleDescriptions[styleIndex].getPAP() == null) { return NIL_PAP; } return _styleDescriptions[styleIndex].getPAP(); }
public byte[] getPAPX(int styleIndex) { if (styleIndex == NIL_STYLE) { return NIL_PAPX; } if (styleIndex >= _styleDescriptions.length) { return NIL_PAPX; } if (styleIndex == -1) { return NIL_PAPX; } if (_styleDescriptions[styleIndex] == null) { return NIL_PAPX; } if (_styleDescriptions[styleIndex].getPAPX() == null) { return NIL_PAPX; } return _styleDescriptions[styleIndex].getPAPX(); } }
StyleDescription aStyle = new StyleDescription(tableStream, _stshif.getCbSTDBaseInFile(), offset, true);
private void dumpStyles() { if ( _doc instanceof HWPFOldDocument ) { System.out.println( "Word 95 not supported so far" ); return; } HWPFDocument hwpfDocument = (HWPFDocument) _doc; for ( int s = 0; s < hwpfDocument.getStyleSheet().numStyles(); s++ ) { StyleDescription styleDescription = hwpfDocument.getStyleSheet() .getStyleDescription( s ); if ( styleDescription == null ) continue; System.out.println( "=== Style #" + s + " '" + styleDescription.getName() + "' ===" ); System.out.println( styleDescription ); if ( styleDescription.getPAPX() != null ) dumpSprms( new SprmIterator( styleDescription.getPAPX(), 2 ), "Style's PAP SPRM: " ); if ( styleDescription.getCHPX() != null ) dumpSprms( new SprmIterator( styleDescription.getCHPX(), 0 ), "Style's CHP SPRM: " ); } }
ParagraphProperties pap = sd.getPAP(); byte[] papx = sd.getPAPX(); int baseIndex = sd.getBaseStyle(); if(pap == null && papx != null) parentPAP = _styleDescriptions[baseIndex].getPAP(); if(parentPAP == null) { if(baseIndex == istd) { parentPAP = _styleDescriptions[baseIndex].getPAP(); sd.setPAP(pap);
private void createChp(int istd) { StyleDescription sd = _styleDescriptions[istd]; CharacterProperties chp = sd.getCHP(); byte[] chpx = sd.getCHPX(); int baseIndex = sd.getBaseStyle(); CharacterProperties parentCHP = new CharacterProperties(); if (baseIndex != NIL_STYLE) { parentCHP = _styleDescriptions[baseIndex].getCHP(); if (parentCHP == null) { createChp(baseIndex); parentCHP = _styleDescriptions[baseIndex].getCHP(); sd.setCHP(chp);
public byte[] getCHPX( int styleIndex ) { if ( styleIndex == NIL_STYLE ) { return NIL_CHPX; } if ( styleIndex >= _styleDescriptions.length ) { return NIL_CHPX; } if ( _styleDescriptions[styleIndex] == null ) { return NIL_CHPX; } if ( _styleDescriptions[styleIndex].getCHPX() == null ) { return NIL_CHPX; } return _styleDescriptions[styleIndex].getCHPX(); }
@Deprecated public ParagraphProperties getParagraphStyle( int styleIndex ) { if ( styleIndex == NIL_STYLE ) { return NIL_PAP; } if ( styleIndex >= _styleDescriptions.length ) { return NIL_PAP; } if ( _styleDescriptions[styleIndex] == null ) { return NIL_PAP; } if ( _styleDescriptions[styleIndex].getPAP() == null ) { return NIL_PAP; } return _styleDescriptions[styleIndex].getPAP(); }
public byte[] getPAPX( int styleIndex ) { if ( styleIndex == NIL_STYLE ) { return NIL_PAPX; } if ( styleIndex >= _styleDescriptions.length ) { return NIL_PAPX; } if ( _styleDescriptions[styleIndex] == null ) { return NIL_PAPX; } if ( _styleDescriptions[styleIndex].getPAPX() == null ) { return NIL_PAPX; } return _styleDescriptions[styleIndex].getPAPX(); } }
StyleDescription aStyle = new StyleDescription(tableStream, _stshif.getCbSTDBaseInFile(), offset, true);
StyleDescription style = document.getStyleSheet().getStyleDescription(p.getStyleIndex()); if (style != null && style.getName() != null && style.getName().length() > 0) { if (p.isInList()) { numbering = listManager.getFormattedNumber(p); tas = buildParagraphTagAndStyle(style.getName(), (parentTableLevel > 0)); } else { tas = new TagAndStyle("p", null);
@Deprecated public CharacterProperties getCharacterStyle( int styleIndex ) { if ( styleIndex == NIL_STYLE ) { return NIL_CHP; } if ( styleIndex >= _styleDescriptions.length ) { return NIL_CHP; } return ( _styleDescriptions[styleIndex] != null ? _styleDescriptions[styleIndex] .getCHP() : NIL_CHP ); }
public boolean equals(Object o) { StyleSheet ss = (StyleSheet)o; if (ss._stshif.equals( this._stshif ) && ss._cbStshi == _cbStshi) { if (ss._styleDescriptions.length == _styleDescriptions.length) { for (int x = 0; x < _styleDescriptions.length; x++) { // check for null if (ss._styleDescriptions[x] != _styleDescriptions[x]) { // check for equality if (!ss._styleDescriptions[x].equals(_styleDescriptions[x])) { return false; } } } return true; } } return false; } /**