Requires functional XTextViewCursor.
Problem: for multicolumn layout and when viewing pages side-by-side in LO, the (top-down,left-to-right) order interpreted as-on-the-screen: an XTextRange at the top of the second column or second page is sorted before an XTextRange at the bottom of the first column of the first page.
| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static <T> int | |
| private static com. | findPositionOfTextRange(com.
Location. range,To get the position, we need az XTextViewCursor. It will be moved to the range. cursorGiven a location, return its position: coordinates relative to the top left position of the first page of the document. |
| public static <T> List | Returns: The input, sorted by the elements XTextRange and getIndexInPosition.Sort the input |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| RangeSortVisual | back to summary |
|---|---|
| private RangeSortVisual() | |
| compareTopToBottomLeftToRight | back to summary |
|---|---|
| private static <T> int compareTopToBottomLeftToRight(RangeSortVisual. | |
| findPositionOfTextRange | back to summary |
|---|---|
| private static com. Given a location, return its position: coordinates relative to the top left position of the first page of the document. Note for text layouts with two or more columns, this gives the wrong order: top-down/left-to-right does not match reading order. Note The "relative to the top left position of the first page" is meant "as it appears on the screen". In particular: when viewing pages side-by-side, the top half of the right page is higher than the lower half of the left page. Again, top-down/left-to-right does not match reading order.
| |
| visualSort | back to summary |
|---|---|
| public static <T> List Sort the input Requires a functional
| |
Comparison is based on (Y,X,indexInPosition): vertical compared first, horizontal second, indexInPosition third.
Used for sorting reference marks by their visual positions.
| Modifier and Type | Field and Description |
|---|---|
| private final T | |
| private final int | indexInPosition
Record Component accessed by indexInPosition(). |
| private final com. | position
Record Component accessed by position(). |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public T | |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public int | |
| public com. | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| content | back to summary |
|---|---|
| private final T content Record Component accessed by content(). | |
| indexInPosition | back to summary |
|---|---|
| private final int indexInPosition Record Component accessed by indexInPosition(). | |
| position | back to summary |
|---|---|
| private final com. Record Component accessed by position(). | |
| ComparableMark | back to summary |
|---|---|
| private ComparableMark(com. | |
| content | back to summary |
|---|---|
| public T content() Record Component getter of content. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| indexInPosition | back to summary |
|---|---|
| public int indexInPosition() Record Component getter of indexInPosition. | |
| position | back to summary |
|---|---|
| public com. Record Component getter of position. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |