Skip to content

Don't use text offset of 1 for empty text

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.

Merge request reports