summaryrefslogtreecommitdiff
path: root/stoc/source/uriproc/UriReferenceFactory.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-10-20 22:22:05 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-20 22:22:05 +0200
commit79502678d091b90f9b76c37fbd97f8710a075655 (patch)
treefb34f23c7594adad2e34c272aab1a9fa4d7167c2 /stoc/source/uriproc/UriReferenceFactory.cxx
parentef57fc043109b8498600a30b71b3f6b590993fce (diff)
Clean-up std::bad_alloc handling
...post 0bc89aac4c64bb833e387657f680e194c26aef97 "cppumaker: Allow UNO interface functions to throw std::exception." Change-Id: I5fede822d279c3c758103192a813447bb4906679
Diffstat (limited to 'stoc/source/uriproc/UriReferenceFactory.cxx')
-rw-r--r--stoc/source/uriproc/UriReferenceFactory.cxx23
1 files changed, 8 insertions, 15 deletions
diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx
index 6d42c49011dc..856f5fbbd8f6 100644
--- a/stoc/source/uriproc/UriReferenceFactory.cxx
+++ b/stoc/source/uriproc/UriReferenceFactory.cxx
@@ -49,6 +49,7 @@
#include <algorithm>
#include /*MSVC trouble: <cstdlib>*/ <stdlib.h>
+#include <exception>
#include <new>
#include <vector>
@@ -191,7 +192,6 @@ private:
stoc::uriproc::UriReference m_base;
};
-// throws std::bad_alloc
css::uno::Reference< css::uri::XUriReference > parseGeneric(
OUString const & scheme, OUString const & schemeSpecificPart)
{
@@ -291,7 +291,7 @@ public:
virtual css::uno::Reference< css::uri::XUriReference > SAL_CALL
parse(OUString const & uriReference)
- throw (css::uno::RuntimeException);
+ throw (css::uno::RuntimeException, std::exception);
virtual css::uno::Reference< css::uri::XUriReference > SAL_CALL
makeAbsolute(
@@ -343,7 +343,8 @@ css::uno::Sequence< OUString > Factory::getSupportedServiceNames()
}
css::uno::Reference< css::uri::XUriReference > Factory::parse(
- OUString const & uriReference) throw (css::uno::RuntimeException)
+ OUString const & uriReference)
+ throw (css::uno::RuntimeException, std::exception)
{
sal_Int32 fragment = uriReference.indexOf('#');
if (fragment == -1) {
@@ -403,18 +404,10 @@ css::uno::Reference< css::uri::XUriReference > Factory::parse(
}
}
}
- css::uno::Reference< css::uri::XUriReference > uriRef;
- if (parser.is()) {
- uriRef = parser->parse(scheme, schemeSpecificPart);
- } else {
- try {
- uriRef = parseGeneric(scheme, schemeSpecificPart);
- } catch (std::bad_alloc &) {
- throw css::uno::RuntimeException(
- OUString("std::bad_alloc"),
- static_cast< cppu::OWeakObject * >(this));
- }
- }
+ css::uno::Reference< css::uri::XUriReference > uriRef(
+ parser.is()
+ ? parser->parse(scheme, schemeSpecificPart)
+ : parseGeneric(scheme, schemeSpecificPart));
if (uriRef.is() && fragment != uriReference.getLength()) {
uriRef->setFragment(uriReference.copy(fragment + 1));
}