private void dumpBookmarks() { if ( !( _doc instanceof HWPFDocument ) ) { System.out.println( "Word 95 not supported so far" ); return; } HWPFDocument document = (HWPFDocument) _doc; Bookmarks bookmarks = document.getBookmarks(); for ( int b = 0; b < bookmarks.getBookmarksCount(); b++ ) { Bookmark bookmark = bookmarks.getBookmark( b ); System.out.println( "[" + bookmark.getStart() + "; " + bookmark.getEnd() + "): " + bookmark.getName() ); } }
private void dumpBookmarks() { if ( !( _doc instanceof HWPFDocument ) ) { System.out.println( "Word 95 not supported so far" ); return; } HWPFDocument document = (HWPFDocument) _doc; Bookmarks bookmarks = document.getBookmarks(); for ( int b = 0; b < bookmarks.getBookmarksCount(); b++ ) { Bookmark bookmark = bookmarks.getBookmark( b ); System.out.println( "[" + bookmark.getStart() + "; " + bookmark.getEnd() + "): " + bookmark.getName() ); } }
( (BookmarksImpl) ( (HWPFDocument) _doc ).getBookmarks() ) .afterDelete( _start, ( _end - _start ) );
( (BookmarksImpl) ( (HWPFDocument) _doc ).getBookmarks() ) .afterDelete( _start, ( _end - _start ) );
/** * Inserts text onto the end of this range * * @param text * The text to insert * @return The character run the text was inserted into. */ public CharacterRun insertAfter( String text ) { initAll(); _text.insert( _end, text ); _doc.getCharacterTable().adjustForInsert( _charEnd - 1, text.length() ); _doc.getParagraphTable().adjustForInsert( _parEnd - 1, text.length() ); _doc.getSectionTable().adjustForInsert( _sectionEnd - 1, text.length() ); if ( _doc instanceof HWPFDocument ) { ( (BookmarksImpl) ( (HWPFDocument) _doc ).getBookmarks() ) .afterInsert( _end, text.length() ); } adjustForInsert( text.length() ); sanityCheck(); return getCharacterRun( numCharacterRuns() - 1 ); }
/** * Inserts text into the front of this range. * * @param text * The text to insert * @return The character run that text was inserted into. */ public CharacterRun insertBefore( String text ) { initAll(); _text.insert( _start, text ); _doc.getCharacterTable().adjustForInsert( _charStart, text.length() ); _doc.getParagraphTable().adjustForInsert( _parStart, text.length() ); _doc.getSectionTable().adjustForInsert( _sectionStart, text.length() ); if ( _doc instanceof HWPFDocument ) { ( (BookmarksImpl) ( (HWPFDocument) _doc ).getBookmarks() ) .afterInsert( _start, text.length() ); } adjustForInsert( text.length() ); // update the FIB.CCPText + friends fields adjustFIB( text.length() ); sanityCheck(); return getCharacterRun( 0 ); }
/** * Inserts text into the front of this range. * * @param text * The text to insert * @return The character run that text was inserted into. */ public CharacterRun insertBefore( String text ) { initAll(); _text.insert( _start, text ); _doc.getCharacterTable().adjustForInsert( _charStart, text.length() ); _doc.getParagraphTable().adjustForInsert( _parStart, text.length() ); _doc.getSectionTable().adjustForInsert( _sectionStart, text.length() ); if ( _doc instanceof HWPFDocument ) { ( (BookmarksImpl) ( (HWPFDocument) _doc ).getBookmarks() ) .afterInsert( _start, text.length() ); } adjustForInsert( text.length() ); // update the FIB.CCPText + friends fields adjustFIB( text.length() ); assert sanityCheck(); return getCharacterRun( 0 ); }
/** * Inserts text onto the end of this range * * @param text * The text to insert * @return The character run the text was inserted into. */ public CharacterRun insertAfter( String text ) { initAll(); _text.insert( _end, text ); _doc.getCharacterTable().adjustForInsert( _charEnd - 1, text.length() ); _doc.getParagraphTable().adjustForInsert( _parEnd - 1, text.length() ); _doc.getSectionTable().adjustForInsert( _sectionEnd - 1, text.length() ); if ( _doc instanceof HWPFDocument ) { ( (BookmarksImpl) ( (HWPFDocument) _doc ).getBookmarks() ) .afterInsert( _end, text.length() ); } adjustForInsert( text.length() ); assert sanityCheck(); return getCharacterRun( numCharacterRuns() - 1 ); }
Map<Integer, List<Bookmark>> rangeBookmarks = doc.getBookmarks() .getBookmarksStartedBetween( range.getStartOffset(), range.getEndOffset() ); .getBookmarks() .getBookmarksStartedBetween( structure.start, structure.start + 1 ).values().iterator()
Map<Integer, List<Bookmark>> rangeBookmarks = doc.getBookmarks() .getBookmarksStartedBetween( range.getStartOffset(), range.getEndOffset() ); .getBookmarks() .getBookmarksStartedBetween( structure.start, structure.start + 1 ).values().iterator()