explain briefly the various text editing features of openoffice.org .writer
Answers
Answered by
3
The previous section has already discussed a whole range of options for editing text documents, focusing on the services, which grant access to paragraph portions as well as paragraphs. These services are appropriate for applications in which the content of a text is to be edited in one pass through a loop. However, this is not sufficient for many problems. Apache OpenOffice provides the service for more complicated tasks, including navigating backward within a document or navigating based on sentences and words rather than TextPortions.
Contents
[hide]
1 The TextCursor
1.1 Navigating within a Text
1.2 Formatting Text with TextCursor
1.3 Retrieving and Modifying Text Contents
1.4 Inserting Control Codes
2 Searching for Text Portions
2.1 Example: Similarity Search
3 Replacing Text Portions
3.1 Example: searching and replacing text with regular expressions
The TextCursor
A TextCursor in the Apache OpenOffice API is comparable with the visible cursor used in a Apache OpenOffice document. It marks a certain point within a text document and can be navigated in various directions through the use of commands. The TextCursor objects available in Apache OpenOffice Basic should not, however, be confused with the visible cursor. These are two very different things.
VBA : Terminology differs from that used in VBA: In terms of scope of function, the Range object from VBA can be compared with the TextCursor object in Apache OpenOffice and not — as the name possibly suggests — with the Range object in Apache OpenOffice.
The TextCursor object in Apache OpenOffice, for example, provides methods for navigating and changing text which are included in the Range object in VBA (for example, MoveStart, MoveEnd, InsertBefore, InsertAfter). The corresponding counterparts of the TextCursor object in Apache OpenOffice are described in the following sections.
Navigating within a Text
The TextCursor object in Apache OpenOffice Basic acts independently from the visible cursor in a text document. A program-controlled position change of a TextCursor object has no impact whatsoever on the visible cursor. Several TextCursor objects can even be opened for the same document and used in various positions, which are independent of one another.
A TextCursor object is created using the createTextCursor call:
Dim Doc As Object Dim Cursor As Object Doc = ThisComponent Cursor = Doc.Text.createTextCursor()
The Cursor object created in this way supports the com.sun.star.text.TextCursor service, which in turn provides a whole range of methods for navigating within text documents. The following example first moves the TextCursor ten characters to the left and then three characters to the right:
Cursor.goLeft(10, False) Cursor.goRight(3, False)
A TextCursor can highlight a complete area. This can be compared with highlighting a point in the text using the mouse. The False parameter in the previous function call specifies whether the area passed over with the cursor movement is highlighted. For example, the TextCursor in the following example
Cursor.goRight(10, False) Cursor.goLeft(3, True)
first moves ten characters to the right without highlighting, and then moves back three characters and highlights this. The area highlighted by the TextCursortherefore begins after the seventh character in the text and ends after the tenth character.
Here are the central methods that the com.sun.star.text.TextCursor service provides for navigation:
goLeft (Count, Expand)jumps Count characters to the left.goRight (Count, Expand)jumps Count characters to the right.gotoStart (Expand)jumps to the start of the text document.gotoEnd (Expand)jumps to the end of the text document.gotoRange (TextRange, Expand)jumps to the specified TextRange-Object.gotoStartOfWord (Expand)jumps to the start of the current word.gotoEndOfWord (Expand)jumps to the end of the current word.gotoNextWord (Expand)jumps to the start of the next word.gotoPreviousWord (Expand)jumps to the start of the previous word.isStartOfWord ()returns True if the TextCursor is at the start of a word.isEndOfWord ()returns True if the TextCursor is at the end of a word.gotoStartOfSentence (Expand)jumps to the start of the current sentence.gotoEndOfSentence (Expand)jumps to the end of the current sentence.gotoNextSentence (Expand)jumps to the start of the next sentence.gotoPreviousSentence (Expand)jumps to the start of the previous sentence.isStartOfSentence ()returns True if the TextCursor is at the start of a sentence.isEndOfSentence ()returns True if the TextCursor is at the end of a sentence.gotoStartOfParagraph (Expand)jumps to the start of the current paragraph.gotoEndOfParagraph (Expand)jumps to the end of the current paragraph.gotoNextParagraph (Expand)jumps to the start of the next parag
Contents
[hide]
1 The TextCursor
1.1 Navigating within a Text
1.2 Formatting Text with TextCursor
1.3 Retrieving and Modifying Text Contents
1.4 Inserting Control Codes
2 Searching for Text Portions
2.1 Example: Similarity Search
3 Replacing Text Portions
3.1 Example: searching and replacing text with regular expressions
The TextCursor
A TextCursor in the Apache OpenOffice API is comparable with the visible cursor used in a Apache OpenOffice document. It marks a certain point within a text document and can be navigated in various directions through the use of commands. The TextCursor objects available in Apache OpenOffice Basic should not, however, be confused with the visible cursor. These are two very different things.
VBA : Terminology differs from that used in VBA: In terms of scope of function, the Range object from VBA can be compared with the TextCursor object in Apache OpenOffice and not — as the name possibly suggests — with the Range object in Apache OpenOffice.
The TextCursor object in Apache OpenOffice, for example, provides methods for navigating and changing text which are included in the Range object in VBA (for example, MoveStart, MoveEnd, InsertBefore, InsertAfter). The corresponding counterparts of the TextCursor object in Apache OpenOffice are described in the following sections.
Navigating within a Text
The TextCursor object in Apache OpenOffice Basic acts independently from the visible cursor in a text document. A program-controlled position change of a TextCursor object has no impact whatsoever on the visible cursor. Several TextCursor objects can even be opened for the same document and used in various positions, which are independent of one another.
A TextCursor object is created using the createTextCursor call:
Dim Doc As Object Dim Cursor As Object Doc = ThisComponent Cursor = Doc.Text.createTextCursor()
The Cursor object created in this way supports the com.sun.star.text.TextCursor service, which in turn provides a whole range of methods for navigating within text documents. The following example first moves the TextCursor ten characters to the left and then three characters to the right:
Cursor.goLeft(10, False) Cursor.goRight(3, False)
A TextCursor can highlight a complete area. This can be compared with highlighting a point in the text using the mouse. The False parameter in the previous function call specifies whether the area passed over with the cursor movement is highlighted. For example, the TextCursor in the following example
Cursor.goRight(10, False) Cursor.goLeft(3, True)
first moves ten characters to the right without highlighting, and then moves back three characters and highlights this. The area highlighted by the TextCursortherefore begins after the seventh character in the text and ends after the tenth character.
Here are the central methods that the com.sun.star.text.TextCursor service provides for navigation:
goLeft (Count, Expand)jumps Count characters to the left.goRight (Count, Expand)jumps Count characters to the right.gotoStart (Expand)jumps to the start of the text document.gotoEnd (Expand)jumps to the end of the text document.gotoRange (TextRange, Expand)jumps to the specified TextRange-Object.gotoStartOfWord (Expand)jumps to the start of the current word.gotoEndOfWord (Expand)jumps to the end of the current word.gotoNextWord (Expand)jumps to the start of the next word.gotoPreviousWord (Expand)jumps to the start of the previous word.isStartOfWord ()returns True if the TextCursor is at the start of a word.isEndOfWord ()returns True if the TextCursor is at the end of a word.gotoStartOfSentence (Expand)jumps to the start of the current sentence.gotoEndOfSentence (Expand)jumps to the end of the current sentence.gotoNextSentence (Expand)jumps to the start of the next sentence.gotoPreviousSentence (Expand)jumps to the start of the previous sentence.isStartOfSentence ()returns True if the TextCursor is at the start of a sentence.isEndOfSentence ()returns True if the TextCursor is at the end of a sentence.gotoStartOfParagraph (Expand)jumps to the start of the current paragraph.gotoEndOfParagraph (Expand)jumps to the end of the current paragraph.gotoNextParagraph (Expand)jumps to the start of the next parag
AryanReigns:
It deserves 50 points
Answered by
1
Explanation:
The above answer is correct...
PLEASE PLEASE PLEASE PLEASE... FOLLOW ME
Similar questions