fdo#74323: The end position is inclusive.

Change-Id: Ibd0ff19d7fd2de72a3b8d790a371da4b23df38c8
(cherry picked from commit b6378a1651e7157063746d7001ef566545338bd0)
Reviewed-on: https://gerrit.libreoffice.org/7961
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>