forked from amazingfate/loongoffice
Many methods will require a "TextRange" as argument.
A textrange is a shortcut describing the scope
on which to apply the method.
Such a textrange corresponds either with a single
insertion point or with a (text) interval between
2 insertion points.
Multiple textranges are not supported in this context.
TextRange = a string containing one of next variants :
(names may be surrounded with single or double quotes)
"~" or "SELECTION" or "SEL" = current selection
(if multiple selections, its 1st component)
"BODY" = the main text of the actual document instance
"FRAME!name" = the text contained in a text frame
"BOOKMARK!name" = the given bookmark,
may be zero or more characters long
"FIELD!name" = a user text field
"SECTION!name" = the text contained in a section
"TABLE!name!cellrange" = a cell (cellrange = "B3")
"WORD+n" = n words after the current selection
"SENTENCE-n" = n sentences before the current selection
"PARAGRAPH" or "§" = the paragraph containing
the current selection (+0 is the default)
optionally combined with next control character:
"|": start or end of string
E.g.
"|~" = the point immediately before the current visible
selection (starting point)
"~|" = the point immediately after the current visible
selection (ending point)
"~", "|~|" = the full visible selection
Implemented properties in this commit:
Bookmarks
CurrentSelection
Fields
Frames
(More will follow)
Example: doc.CurrentSelection = "SECTION!sect01|"
=> the visible cursor is set at the end
of the given section
Change-Id: Ib2a2110e25b0a15cd95c782f6ba8b0db1052bf39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171832
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>