diff options
author | Alexander Bergmann <myaddons@gmx.de> | 2012-02-10 14:20:12 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-02-10 14:20:52 +0000 |
commit | 99b2adf721fa424e0a02c4458774b8829cd33bf2 (patch) | |
tree | eb577fbc332ce9767c4688a3cca639e456a287ed /pyuno | |
parent | 740cf4a5903dd7aaad4e60ab71a43b062e1d50d8 (diff) |
Removed unused code
Diffstat (limited to 'pyuno')
-rw-r--r-- | pyuno/inc/pyuno/pyuno.hxx | 11 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_impl.hxx | 2 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_runtime.cxx | 17 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_type.cxx | 104 |
4 files changed, 0 insertions, 134 deletions
diff --git a/pyuno/inc/pyuno/pyuno.hxx b/pyuno/inc/pyuno/pyuno.hxx index e3db6acc2e97..3b2a4b785818 100644 --- a/pyuno/inc/pyuno/pyuno.hxx +++ b/pyuno/inc/pyuno/pyuno.hxx @@ -174,21 +174,10 @@ public: const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & ctx ) throw ( com::sun::star::uno::RuntimeException ); - /** Checks, whether the uno runtime is already initialized in the current python interpreter. */ static bool SAL_CALL isInitialized() throw (com::sun::star::uno::RuntimeException); - - /** disposes the UNO bridge in this interpreter. All existing stubs/proxies - become non-functional, using these proxies/stubs leads to runtime errors. - - preconditions: python has been initialized before and - the global interpreter lock is held and pyuno was - initialized before for the currently in use interpreter. - */ - static void SAL_CALL finalize() throw(com::sun::star::uno::RuntimeException ); - /** converts something contained in an UNO Any to a Python object preconditions: python has been initialized before, diff --git a/pyuno/source/module/pyuno_impl.hxx b/pyuno/source/module/pyuno_impl.hxx index 944b87985486..bf785a7b39e6 100644 --- a/pyuno/source/module/pyuno_impl.hxx +++ b/pyuno/source/module/pyuno_impl.hxx @@ -206,8 +206,6 @@ PyObject* PyUNO_Enum_new( const char *enumBase, const char *enumValue, const Run PyObject* PyUNO_char_new (sal_Unicode c , const Runtime &r); PyObject *PyUNO_ByteSequence_new( const com::sun::star::uno::Sequence< sal_Int8 > &, const Runtime &r ); -PyObject *importToGlobal( PyObject *typeName, PyObject *dict, PyObject *targetName ); - PyRef getTypeClass( const Runtime &); PyRef getEnumClass( const Runtime &); PyRef getBoolClass( const Runtime &); diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index f38dccd227c1..459e8875ded2 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -356,23 +356,6 @@ bool Runtime::isInitialized() throw ( RuntimeException ) return runtime.is() && impl->cargo->valid; } -void Runtime::finalize() throw (RuntimeException) -{ - PyRef globalDict, runtime; - getRuntimeImpl( globalDict , runtime ); - RuntimeImpl *impl = reinterpret_cast< RuntimeImpl * > (runtime.get()); - if( !runtime.is() || ! impl->cargo->valid ) - { - throw RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM( - "pyuno bridge must have been initialized before finalizing" )), - Reference< XInterface > () ); - } - impl->cargo->valid = false; - impl->cargo->xInvocation.clear(); - impl->cargo->xContext.clear(); - impl->cargo->xTypeConverter.clear(); -} - Runtime::Runtime() throw( RuntimeException ) : impl( 0 ) { diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx index c1897640d441..4e97e3f938e4 100644 --- a/pyuno/source/module/pyuno_type.cxx +++ b/pyuno/source/module/pyuno_type.cxx @@ -259,110 +259,6 @@ Type PyType2Type( PyObject * o ) throw(RuntimeException ) return desc.get()->pWeakRef; } -PyObject *importToGlobal(PyObject *str, PyObject *dict, PyObject *target) -{ - // maybe a constant ? - PyObject *ret = 0; - OUString name = pyString2ustring(str); - try - { - Runtime runtime; - TypeDescription desc(name ); - desc.makeComplete(); - if( desc.is() ) - { - com::sun::star::uno::TypeClass tc = - (com::sun::star::uno::TypeClass)desc.get()->eTypeClass; - - PyRef typesModule( PyDict_GetItemString( dict, "unotypes" ) ); - if( ! typesModule.is() || ! PyModule_Check( typesModule.get() )) - { - typesModule = PyRef( PyModule_New( "unotypes" ), SAL_NO_ACQUIRE ); - Py_INCREF( typesModule.get() ); - PyDict_SetItemString( dict, "unotypes" , typesModule.get() ); - } - PyModule_AddObject( - typesModule.get(), - PyString_AsString( target ), - PyUNO_Type_new( PyString_AsString(str),tc,runtime ) ); - - if( com::sun::star::uno::TypeClass_EXCEPTION == tc || - com::sun::star::uno::TypeClass_STRUCT == tc ) - { - PyRef exc = getClass( name, runtime ); - PyDict_SetItem( dict, target, exc.getAcquired() ); - } - else if( com::sun::star::uno::TypeClass_ENUM == tc ) - { - // introduce all enums into the dictionary ! - typelib_EnumTypeDescription *pDesc = - (typelib_EnumTypeDescription *) desc.get(); - for( int i = 0 ; i < pDesc->nEnumValues; i ++ ) - { - OString enumElementName( - OUStringToOString( pDesc->ppEnumNames[i], RTL_TEXTENCODING_ASCII_US) ); - PyDict_SetItemString( - dict, (char*)enumElementName.getStr(), - PyUNO_Enum_new(PyString_AsString(str) , enumElementName.getStr(), runtime ) ); - } - } - Py_INCREF( Py_None ); - ret = Py_None; - } - else - { - Any a = runtime.getImpl()->cargo->xTdMgr->getByHierarchicalName(name); - if(a.hasValue()) - { - PyRef constant = runtime.any2PyObject( a ); - if( constant.is() ) - { - Py_INCREF( constant.get() ); - PyDict_SetItem( dict, target , constant.get()); - ret = constant.get(); - } - else - { - OStringBuffer buf; - buf.append( "constant " ).append(PyString_AsString(str)).append( " unknown" ); - PyErr_SetString( PyExc_RuntimeError, buf.getStr() ); - } - } - else - { - OUStringBuffer buf; - buf.appendAscii( "pyuno.imp unknown type " ); - buf.append( name ); - PyErr_SetString( - PyExc_RuntimeError, - OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US).getStr() ); - } - } - } - catch( com::sun::star::container::NoSuchElementException & ) - { - OUStringBuffer buf; - buf.appendAscii( "pyuno.imp unknown type " ); - buf.append( name ); - PyErr_SetString( - PyExc_RuntimeError, - OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US).getStr() ); - } - catch( const com::sun::star::script::CannotConvertException & e ) - { - raisePyExceptionWithAny( com::sun::star::uno::makeAny( e ) ); - } - catch( const com::sun::star::lang::IllegalArgumentException & e ) - { - raisePyExceptionWithAny( com::sun::star::uno::makeAny( e ) ); - } - catch( const RuntimeException &e ) - { - raisePyExceptionWithAny( com::sun::star::uno::makeAny( e )); - } - return ret; -} - static PyObject* callCtor( const Runtime &r , const char * clazz, const PyRef & args ) { PyRef code( PyDict_GetItemString( r.getImpl()->cargo->getUnoModule().get(), (char*)clazz ) ); |