diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-11 16:36:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-12 08:54:15 +0200 |
commit | fa394eef4017d62549599ded3a62d790bc508582 (patch) | |
tree | dc23efda2c3e260af82487c1e3046451277efa6c /pyuno | |
parent | a267efe358cb788e0256feada268987ddbf9604f (diff) |
clang-tidy misc-throw-by-value-catch-by-reference
Change-Id: I04750771b63551fd3df522753a4ed21b8d5c42f3
Reviewed-on: https://gerrit.libreoffice.org/61680
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'pyuno')
-rw-r--r-- | pyuno/source/module/pyuno.cxx | 24 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_iterator.cxx | 2 |
2 files changed, 13 insertions, 13 deletions
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx index 434888f59e6e..a581d8335d76 100644 --- a/pyuno/source/module/pyuno.cxx +++ b/pyuno/source/module/pyuno.cxx @@ -871,11 +871,11 @@ static PyObject* PyUNO_getitem( PyObject *self, PyObject *pKey ) PyErr_SetString( PyExc_TypeError, "object is not subscriptable" ); } - catch( const css::lang::IndexOutOfBoundsException ) + catch( const css::lang::IndexOutOfBoundsException & ) { PyErr_SetString( PyExc_IndexError, "index out of range" ); } - catch( const css::container::NoSuchElementException ) + catch( const css::container::NoSuchElementException & ) { PyErr_SetString( PyExc_KeyError, "key not found" ); } @@ -920,7 +920,7 @@ static int lcl_setitem_index( PyUNO const *me, PyObject *pKey, PyObject *pValue { aValue = runtime.pyObject2Any( pValue ); } - catch ( const css::uno::RuntimeException ) + catch ( const css::uno::RuntimeException & ) { // TODO pyObject2Any can't convert e.g. dicts but only throws // RuntimeException on failure. Fixing this will require an audit of @@ -1041,7 +1041,7 @@ static int lcl_setitem_slice( PyUNO const *me, PyObject *pKey, PyObject *pValue { aItem = runtime.pyObject2Any( rItem.get() ); } - catch ( const css::uno::RuntimeException ) + catch ( const css::uno::RuntimeException & ) { // TODO pyObject2Any can't convert e.g. dicts but only throws // RuntimeException on failure. Fixing this will require an audit of @@ -1100,7 +1100,7 @@ static int lcl_setitem_string( PyUNO const *me, PyObject *pKey, PyObject *pValue { aValue = runtime.pyObject2Any( pValue ); } - catch( const css::uno::RuntimeException ) + catch( const css::uno::RuntimeException & ) { // TODO pyObject2Any can't convert e.g. dicts but only throws // RuntimeException on failure. Fixing this will require an audit of @@ -1136,7 +1136,7 @@ static int lcl_setitem_string( PyUNO const *me, PyObject *pKey, PyObject *pValue xNameContainer->insertByName( sKey, aValue ); return 0; } - catch( css::container::ElementExistException ) + catch( const css::container::ElementExistException & ) { // Fall through, try replace instead } @@ -1178,19 +1178,19 @@ static int PyUNO_setitem( PyObject *self, PyObject *pKey, PyObject *pValue ) PyErr_SetString( PyExc_TypeError, "list index has invalid type" ); } - catch( const css::lang::IndexOutOfBoundsException ) + catch( const css::lang::IndexOutOfBoundsException & ) { PyErr_SetString( PyExc_IndexError, "list index out of range" ); } - catch( const css::container::NoSuchElementException ) + catch( const css::container::NoSuchElementException & ) { PyErr_SetString( PyExc_KeyError, "key not found" ); } - catch( const css::lang::IllegalArgumentException ) + catch( const css::lang::IllegalArgumentException & ) { PyErr_SetString( PyExc_TypeError, "value has invalid type" ); } - catch( css::script::CannotConvertException ) + catch( const css::script::CannotConvertException & ) { PyErr_SetString( PyExc_TypeError, "value has invalid type" ); } @@ -1299,7 +1299,7 @@ static int PyUNO_contains( PyObject *self, PyObject *pKey ) { aValue = runtime.pyObject2Any( pKey ); } - catch( const css::uno::RuntimeException ) + catch( const css::uno::RuntimeException & ) { // TODO pyObject2Any can't convert e.g. dicts but only throws // RuntimeException on failure. Fixing this will require an audit of @@ -1347,7 +1347,7 @@ static int PyUNO_contains( PyObject *self, PyObject *pKey ) PyErr_SetString( PyExc_TypeError, "argument is not iterable" ); } - catch( const css::script::CannotConvertException ) + catch( const css::script::CannotConvertException& ) { PyErr_SetString( PyExc_TypeError, "invalid type passed as left argument to 'in'" ); } diff --git a/pyuno/source/module/pyuno_iterator.cxx b/pyuno/source/module/pyuno_iterator.cxx index 5847d881a90e..4868a12ee24f 100644 --- a/pyuno/source/module/pyuno_iterator.cxx +++ b/pyuno/source/module/pyuno_iterator.cxx @@ -205,7 +205,7 @@ static PyObject* PyUNO_list_iterator_next( PyObject *self ) try { aRet = me->members->xIndexAccess->getByIndex( me->members->index ); } - catch( css::lang::IndexOutOfBoundsException ) + catch( const css::lang::IndexOutOfBoundsException & ) { noMoreElements = true; } |