From 86c86413ad3401989755e9e29327185544c95593 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 18 Apr 2017 09:15:23 +0100 Subject: catch exception like text_wrapper_get_caret_offset does Change-Id: I7d681a5cd58af60005eefa9969ec975d5cfc5580 (cherry picked from commit 0d2a607a849e3f1b51092c7d96bc5529420cfab2) Reviewed-on: https://gerrit.libreoffice.org/36636 Reviewed-by: Michael Stahl Tested-by: Michael Stahl (cherry picked from commit e8ee69d9557887c1736c50bdb11a875c8c126cc0) --- vcl/unx/gtk/a11y/atkutil.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 9b5bbd0ca674..2d807769e1ab 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -90,7 +90,14 @@ atk_wrapper_focus_idle_handler (gpointer data) wrapper_obj->mpText.set(wrapper_obj->mpContext, css::uno::UNO_QUERY); if ( wrapper_obj->mpText.is() ) { - gint caretPos = wrapper_obj->mpText->getCaretPosition(); + gint caretPos = -1; + + try { + caretPos = wrapper_obj->mpText->getCaretPosition(); + } + catch(const uno::Exception&) { + g_warning( "Exception in getCaretPosition()" ); + } if ( caretPos != -1 ) { -- cgit