summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-02-25 22:19:26 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-03-02 03:23:24 +0100
commit607827d988f76988880a52ccb947231441cd1da7 (patch)
treee518705cdc9a9c10903a6a8c21a4ada8b48e3401 /vcl
parent53735aeb937d7f2c1ac5bc0227e4a2fdc24e4947 (diff)
gtk3 a11y: fix get_text(1,-1)
Even when the end offset is -1, we have to return the text starting a the given starting position, up to the end, but not necessarily from the beginning. Change-Id: I6a79092c683c273eaedb8661545df71b742110ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89486 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atktext.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/vcl/unx/gtk3/a11y/gtk3atktext.cxx b/vcl/unx/gtk3/a11y/gtk3atktext.cxx
index 1406ceea5544..f219efb90fef 100644
--- a/vcl/unx/gtk3/a11y/gtk3atktext.cxx
+++ b/vcl/unx/gtk3/a11y/gtk3atktext.cxx
@@ -250,10 +250,13 @@ text_wrapper_get_text (AtkText *text,
OUString aText;
sal_Int32 n = pText->getCharacterCount();
- if( -1 == end_offset )
- aText = pText->getText();
- else if( start_offset < n )
- aText = pText->getTextRange(start_offset, end_offset);
+ if( start_offset < n )
+ {
+ if( -1 == end_offset )
+ aText = pText->getTextRange(start_offset, n - start_offset);
+ else
+ aText = pText->getTextRange(start_offset, end_offset);
+ }
ret = g_strdup( OUStringToOString(aText, RTL_TEXTENCODING_UTF8 ).getStr() );
}