You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ha...@apache.org on 2015/01/14 09:20:05 UTC

svn commit: r1651591 - /openoffice/trunk/main/vcl/unx/gtk/window/gtkframe.cxx

Author: hanya
Date: Wed Jan 14 08:20:05 2015
New Revision: 1651591

URL: http://svn.apache.org/r1651591
Log:
#i125991# catch IndexOutOfBoundsException to avoid fatal error happen when input method is used on Gtk environment

Modified:
    openoffice/trunk/main/vcl/unx/gtk/window/gtkframe.cxx

Modified: openoffice/trunk/main/vcl/unx/gtk/window/gtkframe.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/unx/gtk/window/gtkframe.cxx?rev=1651591&r1=1651590&r2=1651591&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/unx/gtk/window/gtkframe.cxx (original)
+++ openoffice/trunk/main/vcl/unx/gtk/window/gtkframe.cxx Wed Jan 14 08:20:05 2015
@@ -3749,18 +3749,26 @@ uno::Reference<accessibility::XAccessibl
 			return uno::Reference<accessibility::XAccessibleEditableText>(xContext, uno::UNO_QUERY);
 	}
 
-	for (sal_Int32 i = 0; i < xContext->getAccessibleChildCount(); ++i)
-	{
-		uno::Reference< accessibility::XAccessible > xChild = xContext->getAccessibleChild(i);
-		if (!xChild.is())
-			continue;
-	    	uno::Reference< accessibility::XAccessibleContext > xChildContext = xChild->getAccessibleContext();
-		if (!xChildContext.is())
-			continue;
-		uno::Reference< accessibility::XAccessibleEditableText > xText = FindFocus(xChildContext);
-		if (xText.is())
-			return xText;
-	}
+    try
+    {
+        for (sal_Int32 i = 0, n = xContext->getAccessibleChildCount(); i < n; ++i)
+        {
+            uno::Reference< accessibility::XAccessible > xChild = xContext->getAccessibleChild(i);
+            if (!xChild.is())
+                continue;
+                uno::Reference< accessibility::XAccessibleContext > xChildContext = xChild->getAccessibleContext();
+            if (!xChildContext.is())
+                continue;
+            uno::Reference< accessibility::XAccessibleEditableText > xText = FindFocus(xChildContext);
+            if (xText.is())
+                return xText;
+        }
+    }
+    catch( lang::IndexOutOfBoundsException & e )
+    {
+        OSL_TRACE( "GtkFrame FindFocus, %s", ::rtl::OUStringToOString(
+                e.Message, RTL_TEXTENCODING_UTF8 ).pData->buffer );
+    }
 	return uno::Reference< accessibility::XAccessibleEditableText >();
 }