diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-13 15:17:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-14 09:57:33 +0100 |
commit | 7ac335c62839602815ca59035b3db9c0b6394fd6 (patch) | |
tree | 5f01efd0a48477d3df32ac5e160cbe1d324bd36b | |
parent | 93e79ed8eb7d2fab6b209f4c1de8859ead7b95cf (diff) |
catch by const reference
-rw-r--r-- | sal/osl/all/loadmodulerelative.cxx | 2 | ||||
-rw-r--r-- | sal/qa/osl/file/osl_File.cxx | 2 | ||||
-rw-r--r-- | sal/qa/rtl/logfile/rtl_logfile.cxx | 2 | ||||
-rw-r--r-- | sal/qa/rtl/uri/rtl_testuri.cxx | 2 | ||||
-rw-r--r-- | sal/qa/systools/test_comtools.cxx | 4 | ||||
-rw-r--r-- | sal/rtl/source/bootstrap.cxx | 2 | ||||
-rw-r--r-- | sal/test/unloading/samplelib1.cxx | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/sal/osl/all/loadmodulerelative.cxx b/sal/osl/all/loadmodulerelative.cxx index 3d08754c6..b510a032c 100644 --- a/sal/osl/all/loadmodulerelative.cxx +++ b/sal/osl/all/loadmodulerelative.cxx @@ -57,7 +57,7 @@ oslModule SAL_CALL osl_loadModuleRelative( ::rtl::OUString abs; try { abs = ::rtl::Uri::convertRelToAbs(base, relativePath); - } catch (::rtl::MalformedUriException & e) { + } catch (const ::rtl::MalformedUriException & e) { (void) e; // avoid warnings OSL_TRACE( "rtl::MalformedUriException <%s>", diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index 7388f64ab..024619d74 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -6323,7 +6323,7 @@ class GlobalObject #endif } - catch (CppUnit::Exception &e) + catch (const CppUnit::Exception &e) { printf("Exception caught in GlobalObject dtor(). Exception message: '%s'. Source line: %d\n", e.what(), e.sourceLine().lineNumber()); } diff --git a/sal/qa/rtl/logfile/rtl_logfile.cxx b/sal/qa/rtl/logfile/rtl_logfile.cxx index 848e18baa..ac3dfc165 100644 --- a/sal/qa/rtl/logfile/rtl_logfile.cxx +++ b/sal/qa/rtl/logfile/rtl_logfile.cxx @@ -237,7 +237,7 @@ public: printf("Please remove logfile* manully! Error is Permision denied!"); #endif } - catch (CppUnit::Exception &e) + catch (const CppUnit::Exception &e) { printf("Exception caught in GlobalObject dtor(). Exception message: '%s'. Source line: %d\n", e.what(), e.sourceLine().lineNumber()); } diff --git a/sal/qa/rtl/uri/rtl_testuri.cxx b/sal/qa/rtl/uri/rtl_testuri.cxx index dd6064a8d..fe8ed6c41 100644 --- a/sal/qa/rtl/uri/rtl_testuri.cxx +++ b/sal/qa/rtl/uri/rtl_testuri.cxx @@ -368,7 +368,7 @@ void Test::test_Uri() { aAbs = rtl::Uri::convertRelToAbs( rtl::OUString::createFromAscii(aRelToAbsTest[i].pBase), rtl::OUString::createFromAscii(aRelToAbsTest[i].pRel)); - } catch (rtl::MalformedUriException &) { + } catch (const rtl::MalformedUriException &) { bMalformed = true; } if (bMalformed diff --git a/sal/qa/systools/test_comtools.cxx b/sal/qa/systools/test_comtools.cxx index 4ec7004eb..e14debabd 100644 --- a/sal/qa/systools/test_comtools.cxx +++ b/sal/qa/systools/test_comtools.cxx @@ -198,7 +198,7 @@ namespace test_comtools sal::systools::COMReference<IUnknown> r2 = r1.QueryInterface<IUnknown>(IID_IUnknown); CPPUNIT_ASSERT_MESSAGE("Wrong reference count, 2 is expected", reinterpret_cast<COMObject*>(r2.get())->GetRefCount() == 2); } - catch(sal::systools::ComError& ex) + catch(const sal::systools::ComError& ex) { CPPUNIT_ASSERT_MESSAGE("Exception should not have been thrown", false); } @@ -211,7 +211,7 @@ namespace test_comtools sal::systools::COMReference<IUnknown> r1 = comObjectSource(); sal::systools::COMReference<IPersistFile> r2 = r1.QueryInterface<IPersistFile>(IID_IPersistFile); } - catch(sal::systools::ComError& ex) + catch(const sal::systools::ComError& ex) { return; } diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx index 6cf509f8f..a58dd0e1d 100644 --- a/sal/rtl/source/bootstrap.cxx +++ b/sal/rtl/source/bootstrap.cxx @@ -993,7 +993,7 @@ rtl::OUString expandMacros( try { buf.append( rtl::Uri::convertRelToAbs(seg[1], url)); - } catch (rtl::MalformedUriException &) {} + } catch (const rtl::MalformedUriException &) {} } } else { buf.append( diff --git a/sal/test/unloading/samplelib1.cxx b/sal/test/unloading/samplelib1.cxx index 2fb7a14ab..5d6e1a9e5 100644 --- a/sal/test/unloading/samplelib1.cxx +++ b/sal/test/unloading/samplelib1.cxx @@ -170,7 +170,7 @@ extern "C" { xNewKey->createKey(OUString( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME4))); return sal_True; } - catch (InvalidRegistryException &) + catch (const InvalidRegistryException &) { OSL_FAIL( "### InvalidRegistryException!" ); } |