[Libreoffice-commits] .: oox/source package/source padmin/source pyuno/source

Takeshi Abe tabe at kemper.freedesktop.org
Wed Dec 21 05:00:28 PST 2011


 oox/source/export/SchXMLSeriesHelper.cxx  |    6 ++--
 oox/source/export/chartexport.cxx         |   11 +++-----
 package/source/xstor/ohierarchyholder.cxx |    2 -
 package/source/xstor/xstorage.cxx         |   18 +++++++-------
 package/source/zippackage/ZipPackage.cxx  |    8 +++---
 padmin/source/pamain.cxx                  |    2 -
 pyuno/source/module/pyuno.cxx             |   28 +++++++++++-----------
 pyuno/source/module/pyuno_adapter.cxx     |   10 +++----
 pyuno/source/module/pyuno_callable.cxx    |    8 +++---
 pyuno/source/module/pyuno_except.cxx      |    6 ++--
 pyuno/source/module/pyuno_gc.cxx          |    2 -
 pyuno/source/module/pyuno_module.cxx      |   38 +++++++++++++++---------------
 pyuno/source/module/pyuno_runtime.cxx     |    4 +--
 pyuno/source/module/pyuno_type.cxx        |    6 ++--
 14 files changed, 74 insertions(+), 75 deletions(-)

New commits:
commit 7958f8244cc3e554b1339b14c7e589dfcbb0526c
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Wed Dec 21 21:57:16 2011 +0900

    catch exception by constant reference

diff --git a/oox/source/export/SchXMLSeriesHelper.cxx b/oox/source/export/SchXMLSeriesHelper.cxx
index e233b8a..5723122 100644
--- a/oox/source/export/SchXMLSeriesHelper.cxx
+++ b/oox/source/export/SchXMLSeriesHelper.cxx
@@ -76,7 +76,7 @@ using ::rtl::OUString;
             }
         }
     }
-    catch( uno::Exception & ex )
+    catch( const uno::Exception & ex )
     {
         (void)ex; // avoid warning for pro build
 
@@ -212,7 +212,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPISeriesProp
                 }
             }
         }
-        catch( uno::Exception & rEx )
+        catch( const uno::Exception & rEx )
         {
             (void)rEx; // avoid warning for pro build
             OSL_TRACE( "Exception caught SchXMLSeriesHelper::createOldAPISeriesPropertySet: %s",
@@ -250,7 +250,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPIDataPointP
                 }
             }
         }
-        catch( uno::Exception & rEx )
+        catch( const uno::Exception & rEx )
         {
             (void)rEx; // avoid warning for pro build
 
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index fb4d013..e757b1e 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -216,7 +216,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen
             }
         }
     }
-    catch( uno::Exception & ex )
+    catch( const uno::Exception & ex )
     {
         (void)ex; // avoid warning for pro build
         OSL_FAIL( rtl::OUStringToOString(
@@ -334,7 +334,7 @@ bool lcl_isSeriesAttachedToFirstAxis(
             xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("AttachedAxisIndex") ) ) >>= nAxisIndex;
         bResult = (0==nAxisIndex);
     }
-    catch( uno::Exception & ex )
+    catch( const uno::Exception & ex )
     {
         (void)ex; // avoid warning for pro build
         OSL_FAIL( rtl::OUStringToOString(
@@ -495,9 +495,8 @@ bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSeque
             if( !aHiddenValues.getLength() )
                 return true;
         }
-        catch( uno::Exception& e )
+        catch( uno::Exception& )
         {
-            (void)e; // avoid warning
             return true;
         }
     }
@@ -787,7 +786,7 @@ void ChartExport::InitRangeSegmentationProperties( const Reference< chart2::XCha
                 }
             }
         }
-        catch( uno::Exception & ex )
+        catch( const uno::Exception & ex )
         {
             (void)ex; // avoid warning for pro build
             OSL_FAIL( rtl::OUStringToOString(
@@ -2573,7 +2572,7 @@ void ChartExport::exportDataPoints(
                     xPropSet = SchXMLSeriesHelper::createOldAPIDataPointPropertySet(
                             xSeries, nElement, getModel() );
                 }
-                catch( uno::Exception & rEx )
+                catch( const uno::Exception & rEx )
                 {
                     (void)rEx; // avoid warning for pro build
                     OSL_TRACE( "Exception caught during Export of data point: %s",
diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx
index cc36e46..9ab6b15 100644
--- a/package/source/xstor/ohierarchyholder.cxx
+++ b/package/source/xstor/ohierarchyholder.cxx
@@ -335,7 +335,7 @@ void SAL_CALL OHierarchyElement_Impl::commited( const ::com::sun::star::lang::Ev
     {
         Commit();
     }
-    catch( uno::Exception& e )
+    catch( const uno::Exception& e )
     {
         throw lang::WrappedTargetRuntimeException(
                             ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not commit storage sequence!" ) ),
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 7ba64a5..f5a3fdb 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -4843,13 +4843,13 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam
         try {
             m_pImpl->ReadContents();
         }
-        catch ( uno::RuntimeException& aRuntimeException )
+        catch ( const uno::RuntimeException& aRuntimeException )
         {
             m_pImpl->AddLog( aRuntimeException.Message );
             m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
             throw;
         }
-        catch ( uno::Exception& aException )
+        catch ( const uno::Exception& aException )
         {
             m_pImpl->AddLog( aException.Message );
             m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
@@ -4867,20 +4867,20 @@ void SAL_CALL OStorage::setEncryptionAlgorithms( const uno::Sequence< beans::Nam
             xPackPropSet->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ENCRYPTION_ALGORITHMS_PROPERTY ) ),
                                             uno::makeAny( aAlgorithms ) );
         }
-        catch ( uno::RuntimeException& aRuntimeException )
+        catch ( const uno::RuntimeException& aRuntimeException )
         {
             m_pImpl->AddLog( aRuntimeException.Message );
             m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
             throw;
         }
-        catch( lang::IllegalArgumentException& aIAException )
+        catch( const lang::IllegalArgumentException& aIAException )
         {
             m_pImpl->AddLog( aIAException.Message );
             m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
 
             throw;
         }
-        catch( uno::Exception& aException )
+        catch( const uno::Exception& aException )
         {
             m_pImpl->AddLog( aException.Message );
             m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
@@ -4914,13 +4914,13 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms()
         try {
             m_pImpl->ReadContents();
         }
-        catch ( uno::RuntimeException& aRuntimeException )
+        catch ( const uno::RuntimeException& aRuntimeException )
         {
             m_pImpl->AddLog( aRuntimeException.Message );
             m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
             throw;
         }
-        catch ( uno::Exception& aException )
+        catch ( const uno::Exception& aException )
         {
             m_pImpl->AddLog( aException.Message );
             m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
@@ -4937,13 +4937,13 @@ uno::Sequence< beans::NamedValue > SAL_CALL OStorage::getEncryptionAlgorithms()
         {
             xPackPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ENCRYPTION_ALGORITHMS_PROPERTY ) ) ) >>= aResult;
         }
-        catch ( uno::RuntimeException& aRuntimeException )
+        catch ( const uno::RuntimeException& aRuntimeException )
         {
             m_pImpl->AddLog( aRuntimeException.Message );
             m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
             throw;
         }
-        catch( uno::Exception& aException )
+        catch( const uno::Exception& aException )
         {
             m_pImpl->AddLog( aException.Message );
             m_pImpl->AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Rethrow" ) ) );
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 7898028..c07e7a1 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1025,7 +1025,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut )
         aZipOut.write( aType, 0, nBufferLength );
         aZipOut.closeEntry();
     }
-    catch ( ::com::sun::star::io::IOException & r )
+    catch ( const ::com::sun::star::io::IOException & r )
     {
         throw WrappedTargetException(
                 OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Error adding mimetype to the ZipOutputStream!" ) ),
@@ -1419,7 +1419,7 @@ void SAL_CALL ZipPackage::commitChanges()
         {
             xTempSeek->seek( 0 );
         }
-        catch( uno::Exception& r )
+        catch( const uno::Exception& r )
         {
             throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "Temporary file should be seekable!" ) ),
                     static_cast < OWeakObject * > ( this ), makeAny ( r ) );
@@ -1444,7 +1444,7 @@ void SAL_CALL ZipPackage::commitChanges()
                 // after successful truncation the original file contents are already lost
                 xTruncate->truncate();
             }
-            catch( uno::Exception& r )
+            catch( const uno::Exception& r )
             {
                 throw WrappedTargetException( OUString( RTL_CONSTASCII_USTRINGPARAM ( OSL_LOG_PREFIX "This package is read only!" ) ),
                         static_cast < OWeakObject * > ( this ), makeAny ( r ) );
@@ -1543,7 +1543,7 @@ void SAL_CALL ZipPackage::commitChanges()
                     // if the file is still not corrupted, it can become after the next step
                     aContent.executeCommand ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "transfer" ) ), aAny );
                 }
-                catch ( ::com::sun::star::uno::Exception& r )
+                catch ( const ::com::sun::star::uno::Exception& r )
                 {
                     if ( bCanBeCorrupted )
                         DisconnectFromTargetAndThrowException_Impl( xTempInStream );
diff --git a/padmin/source/pamain.cxx b/padmin/source/pamain.cxx
index e98ee44..e521c33 100644
--- a/padmin/source/pamain.cxx
+++ b/padmin/source/pamain.cxx
@@ -103,7 +103,7 @@ int MyApp::Main()
         if( xFactory.is() )
             setProcessServiceFactory( xFactory );
     }
-    catch( com::sun::star::uno::Exception& rExc)
+    catch( const com::sun::star::uno::Exception& )
     {
     }
 
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index 2bfbe7b..fa7904b 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 df3f9fa..cfce221 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 e5c943f..a4a5b12 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 f36cb0a..10882af 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 77eb688..61eaaba 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 07659aa..f02cec8 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 e15a72d..21b6389 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 8dac1a1..c189764 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 ));
     }


More information about the Libreoffice-commits mailing list