Kaydet (Commit) 336353a8 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Related rhbz#867808: More apparently bogus "throw new ..." in C++ code

Change-Id: I5d723b389f1ed20f7962807b782f44f6f3c61882
üst 63b4633c
...@@ -74,7 +74,7 @@ sal_Int32 Client::run(css::uno::Sequence< OUString > const &) ...@@ -74,7 +74,7 @@ sal_Int32 Client::run(css::uno::Sequence< OUString > const &)
css::uno::Reference< css::lang::XMultiComponentFactory > factory( css::uno::Reference< css::lang::XMultiComponentFactory > factory(
context->getServiceManager()); context->getServiceManager());
if (!factory.is()) { if (!factory.is()) {
throw new css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( "no component context service manager" ), OUString( "no component context service manager" ),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
...@@ -94,7 +94,7 @@ sal_Int32 Client::run(css::uno::Sequence< OUString > const &) ...@@ -94,7 +94,7 @@ sal_Int32 Client::run(css::uno::Sequence< OUString > const &)
} }
relay->start(this); relay->start(this);
if (!data.setData(reinterpret_cast< void * >(12345))) { if (!data.setData(reinterpret_cast< void * >(12345))) {
throw new css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( "osl::ThreadData::setData failed" ), OUString( "osl::ThreadData::setData failed" ),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
......
...@@ -63,7 +63,7 @@ sal_Int32 Server::get() throw (css::uno::RuntimeException) { ...@@ -63,7 +63,7 @@ sal_Int32 Server::get() throw (css::uno::RuntimeException) {
css::uno::Reference< css::lang::XMultiComponentFactory > factory( css::uno::Reference< css::lang::XMultiComponentFactory > factory(
context->getServiceManager()); context->getServiceManager());
if (!factory.is()) { if (!factory.is()) {
throw new css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString( "no component context service manager" ), OUString( "no component context service manager" ),
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
......
...@@ -71,7 +71,7 @@ FunctionDescription::getExceptions() const { ...@@ -71,7 +71,7 @@ FunctionDescription::getExceptions() const {
try { try {
any = m_manager->getByHierarchicalName(name); any = m_manager->getByHierarchicalName(name);
} catch (const css::container::NoSuchElementException & e) { } catch (const css::container::NoSuchElementException & e) {
throw new css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString( (OUString(
"com.sun.star.container.NoSuchElementException: ") "com.sun.star.container.NoSuchElementException: ")
+ e.Message), + e.Message),
...@@ -80,7 +80,7 @@ FunctionDescription::getExceptions() const { ...@@ -80,7 +80,7 @@ FunctionDescription::getExceptions() const {
if (!(any >>= exceptions[i]) if (!(any >>= exceptions[i])
|| exceptions[i]->getTypeClass() != css::uno::TypeClass_EXCEPTION) || exceptions[i]->getTypeClass() != css::uno::TypeClass_EXCEPTION)
{ {
throw new css::uno::RuntimeException( throw css::uno::RuntimeException(
(OUString("not an exception type: ") (OUString("not an exception type: ")
+ name), + name),
css::uno::Reference< css::uno::XInterface >()); //TODO css::uno::Reference< css::uno::XInterface >()); //TODO
......
...@@ -799,7 +799,7 @@ static bool raiseException(XBridgeTest* xLBT ) ...@@ -799,7 +799,7 @@ static bool raiseException(XBridgeTest* xLBT )
bRet = performQueryForUnknownType( xLBT ) && bRet; bRet = performQueryForUnknownType( xLBT ) && bRet;
if (! bRet) if (! bRet)
{ {
throw new unoidl::com::sun::star::uno::RuntimeException( throw unoidl::com::sun::star::uno::RuntimeException(
new String("error: test failed!"), 0); new String("error: test failed!"), 0);
} }
} }
...@@ -819,7 +819,7 @@ static bool raiseException(XBridgeTest* xLBT ) ...@@ -819,7 +819,7 @@ static bool raiseException(XBridgeTest* xLBT )
{ {
if (args->Length < 1) if (args->Length < 1)
{ {
throw new RuntimeException( throw RuntimeException(
"missing argument for bridgetest!", this ); "missing argument for bridgetest!", this );
} }
Object* test_obj = Object* test_obj =
...@@ -846,7 +846,7 @@ static bool raiseException(XBridgeTest* xLBT ) ...@@ -846,7 +846,7 @@ static bool raiseException(XBridgeTest* xLBT )
s->Append(exc->GetType()->Name); s->Append(exc->GetType()->Name);
s->Append(S"\n Message: "); s->Append(S"\n Message: ");
s->Append(exc->Message); s->Append(exc->Message);
throw new unoidl::com::sun::star::uno::RuntimeException( throw unoidl::com::sun::star::uno::RuntimeException(
s->ToString(), 0); s->ToString(), 0);
} }
} }
......
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