summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/source/module/pyuno_adapter.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx
index 2be265fc3945..08b76ad78a25 100644
--- a/pyuno/source/module/pyuno_adapter.cxx
+++ b/pyuno/source/module/pyuno_adapter.cxx
@@ -359,20 +359,20 @@ Any Adapter::invoke( const OUString &aFunctionName,
void Adapter::setValue( const OUString & aPropertyName, const Any & value )
throw( UnknownPropertyException, CannotConvertException, InvocationTargetException,RuntimeException)
{
+ if( !hasProperty( aPropertyName ) )
+ {
+ OUStringBuffer buf;
+ buf.appendAscii( "pyuno::Adapater: Property " ).append( aPropertyName );
+ buf.appendAscii( " is unknown." );
+ throw UnknownPropertyException( buf.makeStringAndClear(), Reference< XInterface > () );
+ }
+
PyThreadAttach guard( mInterpreter );
try
{
Runtime runtime;
PyRef obj = runtime.any2PyObject( value );
- if( !hasProperty( aPropertyName ) )
- {
- OUStringBuffer buf;
- buf.appendAscii( "pyuno::Adapater: Property " ).append( aPropertyName );
- buf.appendAscii( " is unknown." );
- throw UnknownPropertyException( buf.makeStringAndClear(), Reference< XInterface > () );
- }
-
PyObject_SetAttrString(
mWrappedObject.get(), (char*)TO_ASCII(aPropertyName), obj.get() );
raiseInvocationTargetExceptionWhenNeeded( runtime);