Catching std::bad_alloc in UNO implementations no longer necessary
...since 0bc89aac4c "cppumaker: Allow UNO
interface functions to throw std::exception."
Change-Id: Ia28f02ea10d45267fd951e80da01ffdfdb420885
This commit is contained in:
@@ -40,8 +40,6 @@
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "sal/types.h"
|
||||
|
||||
#include <new>
|
||||
|
||||
namespace {
|
||||
|
||||
class Translator: public cppu::WeakImplHelper2<
|
||||
@@ -201,12 +199,7 @@ css::uno::Reference< css::uno::XInterface > create(
|
||||
css::uno::Reference< css::uno::XComponentContext > const & context)
|
||||
SAL_THROW((css::uno::Exception))
|
||||
{
|
||||
try {
|
||||
return static_cast< cppu::OWeakObject * >(new Translator(context));
|
||||
} catch (std::bad_alloc &) {
|
||||
throw css::uno::RuntimeException(
|
||||
OUString("std::bad_alloc"), 0);
|
||||
}
|
||||
return static_cast< cppu::OWeakObject * >(new Translator(context));
|
||||
}
|
||||
|
||||
OUString getImplementationName() {
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
#include <new>
|
||||
#include <vector>
|
||||
|
||||
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
|
||||
@@ -641,11 +640,7 @@ css::uno::Reference< css::uno::XInterface > create(
|
||||
css::uno::Reference< css::uno::XComponentContext > const & context)
|
||||
SAL_THROW((css::uno::Exception))
|
||||
{
|
||||
try {
|
||||
return static_cast< cppu::OWeakObject * >(new Factory(context));
|
||||
} catch (std::bad_alloc &) {
|
||||
throw css::uno::RuntimeException("std::bad_alloc", 0);
|
||||
}
|
||||
return static_cast< cppu::OWeakObject * >(new Factory(context));
|
||||
}
|
||||
|
||||
OUString getImplementationName() {
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "stocservices.hxx"
|
||||
|
||||
#include <exception>
|
||||
#include <new>
|
||||
|
||||
#include "com/sun/star/lang/IllegalArgumentException.hpp"
|
||||
#include "com/sun/star/lang/XServiceInfo.hpp"
|
||||
@@ -222,13 +221,7 @@ css::uno::Reference< css::uno::XInterface > create(
|
||||
SAL_THROW((css::uno::Exception))
|
||||
{
|
||||
//TODO: single instance
|
||||
try {
|
||||
return static_cast< ::cppu::OWeakObject * >(new Parser);
|
||||
} catch (::std::bad_alloc &) {
|
||||
throw css::uno::RuntimeException(
|
||||
OUString("std::bad_alloc"),
|
||||
css::uno::Reference< css::uno::XInterface >());
|
||||
}
|
||||
return static_cast< ::cppu::OWeakObject * >(new Parser);
|
||||
}
|
||||
|
||||
OUString getImplementationName() {
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#include "sal/types.h"
|
||||
|
||||
#include <exception>
|
||||
#include <new>
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -446,12 +445,7 @@ css::uno::Reference< css::uno::XInterface > create(
|
||||
SAL_THROW((css::uno::Exception))
|
||||
{
|
||||
//TODO: single instance
|
||||
try {
|
||||
return static_cast< cppu::OWeakObject * >(new Parser);
|
||||
} catch (std::bad_alloc &) {
|
||||
throw css::uno::RuntimeException(
|
||||
OUString("std::bad_alloc"), 0);
|
||||
}
|
||||
return static_cast< cppu::OWeakObject * >(new Parser);
|
||||
}
|
||||
|
||||
OUString getImplementationName() {
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
#include "rtl/ustring.hxx"
|
||||
#include "sal/types.h"
|
||||
|
||||
#include <new>
|
||||
|
||||
namespace {
|
||||
|
||||
class Factory: public cppu::WeakImplHelper2<
|
||||
@@ -130,12 +128,7 @@ css::uno::Reference< css::uno::XInterface > create(
|
||||
css::uno::Reference< css::uno::XComponentContext > const & context)
|
||||
SAL_THROW((css::uno::Exception))
|
||||
{
|
||||
try {
|
||||
return static_cast< cppu::OWeakObject * >(new Factory(context));
|
||||
} catch (std::bad_alloc &) {
|
||||
throw css::uno::RuntimeException(
|
||||
OUString("std::bad_alloc"), 0);
|
||||
}
|
||||
return static_cast< cppu::OWeakObject * >(new Factory(context));
|
||||
}
|
||||
|
||||
OUString getImplementationName() {
|
||||
|
||||
Reference in New Issue
Block a user