vcl/unx/gtk3/a11y/gtk3atktext.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 607827d988f76988880a52ccb947231441cd1da7
Author:     Samuel Thibault <samuel.thiba...@ens-lyon.org>
AuthorDate: Tue Feb 25 22:19:26 2020 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Mon Mar 2 03:23:24 2020 +0100

    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.behr...@cib.de>

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() );
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to