21.08.2013 Views

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - OpenOffice.org wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Editing Text Documents<br />

Cursor.goLeft(10, False)<br />

Cursor.goRight(3, False)<br />

A TextCursor can highlight a complete area. This can be compared with highlighting a point in the text using<br />

the mouse. The False parameter in the previous function call specifies whether the area passed over with the<br />

cursor movement is highlighted. For example, the TextCursor in the following example<br />

Cursor.goRight(10, False)<br />

Cursor.goLeft(3, True)<br />

first moves ten characters to the right without highlighting, and then moves back three characters and highlights<br />

this. The area highlighted by the TextCursor therefore begins after the seventh character in the text and ends<br />

after the tenth character.<br />

Here are the central methods that the com.sun.star.text.TextCursor service provides for navigation:<br />

goLeft (Count, Expand)<br />

jumps Count characters to the left.<br />

goRight (Count, Expand)<br />

jumps Count characters to the right.<br />

gotoStart (Expand)<br />

jumps to the start of the text document.<br />

gotoEnd (Expand)<br />

jumps to the end of the text document.<br />

gotoRange (TextRange, Expand)<br />

jumps to the specified TextRange-Object.<br />

gotoStartOfWord (Expand)<br />

jumps to the start of the current word.<br />

gotoEndOfWord (Expand)<br />

jumps to the end of the current word.<br />

gotoNextWord (Expand)<br />

jumps to the start of the next word.<br />

gotoPreviousWord (Expand)<br />

jumps to the start of the previous word.<br />

isStartOfWord ()<br />

returns True if the TextCursor is at the start of a word.<br />

isEndOfWord ()<br />

returns True if the TextCursor is at the end of a word.<br />

gotoStartOfSentence (Expand)<br />

jumps to the start of the current sentence.<br />

gotoEndOfSentence (Expand)<br />

jumps to the end of the current sentence.<br />

gotoNextSentence (Expand)<br />

jumps to the start of the next sentence.<br />

gotoPreviousSentence (Expand)<br />

jumps to the start of the previous sentence.<br />

isStartOfSentence ()<br />

returns True if the TextCursor is at the start of a sentence.<br />

76 <strong>OpenOffice</strong>.<strong>org</strong> 3.2 <strong>BASIC</strong> <strong>Guide</strong> · March 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!