public HWPFList( StyleSheet styleSheet, ListTables listTables, int ilfo ) { _listTables = listTables; _styleSheet = styleSheet; /* See documentation for sprmPIlfo (0x460B) */ if ( ilfo == 0 || ilfo == 0xF801 ) { throw new IllegalArgumentException( "Paragraph not in list" ); } else if ( 0x0001 <= ilfo && ilfo <= 0x07FE ) { _lfo = listTables.getLfo( ilfo ); _lfoData = listTables.getLfoData( ilfo ); } else if ( 0xF802 <= ilfo && ilfo <= 0xFFFF ) { int nilfo = ilfo ^ 0xFFFF; _lfo = listTables.getLfo( nilfo ); _lfoData = listTables.getLfoData( nilfo ); _ignoreLogicalLeftIdentation = true; } else { throw new IllegalArgumentException( "Incorrect ilfo: " + ilfo ); } _listData = listTables.getListData( _lfo.getLsid() ); }
public int registerList(HWPFList list) { if (_lt == null) { _lt = new ListTables(); } return _lt.addList(list.getListData(), list.getOverride()); }
ListData listData = listTables.getListData(paragraph.getList().getLsid()); if (listData == null) {
protected void dumpParagraphLevels( ListTables listTables, ParagraphProperties paragraph ) { if ( paragraph.getIlfo() != 0 ) { final LFO lfo = listTables.getLfo( paragraph.getIlfo() ); System.out.println( "PAP's LFO: " + lfo ); final LFOData lfoData = listTables.getLfoData( paragraph.getIlfo() ); System.out.println( "PAP's LFOData: " + lfoData ); if ( lfo != null ) { final ListLevel listLevel = listTables.getLevel( lfo.getLsid(), paragraph.getIlvl() ); System.out.println( "PAP's ListLevel: " + listLevel ); if ( listLevel.getGrpprlPapx() != null ) { System.out.println( "PAP's ListLevel PAPX:" ); dumpSprms( new SprmIterator( listLevel.getGrpprlPapx(), 0 ), "* " ); } if ( listLevel.getGrpprlPapx() != null ) { System.out.println( "PAP's ListLevel CHPX:" ); dumpSprms( new SprmIterator( listLevel.getGrpprlChpx(), 0 ), "* " ); } } } }
@Deprecated ListEntry(PAPX papx, Range parent, ListTables tables) { super(papx, parent); if(tables != null && _props.getIlfo() < tables.getOverrideCount()) { ListFormatOverride override = tables.getOverride(_props.getIlfo()); _overrideLevel = override.getOverrideLevel(_props.getIlvl()); _level = tables.getLevel(override.getLsid(), _props.getIlvl()); } else { log.log(POILogger.WARN, "No ListTables found for ListEntry - document probably partly corrupt, and you may experience problems"); } }
_lt.writeListDataTo( _fib, tableStream ); tableOffset = tableStream.size(); _lt.writeListOverridesTo( _fib, tableStream ); tableOffset = tableStream.size();
private LevelTuple[] buildOverrideTuples(Paragraph par, int length) { ListFormatOverrideLevel overrideLevel; // find the override for this level if (listTables.getLfoData(par.getIlfo()).getRgLfoLvl().length == 0) { return null; } overrideLevel = listTables.getLfoData(par.getIlfo()).getRgLfoLvl()[0]; if (overrideLevel == null) { return null; } LevelTuple[] levelTuples = new LevelTuple[length]; ListLevel listLevel = overrideLevel.getLevel(); if (listLevel == null) { return null; } for (int i = 0; i < length; i++) { levelTuples[i] = buildTuple(i, listLevel); } return levelTuples; }
protected void dumpParagraphLevels( ListTables listTables, ParagraphProperties paragraph ) { if ( paragraph.getIlfo() != 0 ) { final ListFormatOverride listFormatOverride = listTables .getOverride( paragraph.getIlfo() ); System.out.println( "PAP's LFO: " + listFormatOverride ); final ListLevel listLevel = listTables.getLevel( listFormatOverride.getLsid(), paragraph.getIlvl() ); System.out.println( "PAP's ListLevel: " + listLevel ); if ( listLevel.getGrpprlPapx() != null ) { System.out.println( "PAP's ListLevel PAPX:" ); dumpSprms( new SprmIterator( listLevel.getGrpprlPapx(), 0 ), "* " ); } if ( listLevel.getGrpprlPapx() != null ) { System.out.println( "PAP's ListLevel CHPX:" ); dumpSprms( new SprmIterator( listLevel.getGrpprlChpx(), 0 ), "* " ); } } }
/** * Inserts a list into the beginning of this range. * * @param props * The properties of the list entry. All list entries are * paragraphs. * @param listID * The id of the list that contains the properties. * @param level * The indentation level of the list. * @param styleIndex * The base style's index in the stylesheet. * @return The empty ListEntry that is now part of the document. * @deprecated Use code shall not work with {@link ParagraphProperties} */ @Deprecated public ListEntry insertAfter(ParagraphProperties props, int listID, int level, int styleIndex) { ListTables lt = _doc.getListTables(); if (lt.getLevel(listID, level) == null) { throw new NoSuchElementException("The specified list and level do not exist"); } int ilfo = lt.getOverrideIndexFromListID(listID); props.setIlfo(ilfo); props.setIlvl((byte) level); return (ListEntry) insertAfter(props, styleIndex); }
_lt = new ListTables( _tableStream, listOffset, _fib.getFcPlfLfo(), _fib.getLcbPlfLfo() );
ListData listdata = listtables.getListData(para.getIlfo());
@Internal ListEntry( PAPX papx, ParagraphProperties properties, Range parent ) { super( papx, properties, parent ); final ListTables tables = parent._doc.getListTables(); if ( tables != null && _props.getIlfo() < tables.getOverrideCount() ) { ListFormatOverride override = tables.getOverride( _props.getIlfo() ); _overrideLevel = override.getOverrideLevel( _props.getIlvl() ); _level = tables.getLevel( override.getLsid(), _props.getIlvl() ); } else { log.log( POILogger.WARN, "No ListTables found for ListEntry - document probably partly corrupt, " + "and you may experience problems" ); } }
_lt.writeListDataTo( _fib, tableStream ); tableOffset = tableStream.getOffset(); _lt.writeListOverridesTo( tableStream ); _fib.setLcbPlfLfo( tableStream.getOffset() - tableOffset ); tableOffset = tableStream.getOffset();
private LevelTuple[] buildOverrideTuples(Paragraph par, int length) { ListFormatOverrideLevel overrideLevel; // find the override for this level if (listTables.getLfoData(par.getIlfo()).getRgLfoLvl().length == 0) { return null; } overrideLevel = listTables.getLfoData(par.getIlfo()).getRgLfoLvl()[0]; if (overrideLevel == null) { return null; } LevelTuple[] levelTuples = new LevelTuple[length]; ListLevel listLevel = overrideLevel.getLevel(); if (listLevel == null) { return null; } for (int i = 0; i < length; i++) { levelTuples[i] = buildTuple(i, listLevel); } return levelTuples; }
.getOverride( properties.getIlfo() ); final ListLevel listLevel = listTables.getLevel( listFormatOverride.getLsid(), properties.getIlvl() );
/** * Inserts a list into the beginning of this range. * * @param props * The properties of the list entry. All list entries are * paragraphs. * @param listID * The id of the list that contains the properties. * @param level * The indentation level of the list. * @param styleIndex * The base style's index in the stylesheet. * @return The empty ListEntry that is now part of the document. * @deprecated Use code shall not work with {@link ParagraphProperties} */ @Deprecated public ListEntry insertBefore(ParagraphProperties props, int listID, int level, int styleIndex) { ListTables lt = _doc.getListTables(); if (lt.getLevel(listID, level) == null) { throw new NoSuchElementException("The specified list and level do not exist"); } int ilfo = lt.getOverrideIndexFromListID(listID); props.setIlfo(ilfo); props.setIlvl((byte) level); return (ListEntry) insertBefore(props, styleIndex); }
if (listOffset != 0 && _fib.getLcbPlcfLst() != 0) _lt = new ListTables(_tableStream, _fib.getFcPlcfLst(), _fib.getFcPlfLfo());
ListData listData = listTables.getListData(paragraph.getList().getLsid()); LevelTuple[] levelTuples = new LevelTuple[listData.getLevels().length]; for (int i = 0; i < listData.getLevels().length; i++) {