summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-01-26 12:28:58 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-01-26 12:54:43 +0000
commite57ca02849c3d87142ff5ff9099a212e72b8139c (patch)
treebcce66b27261553c308779f3e8663a269ed3a671 /pyuno
parent8802ebd5172ec4bc412a59d136c82b77ab452281 (diff)
Remove dynamic exception specifications
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/inc/pyuno.hxx19
-rw-r--r--pyuno/source/loader/pyuno_loader.cxx5
-rw-r--r--pyuno/source/module/pyuno_adapter.cxx9
-rw-r--r--pyuno/source/module/pyuno_except.cxx1
-rw-r--r--pyuno/source/module/pyuno_impl.hxx47
-rw-r--r--pyuno/source/module/pyuno_module.cxx2
-rw-r--r--pyuno/source/module/pyuno_runtime.cxx16
-rw-r--r--pyuno/source/module/pyuno_type.cxx6
-rw-r--r--pyuno/source/module/pyuno_util.cxx1
9 files changed, 32 insertions, 74 deletions
diff --git a/pyuno/inc/pyuno.hxx b/pyuno/inc/pyuno.hxx
index 84e97646121a..f09cbd051089 100644
--- a/pyuno/inc/pyuno.hxx
+++ b/pyuno/inc/pyuno.hxx
@@ -193,7 +193,7 @@ public:
@throw RuntimeException in case the runtime has not been
initialized before
*/
- Runtime() throw( css::uno::RuntimeException );
+ Runtime();
Runtime( const Runtime & );
Runtime & operator = ( const Runtime & );
@@ -211,14 +211,13 @@ public:
has not been initialized.
*/
static void SAL_CALL initialize(
- const css::uno::Reference< css::uno::XComponentContext > & ctx )
- throw ( css::uno::RuntimeException, std::exception );
+ const css::uno::Reference< css::uno::XComponentContext > & ctx );
/** Checks, whether the uno runtime is already initialized in the current python interpreter.
@throws css::uno::RuntimeException
*/
- static bool SAL_CALL isInitialized() throw (css::uno::RuntimeException);
+ static bool SAL_CALL isInitialized();
/** converts something contained in an UNO Any to a Python object
@@ -230,10 +229,7 @@ public:
@throws css::lang::IllegalArgumentException
@throws css::uno::RuntimeException
*/
- PyRef any2PyObject (const css::uno::Any &source ) const
- throw ( css::script::CannotConvertException,
- css::lang::IllegalArgumentException,
- css::uno::RuntimeException );
+ PyRef any2PyObject (const css::uno::Any &source ) const;
/** converts a Python object to a UNO any
@@ -244,8 +240,7 @@ public:
@throws css::uno::RuntimeException
*/
css::uno::Any pyObject2Any (
- const PyRef & source , enum ConversionMode mode = REJECT_UNO_ANY ) const
- throw ( css::uno::RuntimeException);
+ const PyRef & source , enum ConversionMode mode = REJECT_UNO_ANY ) const;
/** extracts a proper uno exception from a given python exception
*/
@@ -297,7 +292,7 @@ public:
@throws css::uno::RuntimeException
in case no pythread state could be created
*/
- PyThreadAttach( PyInterpreterState *interp) throw ( css::uno::RuntimeException );
+ PyThreadAttach( PyInterpreterState *interp);
/** Releases the global interpreter lock and destroys the thread state.
@@ -324,7 +319,7 @@ public:
@throws css::uno::RuntimeException
*/
- PyThreadDetach() throw ( css::uno::RuntimeException );
+ PyThreadDetach();
/** Acquires the global interpreter lock again
*/
~PyThreadDetach();
diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx
index f37e2c45fce3..01878630353d 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -64,7 +64,7 @@ namespace pyuno_loader
{
/// @throws RuntimeException
-static void raiseRuntimeExceptionWhenNeeded() throw ( RuntimeException )
+static void raiseRuntimeExceptionWhenNeeded()
{
if( PyErr_Occurred() )
{
@@ -81,7 +81,7 @@ static void raiseRuntimeExceptionWhenNeeded() throw ( RuntimeException )
}
/// @throws RuntimeException
-static PyRef getLoaderModule() throw( RuntimeException )
+static PyRef getLoaderModule()
{
PyRef module(
PyImport_ImportModule( "pythonloader" ),
@@ -96,7 +96,6 @@ static PyRef getLoaderModule() throw( RuntimeException )
/// @throws RuntimeException
static PyRef getObjectFromLoaderModule( const char * func )
- throw ( RuntimeException )
{
PyRef object( PyDict_GetItemString(getLoaderModule().get(), func ) );
if( !object.is() )
diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx
index f43d2785797e..65a317b39e7e 100644
--- a/pyuno/source/module/pyuno_adapter.cxx
+++ b/pyuno/source/module/pyuno_adapter.cxx
@@ -70,7 +70,7 @@ Sequence<sal_Int8> Adapter::getUnoTunnelImplementationId()
return g_id.getImplementationId();
}
-sal_Int64 Adapter::getSomething( const Sequence< sal_Int8 > &id) throw (RuntimeException, std::exception)
+sal_Int64 Adapter::getSomething( const Sequence< sal_Int8 > &id)
{
if( id == g_id.getImplementationId() )
return reinterpret_cast<sal_Int64>(this);
@@ -78,7 +78,6 @@ sal_Int64 Adapter::getSomething( const Sequence< sal_Int8 > &id) throw (RuntimeE
}
void raiseInvocationTargetExceptionWhenNeeded( const Runtime &runtime )
- throw ( InvocationTargetException, RuntimeException )
{
if( !Py_IsInitialized() )
throw InvocationTargetException();
@@ -95,7 +94,6 @@ void raiseInvocationTargetExceptionWhenNeeded( const Runtime &runtime )
}
Reference< XIntrospectionAccess > Adapter::getIntrospection()
- throw ( RuntimeException, std::exception )
{
// not supported
return Reference< XIntrospectionAccess > ();
@@ -179,7 +177,6 @@ Any Adapter::invoke( const OUString &aFunctionName,
const Sequence< Any >& aParams,
Sequence< sal_Int16 > &aOutParamIndex,
Sequence< Any > &aOutParam)
- throw (IllegalArgumentException,CannotConvertException,InvocationTargetException,RuntimeException, std::exception)
{
Any ret;
@@ -354,7 +351,6 @@ Any Adapter::invoke( const OUString &aFunctionName,
}
void Adapter::setValue( const OUString & aPropertyName, const Any & value )
- throw( UnknownPropertyException, CannotConvertException, InvocationTargetException,RuntimeException, std::exception)
{
if( !hasProperty( aPropertyName ) )
{
@@ -389,7 +385,6 @@ void Adapter::setValue( const OUString & aPropertyName, const Any & value )
}
Any Adapter::getValue( const OUString & aPropertyName )
- throw ( UnknownPropertyException, RuntimeException, std::exception )
{
Any ret;
PyThreadAttach guard( mInterpreter );
@@ -416,13 +411,11 @@ Any Adapter::getValue( const OUString & aPropertyName )
}
sal_Bool Adapter::hasMethod( const OUString & aMethodName )
- throw ( RuntimeException, std::exception )
{
return hasProperty( aMethodName );
}
sal_Bool Adapter::hasProperty( const OUString & aPropertyName )
- throw ( RuntimeException, std::exception )
{
bool bRet = false;
PyThreadAttach guard( mInterpreter );
diff --git a/pyuno/source/module/pyuno_except.cxx b/pyuno/source/module/pyuno_except.cxx
index a0673696f00f..643f3aaacd7c 100644
--- a/pyuno/source/module/pyuno_except.cxx
+++ b/pyuno/source/module/pyuno_except.cxx
@@ -76,7 +76,6 @@ void raisePyExceptionWithAny( const css::uno::Any &anyExc )
/// @throws RuntimeException
static PyRef createClass( const OUString & name, const Runtime &runtime )
- throw ( RuntimeException )
{
// assuming that this is never deleted !
// note I don't have the knowledge how to initialize these type objects correctly !
diff --git a/pyuno/source/module/pyuno_impl.hxx b/pyuno/source/module/pyuno_impl.hxx
index f38c69aaceca..3f87ad7a9309 100644
--- a/pyuno/source/module/pyuno_impl.hxx
+++ b/pyuno/source/module/pyuno_impl.hxx
@@ -262,8 +262,7 @@ OUString pyString2ustring( PyObject *str );
/// @throws css::reflection::InvocationTargetException
/// @throws css::uno::RuntimeException
-void raiseInvocationTargetExceptionWhenNeeded( const Runtime &runtime )
- throw (css::reflection::InvocationTargetException, css::uno::RuntimeException);
+void raiseInvocationTargetExceptionWhenNeeded( const Runtime &runtime );
PyRef PyUNO_callable_new (
const css::uno::Reference<css::script::XInvocation2> &xInv,
@@ -286,21 +285,17 @@ PyRef getAnyClass( const Runtime &);
PyObject *PyUNO_invoke( PyObject *object, const char *name , PyObject *args );
/// @throws css::uno::RuntimeException
-css::uno::Any PyEnum2Enum( PyObject *obj )
- throw ( css::uno::RuntimeException );
+css::uno::Any PyEnum2Enum( PyObject *obj );
/// @throws css::uno::RuntimeException
-sal_Unicode PyChar2Unicode( PyObject *o )
- throw ( css::uno::RuntimeException );
+sal_Unicode PyChar2Unicode( PyObject *o );
/// @throws css::uno::RuntimeException
-css::uno::Type PyType2Type( PyObject * o )
- throw( css::uno::RuntimeException );
+css::uno::Type PyType2Type( PyObject * o );
void raisePyExceptionWithAny( const css::uno::Any &a );
const char *typeClassToString( css::uno::TypeClass t );
/// @throws css::uno::RuntimeException
-PyRef getObjectFromUnoModule( const Runtime &runtime, const char * object )
- throw ( css::uno::RuntimeException );
+PyRef getObjectFromUnoModule( const Runtime &runtime, const char * object );
bool isInterfaceClass( const Runtime &, PyObject *obj );
bool isInstanceOfStructOrException( PyObject *obj);
@@ -335,8 +330,7 @@ public:
/// @throws css::uno::RuntimeException
static PyRef create(
- const css::uno::Reference< css::uno::XComponentContext > & xContext )
- throw ( css::uno::RuntimeException, std::exception );
+ const css::uno::Reference< css::uno::XComponentContext > & xContext );
};
@@ -363,37 +357,24 @@ public:
// XInvocation
virtual css::uno::Reference< css::beans::XIntrospectionAccess >
- SAL_CALL getIntrospection( ) throw (css::uno::RuntimeException, std::exception) override;
+ SAL_CALL getIntrospection( ) override;
virtual css::uno::Any SAL_CALL invoke(
const OUString& aFunctionName,
const css::uno::Sequence< css::uno::Any >& aParams,
css::uno::Sequence< sal_Int16 >& aOutParamIndex,
- css::uno::Sequence< css::uno::Any >& aOutParam )
- throw (css::lang::IllegalArgumentException,
- css::script::CannotConvertException,
- css::reflection::InvocationTargetException,
- css::uno::RuntimeException, std::exception) override;
+ css::uno::Sequence< css::uno::Any >& aOutParam ) override;
virtual void SAL_CALL setValue(
const OUString& aPropertyName,
- const css::uno::Any& aValue )
- throw (css::beans::UnknownPropertyException,
- css::script::CannotConvertException,
- css::reflection::InvocationTargetException,
- css::uno::RuntimeException, std::exception) override;
-
- virtual css::uno::Any SAL_CALL getValue( const OUString& aPropertyName )
- throw (css::beans::UnknownPropertyException,
- css::uno::RuntimeException, std::exception) override;
- virtual sal_Bool SAL_CALL hasMethod( const OUString& aName )
- throw (css::uno::RuntimeException, std::exception) override;
- virtual sal_Bool SAL_CALL hasProperty( const OUString& aName )
- throw (css::uno::RuntimeException, std::exception) override;
+ const css::uno::Any& aValue ) override;
+
+ virtual css::uno::Any SAL_CALL getValue( const OUString& aPropertyName ) override;
+ virtual sal_Bool SAL_CALL hasMethod( const OUString& aName ) override;
+ virtual sal_Bool SAL_CALL hasProperty( const OUString& aName ) override;
// XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething(
- const css::uno::Sequence< sal_Int8 >& aIdentifier )
- throw (css::uno::RuntimeException, std::exception) override;
+ const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
};
diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx
index 094c7f1ed848..83888802d0ee 100644
--- a/pyuno/source/module/pyuno_module.cxx
+++ b/pyuno/source/module/pyuno_module.cxx
@@ -144,7 +144,7 @@ void fillStruct(
PyObject *initializer,
PyObject *kwinitializer,
fillStructState &state,
- const Runtime &runtime) throw ( RuntimeException )
+ const Runtime &runtime)
{
if( pCompType->pBaseTypeDescription )
fillStruct( inv, pCompType->pBaseTypeDescription, initializer, kwinitializer, state, runtime );
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index e77376f6aaac..b14cbde39a57 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -130,7 +130,6 @@ static PyTypeObject RuntimeImpl_Type =
-----------------------------------------------------------------------*/
/// @throws css::uno::RuntimeException
static void getRuntimeImpl( PyRef & globalDict, PyRef &runtimeImpl )
- throw ( css::uno::RuntimeException )
{
PyThreadState * state = PyThreadState_Get();
if( ! state )
@@ -155,7 +154,7 @@ static void getRuntimeImpl( PyRef & globalDict, PyRef &runtimeImpl )
}
/// @throws RuntimeException
-static PyRef importUnoModule( ) throw ( RuntimeException )
+static PyRef importUnoModule( )
{
// import the uno module
PyRef module( PyImport_ImportModule( "uno" ), SAL_NO_ACQUIRE, NOT_NULL );
@@ -251,7 +250,6 @@ static void readLoggingConfig( sal_Int32 *pLevel, FILE **ppFile )
RuntimeImpl implementations
*-------------------------------------------------------------------*/
PyRef stRuntimeImpl::create( const Reference< XComponentContext > &ctx )
- throw( css::uno::RuntimeException, std::exception )
{
RuntimeImpl *me = PyObject_New (RuntimeImpl, &RuntimeImpl_Type);
if( ! me )
@@ -303,7 +301,6 @@ void stRuntimeImpl::del(PyObject* self)
void Runtime::initialize( const Reference< XComponentContext > & ctx )
- throw ( RuntimeException, std::exception )
{
PyRef globalDict, runtime;
getRuntimeImpl( globalDict , runtime );
@@ -319,7 +316,7 @@ void Runtime::initialize( const Reference< XComponentContext > & ctx )
}
-bool Runtime::isInitialized() throw ( RuntimeException )
+bool Runtime::isInitialized()
{
PyRef globalDict, runtime;
getRuntimeImpl( globalDict , runtime );
@@ -327,7 +324,7 @@ bool Runtime::isInitialized() throw ( RuntimeException )
return runtime.is() && impl->cargo->valid;
}
-Runtime::Runtime() throw( RuntimeException )
+Runtime::Runtime()
: impl( nullptr )
{
PyRef globalDict, runtime;
@@ -363,9 +360,6 @@ Runtime & Runtime::operator = ( const Runtime & r )
}
PyRef Runtime::any2PyObject (const Any &a ) const
- throw ( css::script::CannotConvertException,
- css::lang::IllegalArgumentException,
- RuntimeException)
{
if( ! impl->cargo->valid )
{
@@ -640,7 +634,6 @@ bool Runtime::pyIterUnpack( PyObject *const pObj, Any &a ) const
}
Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) const
- throw ( css::uno::RuntimeException )
{
if( ! impl->cargo->valid )
{
@@ -998,7 +991,6 @@ Any Runtime::extractUnoException( const PyRef & excType, const PyRef &excValue,
PyThreadAttach::PyThreadAttach( PyInterpreterState *interp)
- throw ( css::uno::RuntimeException )
{
tstate = PyThreadState_New( interp );
if( !tstate )
@@ -1013,7 +1005,7 @@ PyThreadAttach::~PyThreadAttach()
PyThreadState_Delete( tstate );
}
-PyThreadDetach::PyThreadDetach() throw ( css::uno::RuntimeException )
+PyThreadDetach::PyThreadDetach()
{
tstate = PyThreadState_Get();
PyEval_ReleaseThread( tstate );
diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx
index b522b8d93aff..2de1b90ef323 100644
--- a/pyuno/source/module/pyuno_type.cxx
+++ b/pyuno/source/module/pyuno_type.cxx
@@ -126,7 +126,7 @@ PyRef getAnyClass( const Runtime & r )
}
-sal_Unicode PyChar2Unicode( PyObject *obj ) throw ( RuntimeException )
+sal_Unicode PyChar2Unicode( PyObject *obj )
{
PyRef value( PyObject_GetAttrString( obj, "value" ), SAL_NO_ACQUIRE );
if( ! PyUnicode_Check( value.get() ) )
@@ -145,7 +145,7 @@ sal_Unicode PyChar2Unicode( PyObject *obj ) throw ( RuntimeException )
return c;
}
-Any PyEnum2Enum( PyObject *obj ) throw ( RuntimeException )
+Any PyEnum2Enum( PyObject *obj )
{
Any ret;
PyRef typeName( PyObject_GetAttrString( obj,"typeName" ), SAL_NO_ACQUIRE);
@@ -202,7 +202,7 @@ Any PyEnum2Enum( PyObject *obj ) throw ( RuntimeException )
}
-Type PyType2Type( PyObject * o ) throw(RuntimeException )
+Type PyType2Type( PyObject * o )
{
PyRef pyName( PyObject_GetAttrString( o, "typeName" ), SAL_NO_ACQUIRE);
if( !PyStr_Check( pyName.get() ) )
diff --git a/pyuno/source/module/pyuno_util.cxx b/pyuno/source/module/pyuno_util.cxx
index 1fd282053b80..4f5901e67806 100644
--- a/pyuno/source/module/pyuno_util.cxx
+++ b/pyuno/source/module/pyuno_util.cxx
@@ -103,7 +103,6 @@ OUString pyString2ustring( PyObject *pystr )
}
PyRef getObjectFromUnoModule( const Runtime &runtime, const char * func )
- throw ( RuntimeException )
{
PyRef object(PyDict_GetItemString( runtime.getImpl()->cargo->getUnoModule().get(), func ) );
if( !object.is() )