diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2005-02-24 13:25:23 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2005-02-24 13:25:23 +0000 |
commit | cb9f2168ab78fe7786dabfdf5204c9dcf8a8bc84 (patch) | |
tree | af16e5d26ca15d76e268786f212862c2a7b3328b /pyuno | |
parent | 6f957eb2083a9b3af6ecaa92ea918f6289393ed4 (diff) |
INTEGRATION: CWS systempython2 (1.8.2); FILE MERGED
2005/02/18 08:50:37 cmc 1.8.2.1: #i41994# systempython post pyunofixes1
Diffstat (limited to 'pyuno')
-rw-r--r-- | pyuno/source/module/pyuno_module.cxx | 8 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_runtime.cxx | 43 |
2 files changed, 7 insertions, 44 deletions
diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx index 16dc6bd71cea..f497493ae83e 100644 --- a/pyuno/source/module/pyuno_module.cxx +++ b/pyuno/source/module/pyuno_module.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pyuno_module.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: hr $ $Date: 2005-02-11 16:40:42 $ + * last change: $Author: vg $ $Date: 2005-02-24 14:25:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -597,8 +597,6 @@ static PyObject * fileUrlToSystemPath( PyObject *self, PyObject * args ) static PyObject * absolutize( PyObject *self, PyObject * args ) { - Py_UNICODE * path = 0; - Py_UNICODE * rel = 0; if( PyTuple_Check( args ) && PyTuple_Size( args ) == 2 ) { OUString ouPath = pyString2ustring( PyTuple_GetItem( args , 0 ) ); @@ -621,7 +619,7 @@ static PyObject * absolutize( PyObject *self, PyObject * args ) OUStringToOString(buf.makeStringAndClear(),osl_getThreadTextEncoding())); return 0; } - return PyUnicode_FromUnicode( (const Py_UNICODE * ) ret.pData->buffer, ret.pData->length ); + return ustring2PyUnicode( ret ).getAcquired(); } return 0; } diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index f7b5b5545efd..070b0a243d03 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pyuno_runtime.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: hr $ $Date: 2005-02-11 16:40:55 $ + * last change: $Author: vg $ $Date: 2005-02-24 14:25:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -654,44 +654,9 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con a <<= d; } else if (PyString_Check (o)) - { - // needed, if ByteSequence becomes a string -// Runtime runtime; -// if( PyObject_IsInstance( o, getByteSequenceClass( runtime ).get() ) ) -// { -// // is it the byte sequence ? -// Sequence< sal_Int8 > seq; -// seq = Sequence<sal_Int8 > ((sal_Int8*) PyString_AsString(o) , PyString_Size(o)); -// a <<= seq; -// } -// else -// { - a <<= OUString(PyString_AsString (o), strlen( PyString_AsString(o)), - osl_getThreadTextEncoding()); -// } - } + a <<= pyString2ustring(o); else if( PyUnicode_Check( o ) ) - { - OUString s; - if( sizeof( Py_UNICODE ) == 2 ) - { - s = OUString( (sal_Unicode *) PyUnicode_AsUnicode( o ), PyUnicode_GetSize( o ) ); - } - else if( sizeof( Py_UNICODE ) == 4 ) - { - // fixed for 0.9.2: OUString ctor expects the length of the byte array ! - s = OUString( (sal_Char * ) PyUnicode_AsUnicode( o ), - PyUnicode_GetSize( o ) * sizeof(Py_UNICODE), RTL_TEXTENCODING_UCS4 ); - } - else - { - OUStringBuffer buf; - buf.appendAscii( "pyuno string conversion routines can't deal with sizeof(Py_UNICODE) ==" ); - buf.append( (sal_Int32) sizeof( Py_UNICODE ) ); - throw RuntimeException( buf.makeStringAndClear(), Reference< XInterface > ( ) ); - } - a <<= s; - } + a <<= pyString2ustring(o); else if (PyTuple_Check (o)) { Sequence<Any> s (PyTuple_Size (o)); |