From f85076ca48e27c81cf4ce36f9b09fb55733db4ec Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 13 Jun 2011 15:17:59 +0100 Subject: catch by const reference --- sal/qa/osl/file/osl_File.cxx | 2 +- sal/qa/rtl/logfile/rtl_logfile.cxx | 2 +- sal/qa/rtl/uri/rtl_testuri.cxx | 2 +- sal/qa/systools/test_comtools.cxx | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'sal/qa') diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index fbec99218d46..5787a746bdc6 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 3360fc34d8cf..2b669478d010 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 ceb573f70b15..b5cc1caa5a73 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 9f39b854c06d..f09a7b4189f7 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 r2 = r1.QueryInterface(IID_IUnknown); CPPUNIT_ASSERT_MESSAGE("Wrong reference count, 2 is expected", reinterpret_cast(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 r1 = comObjectSource(); sal::systools::COMReference r2 = r1.QueryInterface(IID_IPersistFile); } - catch(sal::systools::ComError& ex) + catch(const sal::systools::ComError& ex) { return; } -- cgit