diff options
-rw-r--r-- | sfx2/source/doc/DocumentMetadataAccess.cxx | 84 | ||||
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 40 |
2 files changed, 62 insertions, 62 deletions
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index e2c407138069..60bc62dcdb67 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -325,9 +325,9 @@ addFile(struct DocumentMetadataAccess_Impl & i_rImpl, (*i_pTypes)[i].get()); } } - } catch (uno::RuntimeException &) { + } catch (const uno::RuntimeException &) { throw; - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "addFile: exception")), /*this*/0, uno::makeAny(e)); @@ -374,9 +374,9 @@ removeFile(struct DocumentMetadataAccess_Impl & i_rImpl, i_xPart.get()); i_rImpl.m_xManifest->removeStatements(i_xPart.get(), getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext), 0); - } catch (uno::RuntimeException &) { + } catch (const uno::RuntimeException &) { throw; - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("removeFile: exception")), 0, uno::makeAny(e)); @@ -403,9 +403,9 @@ getAllParts(struct DocumentMetadataAccess_Impl & i_rImpl) ret.push_back(xPart); } return ret; - } catch (uno::RuntimeException &) { + } catch (const uno::RuntimeException &) { throw; - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("getAllParts: exception")), 0, uno::makeAny(e)); @@ -425,9 +425,9 @@ isPartOfType(struct DocumentMetadataAccess_Impl & i_rImpl, i_xType.get()), uno::UNO_SET_THROW); return (xEnum->hasMoreElements()); - } catch (uno::RuntimeException &) { + } catch (const uno::RuntimeException &) { throw; - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("isPartOfType: exception")), 0, uno::makeAny(e)); @@ -518,7 +518,7 @@ collectFilesFromStorage(uno::Reference<embed::XStorage> const& i_xStorage, { o_rFiles.insert(i_Path + styles); } - } catch (uno::Exception &) { + } catch (const uno::Exception &) { OSL_TRACE("collectFilesFromStorage: exception?"); } } @@ -571,7 +571,7 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl, "refusing to recurse into embedded document"); return; } - } catch (uno::Exception &) { } + } catch (const uno::Exception &) { } ::rtl::OUStringBuffer buf(i_rBaseURI); buf.append(dir).append(static_cast<sal_Unicode>('/')); readStream(i_rImpl, xDir, rest, buf.makeStringAndClear() ); @@ -581,13 +581,13 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl, ucb::IOErrorCode_NO_DIRECTORY, i_rBaseURI + dir, dir); } } - } catch (container::NoSuchElementException & e) { + } catch (const container::NoSuchElementException & e) { throw mkException(e.Message, ucb::IOErrorCode_NOT_EXISTING_PATH, i_rBaseURI + i_rPath, i_rPath); - } catch (io::IOException & e) { + } catch (const io::IOException & e) { throw mkException(e.Message, ucb::IOErrorCode_CANT_READ, i_rBaseURI + i_rPath, i_rPath); - } catch (rdf::ParseException & e) { + } catch (const rdf::ParseException & e) { throw mkException(e.Message, ucb::IOErrorCode_WRONG_FORMAT, i_rBaseURI + i_rPath, i_rPath); } @@ -604,11 +604,11 @@ importFile(struct DocumentMetadataAccess_Impl & i_rImpl, retry: try { readStream(i_rImpl, i_xStorage, i_rPath, i_rBaseURI); - } catch (ucb::InteractiveAugmentedIOException & e) { + } catch (const ucb::InteractiveAugmentedIOException & e) { if (handleError(e, i_xHandler)) goto retry; - } catch (uno::RuntimeException &) { + } catch (const uno::RuntimeException &) { throw; - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("importFile: exception")), 0, uno::makeAny(e)); @@ -673,7 +673,7 @@ writeStream(struct DocumentMetadataAccess_Impl & i_rImpl, "refusing to recurse into embedded document"); return; } - } catch (uno::Exception &) { } + } catch (const uno::Exception &) { } ::rtl::OUStringBuffer buf(i_rBaseURI); buf.append(dir).append(static_cast<sal_Unicode>('/')); writeStream(i_rImpl, xDir, i_xGraphName, rest, @@ -684,9 +684,9 @@ writeStream(struct DocumentMetadataAccess_Impl & i_rImpl, xTransaction->commit(); } } - } catch (uno::RuntimeException &) { + } catch (const uno::RuntimeException &) { throw; - } catch (io::IOException &) { + } catch (const io::IOException &) { throw; } } @@ -720,13 +720,13 @@ retry: getURIForStream(i_rImpl, manifest)); try { readStream(i_rImpl, i_xStorage, manifest, baseURI); - } catch (ucb::InteractiveAugmentedIOException & e) { + } catch (const ucb::InteractiveAugmentedIOException & e) { // no manifest.rdf: this is not an error in ODF < 1.2 if (!(ucb::IOErrorCode_NOT_EXISTING_PATH == e.Code)) { iaioe = e; err = true; } - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { rterr <<= e; } @@ -775,7 +775,7 @@ static void init(struct DocumentMetadataAccess_Impl & i_rImpl) i_rImpl.m_xManifest->addStatement(i_rImpl.m_xBaseURI.get(), getURI<rdf::URIs::RDF_TYPE>(i_rImpl.m_xContext), getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext).get()); - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("init: unexpected exception")), 0, uno::makeAny(e)); @@ -948,7 +948,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, try { m_pImpl->m_xRepository->createGraph(xGraphName); - } catch (rdf::RepositoryException & e) { + } catch (const rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::addMetadataFile: exception")), @@ -995,7 +995,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, try { m_pImpl->m_xRepository->importGraph( i_Format, i_xInStream, xGraphName, i_xBaseURI); - } catch (rdf::RepositoryException & e) { + } catch (const rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::importMetadataFile: " @@ -1016,7 +1016,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, { try { m_pImpl->m_xRepository->destroyGraph(i_xGraphName); - } catch (rdf::RepositoryException & e) { + } catch (const rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::removeMetadataFile: " @@ -1079,9 +1079,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, // remove file from manifest removeFile(*m_pImpl, xPart); - } catch (uno::RuntimeException &) { + } catch (const uno::RuntimeException &) { throw; - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::removeContentOrStylesFile: exception")), @@ -1185,9 +1185,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, // something else! just ignore it... } } - } catch (uno::RuntimeException &) { + } catch (const uno::RuntimeException &) { throw; - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::loadMetadataFromStorage: " @@ -1221,12 +1221,12 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, const ::rtl::OUString baseURI( m_pImpl->m_xBaseURI->getStringValue() ); try { writeStream(*m_pImpl, i_xStorage, xManifest, manifest, baseURI); - } catch (uno::RuntimeException &) { + } catch (const uno::RuntimeException &) { throw; - } catch (io::IOException & e) { + } catch (const io::IOException & e) { throw lang::WrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "storeMetadataToStorage: IO exception")), *this, uno::makeAny(e)); - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "storeMetadataToStorage: exception")), *this, uno::makeAny(e)); @@ -1258,21 +1258,21 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, } try { writeStream(*m_pImpl, i_xStorage, xName, relName, baseURI); - } catch (uno::RuntimeException &) { + } catch (const uno::RuntimeException &) { throw; - } catch (io::IOException & e) { + } catch (const io::IOException & e) { throw lang::WrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "storeMetadataToStorage: IO exception")), *this, uno::makeAny(e)); - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "storeMetadataToStorage: exception")), *this, uno::makeAny(e)); } } - } catch (rdf::RepositoryException & e) { + } catch (const rdf::RepositoryException & e) { throw lang::WrappedTargetRuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "storeMetadataToStorage: exception")), *this, uno::makeAny(e)); @@ -1310,11 +1310,11 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, xStorage = ::comphelper::OStorageHelper::GetStorageFromURL2( URL, embed::ElementModes::READ, xMsf); } - } catch (uno::RuntimeException &) { + } catch (const uno::RuntimeException &) { throw; - } catch (io::IOException &) { + } catch (const io::IOException &) { throw; - } catch (uno::Exception & e) { + } catch (const uno::Exception & e) { throw lang::WrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "DocumentMetadataAccess::loadMetadataFromMedium: " @@ -1328,11 +1328,11 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, uno::Reference<rdf::XURI> xBaseURI; try { xBaseURI = createBaseURI(m_pImpl->m_xContext, xStorage, BaseURL); - } catch (uno::Exception &) { + } catch (const uno::Exception &) { // fall back to URL try { xBaseURI = createBaseURI(m_pImpl->m_xContext, xStorage, URL); - } catch (uno::Exception &) { + } catch (const uno::Exception &) { OSL_FAIL("cannot create base URI"); } } @@ -1385,7 +1385,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, xProps->setPropertyValue( ::comphelper::MediaDescriptor::PROP_MEDIATYPE(), iter->second); - } catch (uno::Exception &) { } + } catch (const uno::Exception &) { } } storeMetadataToStorage(xStorage); diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 864652c5de9b..29cea3715de6 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -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()); |