summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2011-12-21 21:57:16 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2011-12-21 21:57:54 +0900
commit7958f8244cc3e554b1339b14c7e589dfcbb0526c (patch)
tree8654a25c98b3338cc9f8c4377c89d4dce06387ad /pyuno
parent7167559379cd44e0160ba20c69cbb6954887e32b (diff)
catch exception by constant reference
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/source/module/pyuno.cxx28
-rw-r--r--pyuno/source/module/pyuno_adapter.cxx10
-rw-r--r--pyuno/source/module/pyuno_callable.cxx8
-rw-r--r--pyuno/source/module/pyuno_except.cxx6
-rw-r--r--pyuno/source/module/pyuno_gc.cxx2
-rw-r--r--pyuno/source/module/pyuno_module.cxx38
-rw-r--r--pyuno/source/module/pyuno_runtime.cxx4
-rw-r--r--pyuno/source/module/pyuno_type.cxx6
8 files changed, 51 insertions, 51 deletions
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index 2bfbe7b64002..fa7904b95542 100644
--- a/pyuno/source/module/pyuno.cxx
+++ b/pyuno/source/module/pyuno.cxx
@@ -387,19 +387,19 @@ PyObject *PyUNO_invoke( PyObject *object, const char *name , PyObject *args )
}
ret = PyRef( PyObject_CallObject( callable.get(), paras.get() ), SAL_NO_ACQUIRE );
}
- catch (::com::sun::star::lang::IllegalArgumentException &e)
+ catch (const ::com::sun::star::lang::IllegalArgumentException &e)
{
raisePyExceptionWithAny( com::sun::star::uno::makeAny( e ) );
}
- catch (::com::sun::star::script::CannotConvertException &e)
+ catch (const ::com::sun::star::script::CannotConvertException &e)
{
raisePyExceptionWithAny( com::sun::star::uno::makeAny( e ) );
}
- catch (::com::sun::star::uno::RuntimeException &e)
+ catch (const ::com::sun::star::uno::RuntimeException &e)
{
raisePyExceptionWithAny( com::sun::star::uno::makeAny( e ) );
}
- catch (::com::sun::star::uno::Exception &e)
+ catch (const ::com::sun::star::uno::Exception &e)
{
raisePyExceptionWithAny( com::sun::star::uno::makeAny( e ) );
}
@@ -524,23 +524,23 @@ PyObject* PyUNO_getattr (PyObject* self, char* name)
//or else...
PyErr_SetString (PyExc_AttributeError, name);
}
- catch( com::sun::star::reflection::InvocationTargetException & e )
+ catch( const com::sun::star::reflection::InvocationTargetException & e )
{
raisePyExceptionWithAny( makeAny(e.TargetException) );
}
- catch( com::sun::star::beans::UnknownPropertyException & e )
+ catch( const com::sun::star::beans::UnknownPropertyException & e )
{
raisePyExceptionWithAny( makeAny(e) );
}
- catch( com::sun::star::lang::IllegalArgumentException &e )
+ catch( const com::sun::star::lang::IllegalArgumentException &e )
{
raisePyExceptionWithAny( makeAny(e) );
}
- catch( com::sun::star::script::CannotConvertException &e )
+ catch( const com::sun::star::script::CannotConvertException &e )
{
raisePyExceptionWithAny( makeAny(e) );
}
- catch( RuntimeException &e )
+ catch( const RuntimeException &e )
{
raisePyExceptionWithAny( makeAny(e) );
}
@@ -568,22 +568,22 @@ int PyUNO_setattr (PyObject* self, char* name, PyObject* value)
}
}
}
- catch( com::sun::star::reflection::InvocationTargetException & e )
+ catch( const com::sun::star::reflection::InvocationTargetException & e )
{
raisePyExceptionWithAny( makeAny(e.TargetException) );
return 1;
}
- catch( com::sun::star::beans::UnknownPropertyException & e )
+ catch( const com::sun::star::beans::UnknownPropertyException & e )
{
raisePyExceptionWithAny( makeAny(e) );
return 1;
}
- catch( com::sun::star::script::CannotConvertException &e )
+ catch( const com::sun::star::script::CannotConvertException &e )
{
raisePyExceptionWithAny( makeAny(e) );
return 1;
}
- catch( RuntimeException & e )
+ catch( const RuntimeException & e )
{
raisePyExceptionWithAny( makeAny( e ) );
return 1;
@@ -637,7 +637,7 @@ static PyObject* PyUNO_cmp( PyObject *self, PyObject *that, int op )
}
}
}
- catch( com::sun::star::uno::RuntimeException & e)
+ catch( const com::sun::star::uno::RuntimeException & e)
{
raisePyExceptionWithAny( makeAny( e ) );
}
diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx
index df3f9fae5443..cfce2212b74f 100644
--- a/pyuno/source/module/pyuno_adapter.cxx
+++ b/pyuno/source/module/pyuno_adapter.cxx
@@ -321,7 +321,7 @@ Any Adapter::invoke( const OUString &aFunctionName,
}
}
- catch(InvocationTargetException & e )
+ catch( const InvocationTargetException & e )
{
if( isLog( cargo, LogLevel::CALL ) )
{
@@ -332,7 +332,7 @@ Any Adapter::invoke( const OUString &aFunctionName,
}
throw;
}
- catch( RuntimeException & e )
+ catch( const RuntimeException & e )
{
if( cargo && isLog( cargo, LogLevel::CALL ) )
{
@@ -342,7 +342,7 @@ Any Adapter::invoke( const OUString &aFunctionName,
}
throw;
}
- catch( CannotConvertException & e )
+ catch( const CannotConvertException & e )
{
if( isLog( cargo, LogLevel::CALL ) )
{
@@ -352,7 +352,7 @@ Any Adapter::invoke( const OUString &aFunctionName,
}
throw;
}
- catch( IllegalArgumentException & e )
+ catch( const IllegalArgumentException & e )
{
if( isLog( cargo, LogLevel::CALL ) )
{
@@ -387,7 +387,7 @@ void Adapter::setValue( const OUString & aPropertyName, const Any & value )
raiseInvocationTargetExceptionWhenNeeded( runtime);
}
- catch( IllegalArgumentException & exc )
+ catch( const IllegalArgumentException & exc )
{
throw InvocationTargetException( exc.Message, *this, com::sun::star::uno::makeAny( exc ) );
}
diff --git a/pyuno/source/module/pyuno_callable.cxx b/pyuno/source/module/pyuno_callable.cxx
index e5c943fa7022..a4a5b12acfb1 100644
--- a/pyuno/source/module/pyuno_callable.cxx
+++ b/pyuno/source/module/pyuno_callable.cxx
@@ -152,7 +152,7 @@ PyObject* PyUNO_callable_call (PyObject* self, PyObject* args, PyObject*)
ret = temp;
}
}
- catch( com::sun::star::reflection::InvocationTargetException & e )
+ catch( const com::sun::star::reflection::InvocationTargetException & e )
{
if( isLog( cargo, LogLevel::CALL ) )
@@ -162,7 +162,7 @@ PyObject* PyUNO_callable_call (PyObject* self, PyObject* args, PyObject*)
}
raisePyExceptionWithAny( e.TargetException );
}
- catch( com::sun::star::script::CannotConvertException &e )
+ catch( const com::sun::star::script::CannotConvertException &e )
{
if( isLog( cargo, LogLevel::CALL ) )
{
@@ -171,7 +171,7 @@ PyObject* PyUNO_callable_call (PyObject* self, PyObject* args, PyObject*)
}
raisePyExceptionWithAny( com::sun::star::uno::makeAny( e ) );
}
- catch( com::sun::star::lang::IllegalArgumentException &e )
+ catch( const com::sun::star::lang::IllegalArgumentException &e )
{
if( isLog( cargo, LogLevel::CALL ) )
{
@@ -180,7 +180,7 @@ PyObject* PyUNO_callable_call (PyObject* self, PyObject* args, PyObject*)
}
raisePyExceptionWithAny( com::sun::star::uno::makeAny( e ) );
}
- catch (::com::sun::star::uno::RuntimeException &e)
+ catch (const ::com::sun::star::uno::RuntimeException &e)
{
if( cargo && isLog( cargo, LogLevel::CALL ) )
{
diff --git a/pyuno/source/module/pyuno_except.cxx b/pyuno/source/module/pyuno_except.cxx
index f36cb0ab13ae..10882af2308b 100644
--- a/pyuno/source/module/pyuno_except.cxx
+++ b/pyuno/source/module/pyuno_except.cxx
@@ -72,17 +72,17 @@ void raisePyExceptionWithAny( const com::sun::star::uno::Any &anyExc )
OUStringToOString(buf.makeStringAndClear(),RTL_TEXTENCODING_ASCII_US).getStr() );
}
}
- catch( com::sun::star::lang::IllegalArgumentException & e)
+ catch(const com::sun::star::lang::IllegalArgumentException & e)
{
PyErr_SetString( PyExc_SystemError,
OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US).getStr() );
}
- catch( com::sun::star::script::CannotConvertException & e)
+ catch(const com::sun::star::script::CannotConvertException & e)
{
PyErr_SetString( PyExc_SystemError,
OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US).getStr() );
}
- catch( RuntimeException & e)
+ catch(const RuntimeException & e)
{
PyErr_SetString( PyExc_SystemError,
OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US).getStr() );
diff --git a/pyuno/source/module/pyuno_gc.cxx b/pyuno/source/module/pyuno_gc.cxx
index 77eb6885d04e..61eaabafe7f6 100644
--- a/pyuno/source/module/pyuno_gc.cxx
+++ b/pyuno/source/module/pyuno_gc.cxx
@@ -87,7 +87,7 @@ void GCThread::run()
Py_XDECREF( mPyObject );
}
}
- catch( com::sun::star::uno::RuntimeException & e )
+ catch( const com::sun::star::uno::RuntimeException & e )
{
rtl::OString msg;
msg = rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US );
diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx
index 07659aabc51f..f02cec84e3a0 100644
--- a/pyuno/source/module/pyuno_module.cxx
+++ b/pyuno/source/module/pyuno_module.cxx
@@ -306,26 +306,26 @@ static PyObject* getComponentContext (PyObject*, PyObject*)
Runtime runtime;
ret = runtime.any2PyObject( makeAny( ctx ) );
}
- catch (com::sun::star::registry::InvalidRegistryException &e)
+ catch (const com::sun::star::registry::InvalidRegistryException &e)
{
// can't use raisePyExceptionWithAny() here, because the function
// does any conversions, which will not work with a
// wrongly bootstrapped pyuno!
raisePySystemException( "InvalidRegistryException", e.Message );
}
- catch( com::sun::star::lang::IllegalArgumentException & e)
+ catch(const com::sun::star::lang::IllegalArgumentException & e)
{
raisePySystemException( "IllegalArgumentException", e.Message );
}
- catch( com::sun::star::script::CannotConvertException & e)
+ catch(const com::sun::star::script::CannotConvertException & e)
{
raisePySystemException( "CannotConvertException", e.Message );
}
- catch (com::sun::star::uno::RuntimeException & e)
+ catch (const com::sun::star::uno::RuntimeException & e)
{
raisePySystemException( "RuntimeException", e.Message );
}
- catch (com::sun::star::uno::Exception & e)
+ catch (const com::sun::star::uno::Exception & e)
{
raisePySystemException( "uno::Exception", e.Message );
}
@@ -424,15 +424,15 @@ static PyObject *createUnoStructHelper(PyObject *, PyObject* args, PyObject* key
PyErr_SetString (PyExc_AttributeError, "pyuno._createUnoStructHelper: expects exactly two non-keyword arguments:\n\tStructure Name\n\tinitialiser tuple; may be the empty tuple");
}
}
- catch( com::sun::star::uno::RuntimeException & e )
+ catch( const com::sun::star::uno::RuntimeException & e )
{
raisePyExceptionWithAny( makeAny( e ) );
}
- catch( com::sun::star::script::CannotConvertException & e )
+ catch( const com::sun::star::script::CannotConvertException & e )
{
raisePyExceptionWithAny( makeAny( e ) );
}
- catch( com::sun::star::uno::Exception & e )
+ catch( const com::sun::star::uno::Exception & e )
{
raisePyExceptionWithAny( makeAny( e ) );
}
@@ -465,7 +465,7 @@ static PyObject *getTypeByName( PyObject *, PyObject *args )
}
}
}
- catch ( RuntimeException & e )
+ catch ( const RuntimeException & e )
{
raisePyExceptionWithAny( makeAny( e ) );
}
@@ -498,22 +498,22 @@ static PyObject *getConstantByName( PyObject *, PyObject *args )
ret = constant.getAcquired();
}
}
- catch( NoSuchElementException & e )
+ catch( const NoSuchElementException & e )
{
// to the python programmer, this is a runtime exception,
// do not support tweakings with the type system
RuntimeException runExc( e.Message, Reference< XInterface > () );
raisePyExceptionWithAny( makeAny( runExc ) );
}
- catch( com::sun::star::script::CannotConvertException & e)
+ catch(const com::sun::star::script::CannotConvertException & e)
{
raisePyExceptionWithAny( makeAny( e ) );
}
- catch( com::sun::star::lang::IllegalArgumentException & e)
+ catch(const com::sun::star::lang::IllegalArgumentException & e)
{
raisePyExceptionWithAny( makeAny( e ) );
}
- catch( RuntimeException & e )
+ catch( const RuntimeException & e )
{
raisePyExceptionWithAny( makeAny(e) );
}
@@ -535,7 +535,7 @@ static PyObject *checkType( PyObject *, PyObject *args )
{
PyType2Type( obj );
}
- catch( RuntimeException & e)
+ catch(const RuntimeException & e)
{
raisePyExceptionWithAny( makeAny( e ) );
return NULL;
@@ -559,7 +559,7 @@ static PyObject *checkEnum( PyObject *, PyObject *args )
{
PyEnum2Enum( obj );
}
- catch( RuntimeException & e)
+ catch(const RuntimeException & e)
{
raisePyExceptionWithAny( makeAny( e) );
return NULL;
@@ -583,7 +583,7 @@ static PyObject *getClass( PyObject *, PyObject *args )
Py_XINCREF( ret.get() );
return ret.get();
}
- catch( RuntimeException & e)
+ catch(const RuntimeException & e)
{
// NOOPT !!!
// gcc 3.2.3 crashes here in the regcomp test scenario
@@ -616,7 +616,7 @@ static PyObject * generateUuid( PyObject *, PyObject * )
Runtime runtime;
ret = runtime.any2PyObject( makeAny( seq ) );
}
- catch( RuntimeException & e )
+ catch( const RuntimeException & e )
{
raisePyExceptionWithAny( makeAny(e) );
}
@@ -753,7 +753,7 @@ static PyObject *getCurrentContext( PyObject *, PyObject * )
ret = runtime.any2PyObject(
makeAny( com::sun::star::uno::getCurrentContext() ) );
}
- catch( com::sun::star::uno::Exception & e )
+ catch( const com::sun::star::uno::Exception & e )
{
raisePyExceptionWithAny( makeAny( e ) );
}
@@ -794,7 +794,7 @@ static PyObject *setCurrentContext( PyObject *, PyObject * args )
PyExc_RuntimeError, buf.makeStringAndClear().getStr() );
}
}
- catch( com::sun::star::uno::Exception & e )
+ catch( const com::sun::star::uno::Exception & e )
{
raisePyExceptionWithAny( makeAny( e ) );
}
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index e15a72dd054a..21b63893323a 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -844,7 +844,7 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con
{
a = getImpl()->cargo->xTypeConverter->convertTo( a, t );
}
- catch( com::sun::star::uno::Exception & e )
+ catch( const com::sun::star::uno::Exception & e )
{
throw RuntimeException( e.Message, e.Context );
}
@@ -930,7 +930,7 @@ Any Runtime::extractUnoException( const PyRef & excType, const PyRef &excValue,
{
unoModule = impl->cargo->getUnoModule();
}
- catch (Exception ei)
+ catch (const Exception &ei)
{
e=ei;
}
diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx
index 8dac1a16e1fb..c1897640d441 100644
--- a/pyuno/source/module/pyuno_type.cxx
+++ b/pyuno/source/module/pyuno_type.cxx
@@ -348,15 +348,15 @@ PyObject *importToGlobal(PyObject *str, PyObject *dict, PyObject *target)
PyExc_RuntimeError,
OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US).getStr() );
}
- catch( com::sun::star::script::CannotConvertException & e )
+ catch( const com::sun::star::script::CannotConvertException & e )
{
raisePyExceptionWithAny( com::sun::star::uno::makeAny( e ) );
}
- catch( com::sun::star::lang::IllegalArgumentException & e )
+ catch( const com::sun::star::lang::IllegalArgumentException & e )
{
raisePyExceptionWithAny( com::sun::star::uno::makeAny( e ) );
}
- catch( RuntimeException &e )
+ catch( const RuntimeException &e )
{
raisePyExceptionWithAny( com::sun::star::uno::makeAny( e ));
}