Don't use text offset of 1 for empty text
requested to merge michaelweghorn/orca:michaelweghorn/dont_use_invalid_offset_1_for_empty_text into master
When moving the text cursor to an empty paragraph in LibreOffice Writer, the AT-SPI GetText
method on LibreOffice side currently gets called with a start index of 0 and an end index of 1.
From what I can see, the AT-SPI doc doesn't explicitly mention allowed ranges, but since the end index is referring to "the first character past the desired range", using an index greater than the text length looks questionable to me. (But I'm happy to learn in case that's actually valid.)
This MR prevents an index of 1 being used in the case of empty text.