You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2012/01/16 20:27:23 UTC

svn commit: r1232123 - /incubator/ooo/trunk/main/pyuno/source/module/pyuno_adapter.cxx

Author: arielch
Date: Mon Jan 16 19:27:22 2012
New Revision: 1232123

URL: http://svn.apache.org/viewvc?rev=1232123&view=rev
Log:
i118798 - Fix Pyuno dead-lock

Modified:
    incubator/ooo/trunk/main/pyuno/source/module/pyuno_adapter.cxx

Modified: incubator/ooo/trunk/main/pyuno/source/module/pyuno_adapter.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/pyuno/source/module/pyuno_adapter.cxx?rev=1232123&r1=1232122&r2=1232123&view=diff
==============================================================================
--- incubator/ooo/trunk/main/pyuno/source/module/pyuno_adapter.cxx (original)
+++ incubator/ooo/trunk/main/pyuno/source/module/pyuno_adapter.cxx Mon Jan 16 19:27:22 2012
@@ -363,20 +363,20 @@ Any Adapter::invoke( const OUString &aFu
 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);