} catch(com.sun.star.lang.IllegalArgumentException e){
e.printStackTrace(log);
throw new StatusException("Couldn't get HeaderContent", e);
}
XText center = RPHC.getCenterText();
XTextRange text_to_move = null;
log.println( "inserting some lines" );
try {
XTextCursor oCursor = center.createTextCursor();
center.insertControlCharacter(
oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
center.insertControlCharacter(
oCursor, ControlCharacter.LINE_BREAK, false );
center.insertString(oCursor,"Paragraph 1", false);
center.insertString(oCursor,": ScHeaderFooterTextObj", false);
center.insertControlCharacter(
oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
center.insertString(oCursor, "THE QUICK BROWN FOX JUMPS OVER THE" +
" LAZY DOG: ScHeaderFooterTextObj", false );
center.insertControlCharacter(
oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
center.insertControlCharacter(
oCursor, ControlCharacter.LINE_BREAK, false );
oCursor.setString("TextForMove");
text_to_move = oCursor;
XTextCursor oCursor1 = center.createTextCursorByRange(center.getEnd());
center.insertString(oCursor1,"Paragraph 2", false);
center.insertString(oCursor1,": ScHeaderFooterTextObj", false);
center.insertControlCharacter(
oCursor1, ControlCharacter.PARAGRAPH_BREAK, false );
center.insertString( oCursor1, "THE QUICK BROWN FOX JUMPS OVER THE" +
" LAZY DOG: ScHeaderFooterTextObj", false);
center.insertControlCharacter(
oCursor1, ControlCharacter.PARAGRAPH_BREAK, false );
center.insertControlCharacter(
oCursor1, ControlCharacter.LINE_BREAK, false );
} catch(com.sun.star.lang.IllegalArgumentException e){
e.printStackTrace(log);
throw new StatusException("Couldn't insert Text ", e);
}