[Libreoffice-commits] .: binaryurp/qa binaryurp/source bridges/inc bridges/source canvas/source canvas/workben

Takeshi Abe tabe at kemper.freedesktop.org
Tue Nov 29 18:30:20 PST 2011


 binaryurp/qa/test-unmarshal.cxx                        |    2 +-
 binaryurp/source/bridge.cxx                            |   10 +++++-----
 binaryurp/source/incomingrequest.cxx                   |   12 ++++++------
 binaryurp/source/proxy.cxx                             |    4 ++--
 binaryurp/source/reader.cxx                            |    4 ++--
 binaryurp/source/writer.cxx                            |    6 +++---
 bridges/inc/bridges/cpp_uno/bridge.hxx                 |    4 ++--
 bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx |    2 +-
 bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx   |    4 ++--
 bridges/source/cpp_uno/shared/component.cxx            |    4 ++--
 bridges/source/jni_uno/jni_bridge.cxx                  |   12 ++++++------
 bridges/source/jni_uno/jni_java2uno.cxx                |    4 ++--
 bridges/source/jni_uno/nativethreadpool.cxx            |    4 ++--
 canvas/source/directx/dx_config.cxx                    |    4 ++--
 canvas/source/factory/cf_service.cxx                   |    8 ++++----
 canvas/source/tools/canvastools.cxx                    |    2 +-
 canvas/workben/canvasdemo.cxx                          |    2 +-
 17 files changed, 44 insertions(+), 44 deletions(-)

New commits:
commit 7113c7152d1ec875e65e97548fa6243fc83fbc53
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Wed Nov 30 11:05:16 2011 +0900

    catch by constant reference

diff --git a/binaryurp/qa/test-unmarshal.cxx b/binaryurp/qa/test-unmarshal.cxx
index 3e8aac3..aa6c5a9 100644
--- a/binaryurp/qa/test-unmarshal.cxx
+++ b/binaryurp/qa/test-unmarshal.cxx
@@ -108,7 +108,7 @@ void Test::testTypeOfVoidSequence() {
     try {
         m.readType();
         CPPUNIT_FAIL("exception expected");
-    } catch (css::io::IOException &) {}
+    } catch (const css::io::IOException &) {}
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx
index 6e97406..b491a2a 100644
--- a/binaryurp/source/bridge.cxx
+++ b/binaryurp/source/bridge.cxx
@@ -259,7 +259,7 @@ void Bridge::terminate() {
     }
     try {
         connection_->close();
-    } catch (css::io::IOException & e) {
+    } catch (const css::io::IOException & e) {
         SAL_INFO("binaryurp", "caught IO exception '" << e.Message << '\'');
     }
     assert(w.is());
@@ -289,7 +289,7 @@ void Bridge::terminate() {
             (*i)->disposing(
                 css::lang::EventObject(
                     static_cast< cppu::OWeakObject * >(this)));
-        } catch (css::uno::RuntimeException & e) {
+        } catch (const css::uno::RuntimeException & e) {
             SAL_WARN(
                 "binaryurp", "caught runtime exception '" << e.Message << '\'');
         }
@@ -505,10 +505,10 @@ void Bridge::revokeProxy(Proxy & proxy) {
 void Bridge::freeProxy(Proxy & proxy) {
     try {
         makeReleaseCall(proxy.getOid(), proxy.getType());
-    } catch (css::uno::RuntimeException & e) {
+    } catch (const css::uno::RuntimeException & e) {
         SAL_INFO(
             "binaryurp", "caught runtime exception '" << e.Message << '\'');
-    } catch (std::exception & e) {
+    } catch (const std::exception & e) {
         SAL_WARN("binaryurp", "caught C++ exception '" << e.what() << '\'');
     }
     bool unused;
@@ -660,7 +660,7 @@ void Bridge::handleCommitChangeReply(
     bool ccMode = true;
     try {
         throwException(exception, returnValue);
-    } catch (css::bridge::InvalidProtocolChangeException &) {
+    } catch (const css::bridge::InvalidProtocolChangeException &) {
         ccMode = false;
     }
     if (ccMode) {
diff --git a/binaryurp/source/incomingrequest.cxx b/binaryurp/source/incomingrequest.cxx
index f869c95..431c885 100644
--- a/binaryurp/source/incomingrequest.cxx
+++ b/binaryurp/source/incomingrequest.cxx
@@ -87,7 +87,7 @@ void IncomingRequest::execute() const {
         try {
             try {
                 isExc = !execute_throw(&ret, &outArgs);
-            } catch (std::exception & e) {
+            } catch (const std::exception & e) {
                 throw css::uno::RuntimeException(
                     (rtl::OUString(
                         RTL_CONSTASCII_USTRINGPARAM("caught C++ exception: ")) +
@@ -96,7 +96,7 @@ void IncomingRequest::execute() const {
                     css::uno::Reference< css::uno::XInterface >());
                     // best-effort string conversion
             }
-        } catch (css::uno::RuntimeException &) {
+        } catch (const css::uno::RuntimeException &) {
             css::uno::Any exc(cppu::getCaughtException());
             ret = bridge_->mapCppToBinaryAny(exc);
             isExc = true;
@@ -104,7 +104,7 @@ void IncomingRequest::execute() const {
         if (resetCc) {
             current_context::set(oldCc);
         }
-    } catch (css::uno::RuntimeException &) {
+    } catch (const css::uno::RuntimeException &) {
         css::uno::Any exc(cppu::getCaughtException());
         ret = bridge_->mapCppToBinaryAny(exc);
         isExc = true;
@@ -115,12 +115,12 @@ void IncomingRequest::execute() const {
             bridge_->getWriter()->queueReply(
                 tid_, member_, setter_, isExc, ret, outArgs, false);
             return;
-        } catch (css::uno::RuntimeException & e) {
+        } catch (const css::uno::RuntimeException & e) {
             OSL_TRACE(
                 OSL_LOG_PREFIX "caught UNO runtime exception '%s'",
                 (rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).
                  getStr()));
-        } catch (std::exception & e) {
+        } catch (const std::exception & e) {
             OSL_TRACE(OSL_LOG_PREFIX "caught C++ exception '%s'", e.what());
         }
         bridge_->terminate();
@@ -162,7 +162,7 @@ bool IncomingRequest::execute_throw(
             if (prov.is()) {
                 try {
                     ifc = prov->getInstance(oid_);
-                } catch (css::container::NoSuchElementException & e) {
+                } catch (const css::container::NoSuchElementException & e) {
                     OSL_TRACE(
                         (OSL_LOG_PREFIX "initial element '%s':"
                          " NoSuchElementException '%s'"),
diff --git a/binaryurp/source/proxy.cxx b/binaryurp/source/proxy.cxx
index 75cca80..a579476 100644
--- a/binaryurp/source/proxy.cxx
+++ b/binaryurp/source/proxy.cxx
@@ -116,7 +116,7 @@ void Proxy::do_dispatch(
     try {
         try {
             do_dispatch_throw(member, returnValue, arguments, exception);
-        } catch (std::exception & e) {
+        } catch (const std::exception & e) {
             throw css::uno::RuntimeException(
                 (rtl::OUString(
                     RTL_CONSTASCII_USTRINGPARAM("caught C++ exception: ")) +
@@ -125,7 +125,7 @@ void Proxy::do_dispatch(
                 css::uno::Reference< css::uno::XInterface >());
                 // best-effort string conversion
         }
-    } catch (css::uno::RuntimeException &) {
+    } catch (const css::uno::RuntimeException &) {
         css::uno::Any exc(cppu::getCaughtException());
         uno_copyAndConvertData(
             *exception, &exc,
diff --git a/binaryurp/source/reader.cxx b/binaryurp/source/reader.cxx
index c151e98..c052fad 100644
--- a/binaryurp/source/reader.cxx
+++ b/binaryurp/source/reader.cxx
@@ -145,9 +145,9 @@ void Reader::run() {
             }
             block.done();
         }
-    } catch (css::uno::Exception & e) {
+    } catch (const css::uno::Exception & e) {
         SAL_WARN("binaryurp", "caught UNO exception '" << e.Message << '\'');
-    } catch (std::exception & e) {
+    } catch (const std::exception & e) {
         SAL_WARN("binaryurp", "caught C++ exception '" << e.what() << '\'');
     }
     bridge_->terminate();
diff --git a/binaryurp/source/writer.cxx b/binaryurp/source/writer.cxx
index 42a2388..5aca57b 100644
--- a/binaryurp/source/writer.cxx
+++ b/binaryurp/source/writer.cxx
@@ -189,11 +189,11 @@ void Writer::run() {
                 }
             }
         }
-    } catch (css::uno::Exception & e) {
+    } catch (const css::uno::Exception & e) {
         OSL_TRACE(
             OSL_LOG_PREFIX "caught UNO exception '%s'",
             rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
-    } catch (std::exception & e) {
+    } catch (const std::exception & e) {
         OSL_TRACE(OSL_LOG_PREFIX "caught C++ exception '%s'", e.what());
     }
     bridge_->terminate();
@@ -447,7 +447,7 @@ void Writer::sendMessage(std::vector< unsigned char > const & buffer) {
         rtl_copyMemory(s.getArray() + s.getLength() - k, p, k);
         try {
             bridge_->getConnection()->write(s);
-        } catch (css::io::IOException & e) {
+        } catch (const css::io::IOException & e) {
             css::uno::Any exc(cppu::getCaughtException());
             throw css::lang::WrappedTargetRuntimeException(
                 (rtl::OUString(
diff --git a/bridges/inc/bridges/cpp_uno/bridge.hxx b/bridges/inc/bridges/cpp_uno/bridge.hxx
index 26bb101..42bca5d 100644
--- a/bridges/inc/bridges/cpp_uno/bridge.hxx
+++ b/bridges/inc/bridges/cpp_uno/bridge.hxx
@@ -464,9 +464,9 @@ inline void SAL_CALL cppu_cppenv_computeObjectIdentifier(
                 ::rtl_uString_acquire( *ppOId = aRet.pData );
             }
         }
-        catch (::com::sun::star::uno::RuntimeException &)
+        catch (const ::com::sun::star::uno::RuntimeException &)
         {
-            OSL_FAIL( "### RuntimeException occurred udring queryInterface()!" );
+            OSL_FAIL( "### RuntimeException occurred during queryInterface()!" );
         }
     }
 }
diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx
index 4c69984..6e0a261 100644
--- a/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx
@@ -332,7 +332,7 @@ void call(
         callVirtualMethod(
             (*thisPtr)[slot.index + 2], stack,
             std::max< sal_Int32 >(sp - 6, 0) * sizeof (long));
-    } catch (css::uno::Exception &) {
+    } catch (const css::uno::Exception &) {
         void * exc = __Crun::ex_get();
         char const * name = __Cimpl::ex_name();
         bridges::cpp_uno::cc5_solaris_sparc64::fillUnoException(
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
index aa6d523..3b1aea1 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
@@ -390,9 +390,9 @@ static void cpp_call(
                 pStackStart, ( pStack - pStackStart ),
                 pGPR, nGPR,
                 pFPR, nFPR );
-        } catch (Exception &) {
+        } catch (const Exception &) {
             throw;
-        } catch (std::exception & e) {
+        } catch (const std::exception & e) {
             OUStringBuffer buf;
             buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("C++ code threw "));
             appendCString(buf, typeid(e).name());
diff --git a/bridges/source/cpp_uno/shared/component.cxx b/bridges/source/cpp_uno/shared/component.cxx
index 34f3491..7577fef 100644
--- a/bridges/source/cpp_uno/shared/component.cxx
+++ b/bridges/source/cpp_uno/shared/component.cxx
@@ -144,10 +144,10 @@ static void s_stub_computeObjectIdentifier(va_list * pParam)
                 ::rtl_uString_acquire( *ppOId = aRet.pData );
             }
         }
-        catch (::com::sun::star::uno::RuntimeException &)
+        catch (const ::com::sun::star::uno::RuntimeException &)
         {
             OSL_FAIL(
-                "### RuntimeException occurred udring queryInterface()!" );
+                "### RuntimeException occurred during queryInterface()!" );
         }
     }
 }
diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx
index 2911ee2..170ba8d 100644
--- a/bridges/source/jni_uno/jni_bridge.cxx
+++ b/bridges/source/jni_uno/jni_bridge.cxx
@@ -106,7 +106,7 @@ void SAL_CALL Mapping_map_to_uno(
             }
             *ppUnoI = pUnoI;
         }
-        catch (BridgeRuntimeError & err)
+        catch (const BridgeRuntimeError & err)
         {
 #if OSL_DEBUG_LEVEL > 0
             OString cstr_msg(
@@ -118,7 +118,7 @@ void SAL_CALL Mapping_map_to_uno(
             (void) err; // unused
 #endif
         }
-        catch (::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
+        catch (const ::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
         {
             OSL_FAIL(
                 "[jni_uno bridge error] attaching current thread "
@@ -175,7 +175,7 @@ void SAL_CALL Mapping_map_to_java(
             jni->DeleteLocalRef( jlocal );
         }
     }
-    catch (BridgeRuntimeError & err)
+    catch (const BridgeRuntimeError & err)
     {
 #if OSL_DEBUG_LEVEL > 0
         OString cstr_msg(
@@ -187,7 +187,7 @@ void SAL_CALL Mapping_map_to_java(
             (void) err; // unused
 #endif
     }
-    catch (::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
+    catch (const ::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
     {
         OSL_FAIL(
             "[jni_uno bridge error] attaching current thread to java failed!" );
@@ -537,7 +537,7 @@ void SAL_CALL uno_ext_getMapping(
                     (uno_Environment *)pFrom->pExtEnv, pTo, 0 );
             }
         }
-        catch (BridgeRuntimeError & err)
+        catch (const BridgeRuntimeError & err)
         {
 #if OSL_DEBUG_LEVEL > 0
             OString cstr_msg(
@@ -549,7 +549,7 @@ void SAL_CALL uno_ext_getMapping(
             (void) err; // unused
 #endif
         }
-        catch (::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
+        catch (const ::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
         {
             OSL_FAIL(
                 "[jni_uno bridge error] attaching current thread "
diff --git a/bridges/source/jni_uno/jni_java2uno.cxx b/bridges/source/jni_uno/jni_java2uno.cxx
index 845eb42..d8496f0 100644
--- a/bridges/source/jni_uno/jni_java2uno.cxx
+++ b/bridges/source/jni_uno/jni_java2uno.cxx
@@ -615,7 +615,7 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call(
         buf.append( jni.get_stack_trace() );
         throw BridgeRuntimeError( buf.makeStringAndClear() );
     }
-    catch (BridgeRuntimeError & err)
+    catch (const BridgeRuntimeError & err)
     {
         OUStringBuffer buf( 128 );
         buf.appendAscii(
@@ -636,7 +636,7 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call(
         }
         return 0;
     }
-    catch (::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
+    catch (const ::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
     {
         OString cstr_msg(
             OString( RTL_CONSTASCII_STRINGPARAM(
diff --git a/bridges/source/jni_uno/nativethreadpool.cxx b/bridges/source/jni_uno/nativethreadpool.cxx
index f068a0f..b510317 100644
--- a/bridges/source/jni_uno/nativethreadpool.cxx
+++ b/bridges/source/jni_uno/nativethreadpool.cxx
@@ -84,7 +84,7 @@ static void SAL_CALL executeRequest(void * data) {
         env->CallObjectMethod(job->job, job->pool->execute);
         env->DeleteGlobalRef(job->job);
         delete job;
-    } catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &) {
+    } catch (const jvmaccess::VirtualMachine::AttachGuard::CreationException &) {
         //TODO: DeleteGlobalRef(job->job)
         delete job;
     }
@@ -141,7 +141,7 @@ Java_com_sun_star_lib_uno_environments_remote_NativeThreadPool_create(
         return reinterpret_cast< jlong >(new Pool(
             new jvmaccess::VirtualMachine(vm, env->GetVersion(), false, env),
             execute, uno_threadpool_create()));
-    } catch (std::bad_alloc) {
+    } catch (const std::bad_alloc &) {
         throwOutOfMemory(env);
         return 0;
     }
diff --git a/canvas/source/directx/dx_config.cxx b/canvas/source/directx/dx_config.cxx
index cc442c1..65f8e89 100644
--- a/canvas/source/directx/dx_config.cxx
+++ b/canvas/source/directx/dx_config.cxx
@@ -89,7 +89,7 @@ namespace dxcanvas
             else
                 maMaxTextureSize.reset();
         }
-        catch( uno::Exception& )
+        catch( const uno::Exception& )
         {
             OSL_FAIL( rtl::OUStringToOString(
                             comphelper::anyToString( cppu::getCaughtException() ),
@@ -130,7 +130,7 @@ namespace dxcanvas
             aValue[0] <<= aValues;
             PutProperties( aName, aValue );
         }
-        catch( uno::Exception& )
+        catch( const uno::Exception& )
         {
             OSL_FAIL( rtl::OUStringToOString(
                             comphelper::anyToString( cppu::getCaughtException() ),
diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx
index c79927e..8127bfd 100644
--- a/canvas/source/factory/cf_service.cxx
+++ b/canvas/source/factory/cf_service.cxx
@@ -203,11 +203,11 @@ CanvasFactory::CanvasFactory( Reference<XComponentContext> const & xContext ) :
             ++pCurr;
         }
     }
-    catch (RuntimeException &)
+    catch (const RuntimeException &)
     {
         throw;
     }
-    catch (Exception&)
+    catch (const Exception&)
     {
     }
 
@@ -290,11 +290,11 @@ Reference<XInterface> CanvasFactory::use(
         return m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
             serviceName, args, xContext);
     }
-    catch (RuntimeException &)
+    catch (const RuntimeException &)
     {
         throw;
     }
-    catch (Exception &)
+    catch (const Exception &)
     {
         return Reference<XInterface>();
     }
diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx
index 7f3ba82..c663d43 100644
--- a/canvas/source/tools/canvastools.cxx
+++ b/canvas/source/tools/canvastools.cxx
@@ -916,7 +916,7 @@ namespace canvas
                     o_rxParams[ 1 ] = uno::makeAny( xPropSet->getPropertyValue(
                                                         ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DeviceHandle") ) ) );
                 }
-                catch( uno::Exception& )
+                catch( const uno::Exception& )
                 {
                     // ignore, but return empty sequence
                 }
diff --git a/canvas/workben/canvasdemo.cxx b/canvas/workben/canvasdemo.cxx
index e8ad098..00bcec9 100644
--- a/canvas/workben/canvasdemo.cxx
+++ b/canvas/workben/canvasdemo.cxx
@@ -678,7 +678,7 @@ void DemoApp::Main()
         if( xFactory.is() )
             ::comphelper::setProcessServiceFactory( xFactory );
     }
-    catch( uno::Exception& )
+    catch( const uno::Exception& )
     {
     }
 


More information about the Libreoffice-commits mailing list