summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-02 10:12:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-02 10:14:25 +0200
commit6af6a5fa3bf58e42bdaf693e8b5baf8961ce6311 (patch)
tree64e40fb5b2e3d1d4ac97c95907c31975350e7152
parent1e2bd1771808da00ec959995ab1284c6193a57f5 (diff)
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
-rw-r--r--sw/source/core/unocore/swunohelper.cxx17
1 files 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