From 6af6a5fa3bf58e42bdaf693e8b5baf8961ce6311 Mon Sep 17 00:00:00 2001
From: Noel Grandin <noel.grandin@collabora.co.uk>
Date: Thu, 2 Mar 2017 10:12:45 +0200
Subject: bypass exception throwing and catching

instead of needlessly catching the exception that
comphelper::getEnumAsINT32 generates, let's just call the same function
that comphelper::getEnumAsINT32 uses

Change-Id: Ibc7d79cc15c13d4124f5bd62a038804209cf5b07
---
 sw/source/core/unocore/swunohelper.cxx | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index 3e947d1cbde2..c6dd8fb5f20c 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -28,7 +28,7 @@
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <comphelper/processfactory.hxx>
-#include <comphelper/types.hxx>
+#include <comphelper/extract.hxx>
 #include <o3tl/any.hxx>
 #include <tools/urlobj.hxx>
 #include <tools/datetime.hxx>
@@ -50,17 +50,10 @@ namespace SWUnoHelper
 
 sal_Int32 GetEnumAsInt32( const css::uno::Any& rVal )
 {
-    sal_Int32 eVal;
-    try
-    {
-        eVal = comphelper::getEnumAsINT32( rVal );
-    }
-    catch( css::uno::Exception & )
-    {
-        eVal = 0;
-        OSL_FAIL( "can't get EnumAsInt32" );
-    }
-    return eVal;
+    sal_Int32 nReturn = 0;
+    if (! ::cppu::enum2int(nReturn,rVal) )
+         OSL_FAIL( "can't get EnumAsInt32" );
+    return nReturn;
 }
 
 // methods for UCB actions
-- 
cgit