From ff580eb39b46646309feba447f6bf485124db6b1 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Sun, 8 Jan 2012 03:34:57 +0900 Subject: catch exception by constant reference --- unoxml/source/dom/documentbuilder.cxx | 4 ++-- unoxml/source/dom/elementlist.cxx | 2 +- unoxml/source/rdf/librdf_repository.cxx | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index b5c19d0a5a40..6104a5aa7ec8 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -220,7 +220,7 @@ namespace DOM // copy bytes to the provided buffer rtl_copyMemory(buffer, chunk.getConstArray(), nread); return nread; - } catch (com::sun::star::uno::Exception& ex) { + } catch (const com::sun::star::uno::Exception& ex) { (void) ex; OSL_FAIL(OUStringToOString(ex.Message, RTL_TEXTENCODING_UTF8).getStr()); return -1; @@ -240,7 +240,7 @@ namespace DOM if (pctx->freeOnClose) delete pctx; return 0; - } catch (com::sun::star::uno::Exception& ex) { + } catch (const com::sun::star::uno::Exception& ex) { (void) ex; OSL_FAIL(OUStringToOString(ex.Message, RTL_TEXTENCODING_UTF8).getStr()); return -1; diff --git a/unoxml/source/dom/elementlist.cxx b/unoxml/source/dom/elementlist.cxx index f12795273882..ae66fa6e8ed3 100644 --- a/unoxml/source/dom/elementlist.cxx +++ b/unoxml/source/dom/elementlist.cxx @@ -69,7 +69,7 @@ namespace DOM sal_Bool capture = sal_False; xTarget->addEventListener(aType, Reference< XEventListener >(this), capture); - } catch (Exception &e){ + } catch (const Exception &e){ OString aMsg("Exception caught while registering NodeList as listener:\n"); aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US); OSL_FAIL(aMsg.getStr()); diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 7f8b18332ac1..f292682fbbcd 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -867,7 +867,7 @@ throw (uno::RuntimeException) reinterpret_cast(id))); try { return rdf::BlankNode::create(m_xContext, nodeID); - } catch (lang::IllegalArgumentException & iae) { + } catch (const lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::createBlankNode: " @@ -1495,7 +1495,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, xXmlId.set( rdf::URI::create(m_xContext, ::rtl::OUString::createFromAscii(s_nsOOo) + sXmlId), uno::UNO_QUERY_THROW); - } catch (lang::IllegalArgumentException & iae) { + } catch (const lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::setStatementRDFa: " @@ -1516,7 +1516,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, xContent.set(rdf::Literal::create(m_xContext, content), uno::UNO_QUERY_THROW); } - } catch (lang::IllegalArgumentException & iae) { + } catch (const lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::setStatementRDFa: " @@ -1556,7 +1556,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, + mdref.First + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("#")) + mdref.Second), uno::UNO_QUERY_THROW); - } catch (lang::IllegalArgumentException & iae) { + } catch (const lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::removeStatementRDFa: " @@ -1587,7 +1587,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, xXmlId.set( rdf::URI::create(m_xContext, ::rtl::OUString::createFromAscii(s_nsOOo) + sXmlId), uno::UNO_QUERY_THROW); - } catch (lang::IllegalArgumentException & iae) { + } catch (const lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_Repository::getStatementRDFa: " @@ -2144,7 +2144,7 @@ librdf_TypeConverter::convertToXURI(librdf_uri* i_pURI) const RTL_TEXTENCODING_UTF8) ); try { return rdf::URI::create(m_xContext, uriU); - } catch (lang::IllegalArgumentException & iae) { + } catch (const lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::convertToXURI: " @@ -2187,7 +2187,7 @@ librdf_TypeConverter::convertToXResource(librdf_node* i_pNode) const try { return uno::Reference( rdf::BlankNode::create(m_xContext, labelU), uno::UNO_QUERY); - } catch (lang::IllegalArgumentException & iae) { + } catch (const lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "librdf_TypeConverter::convertToXResource: " -- cgit