Kaydet (Commit) 82eb8062 authored tarafından Caolán McNamara's avatar Caolán McNamara

catch by const reference

üst e0225e7e
......@@ -682,7 +682,7 @@ SfxDocumentMetaData::getURLProperties(
xPropArg->addProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")),
css::beans::PropertyAttribute::MAYBEVOID,
css::uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta))));
} catch (css::uno::Exception &) {
} catch (const css::uno::Exception &) {
// ignore
}
return css::uno::Reference< css::beans::XPropertySet>(xPropArg,
......@@ -704,7 +704,7 @@ getNodeText(css::uno::Reference<css::xml::dom::XNode> i_xNode)
if (c->getNodeType() == css::xml::dom::NodeType_TEXT_NODE) {
try {
return c->getNodeValue();
} catch (css::xml::dom::DOMException &) { // too big?
} catch (const css::xml::dom::DOMException &) { // too big?
return ::rtl::OUString();
}
}
......@@ -773,7 +773,7 @@ SfxDocumentMetaData::setMetaText(const char* i_name,
xNode->appendChild(xTextNode);
return true;
}
} catch (css::xml::dom::DOMException & e) {
} catch (const css::xml::dom::DOMException & e) {
css::uno::Any a(e);
throw css::lang::WrappedTargetRuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
......@@ -910,7 +910,7 @@ SfxDocumentMetaData::setMetaList(const char* i_name,
}
return true;
} catch (css::xml::dom::DOMException & e) {
} catch (const css::xml::dom::DOMException & e) {
css::uno::Any a(e);
throw css::lang::WrappedTargetRuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
......@@ -938,7 +938,7 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
css::uno::Any any;
try {
any = i_xPropSet->getPropertyValue(name);
} catch (css::uno::Exception &) {
} catch (const css::uno::Exception &) {
// ignore
}
const css::uno::Type & type = any.getValueType();
......@@ -1051,7 +1051,7 @@ SfxDocumentMetaData::updateElement(const char *i_name,
m_xParent->appendChild(xNode);
}
m_meta[name] = xNode;
} catch (css::xml::dom::DOMException & e) {
} catch (const css::xml::dom::DOMException & e) {
css::uno::Any a(e);
throw css::lang::WrappedTargetRuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
......@@ -1200,7 +1200,7 @@ void SAL_CALL SfxDocumentMetaData::init(
m_xParent.clear();
try {
m_xParent = xPath->selectSingleNode(xDocNode, prefix);
} catch (com::sun::star::uno::Exception &) {
} catch (const com::sun::star::uno::Exception &) {
}
if (!m_xParent.is()) {
......@@ -1250,7 +1250,7 @@ void SAL_CALL SfxDocumentMetaData::init(
css::uno::UNO_QUERY_THROW);
xRElem->appendChild(xParent);
m_xParent = xParent;
} catch (css::xml::dom::DOMException & e) {
} catch (const css::xml::dom::DOMException & e) {
css::uno::Any a(e);
throw css::lang::WrappedTargetRuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
......@@ -1371,14 +1371,14 @@ void SAL_CALL SfxDocumentMetaData::init(
try {
m_xUserDefined->addProperty(name,
css::beans::PropertyAttribute::REMOVEABLE, any);
} catch (css::beans::PropertyExistException &) {
} catch (const css::beans::PropertyExistException &) {
DBG_WARNING1("SfxDocumentMetaData: duplicate: %s",
OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr());
// ignore; duplicate
} catch (css::beans::IllegalTypeException &) {
} catch (const css::beans::IllegalTypeException &) {
OSL_TRACE("SfxDocumentMetaData: illegal type: %s",
OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr());
} catch (css::lang::IllegalArgumentException &) {
} catch (const css::lang::IllegalArgumentException &) {
OSL_TRACE("SfxDocumentMetaData: illegal arg: %s",
OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr());
}
......@@ -1966,7 +1966,7 @@ SfxDocumentMetaData::loadFromStorage(
>>= input.sSystemId;
input.sSystemId += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")).concat(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta)));
} catch (css::uno::Exception &) {
} catch (const css::uno::Exception &) {
input.sSystemId = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_meta));
}
css::uno::Sequence< css::uno::Any > args(1);
......@@ -1985,7 +1985,7 @@ SfxDocumentMetaData::loadFromStorage(
xParser->setDocumentHandler(xDocHandler);
try {
xParser->parseStream(input);
} catch (css::xml::sax::SAXException &) {
} catch (const css::xml::sax::SAXException &) {
throw css::io::WrongFormatException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::loadFromStorage:"
" XML parsing exception")), *this);
......@@ -2099,11 +2099,11 @@ SfxDocumentMetaData::loadFromMedium(const ::rtl::OUString & URL,
xStorage = ::comphelper::OStorageHelper::GetStorageFromURL(
URL, css::embed::ElementModes::READ, xMsf);
}
} catch (css::uno::RuntimeException &) {
} catch (const css::uno::RuntimeException &) {
throw;
} catch (css::io::IOException &) {
} catch (const css::io::IOException &) {
throw;
} catch (css::uno::Exception & e) {
} catch (const css::uno::Exception & e) {
throw css::lang::WrappedTargetException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SfxDocumentMetaData::loadFromMedium: exception")),
......@@ -2225,9 +2225,9 @@ SfxDocumentMetaData::createClone()
xDoc->importNode(xRoot, true));
xDoc->appendChild(xRootNew);
pNew->init(xDoc);
} catch (css::uno::RuntimeException &) {
} catch (const css::uno::RuntimeException &) {
throw;
} catch (css::uno::Exception & e) {
} catch (const css::uno::Exception & e) {
css::uno::Any a(e);
throw css::lang::WrappedTargetRuntimeException(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
......@@ -2269,9 +2269,9 @@ void SAL_CALL SfxDocumentMetaData::setModified( ::sal_Bool bModified )
css::lang::EventObject event(xThis);
m_NotifyListeners.notifyEach(&css::util::XModifyListener::modified,
event);
} catch (css::uno::RuntimeException &) {
} catch (const css::uno::RuntimeException &) {
throw;
} catch (css::uno::Exception & e) {
} catch (const css::uno::Exception & e) {
// ignore
DBG_WARNING1("SfxDocumentMetaData::setModified: exception:\n%s",
OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment