Bugzilla – Attachment 58412 Details for
Bug 46926
PyUNO structure comparisons broken (always false)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Return new references from PyUNO_cmp
pyuno.cxx.diff (text/plain), 2.22 KB, created by
David Bolen
on 2012-03-13 18:27:49 UTC
(
hide
)
Description:
Return new references from PyUNO_cmp
Filename:
MIME Type:
Creator:
David Bolen
Created:
2012-03-13 18:27:49 UTC
Size:
2.22 KB
patch
obsolete
>diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx >index 7f5f0b5..b712ae4 100644 >--- a/pyuno/source/module/pyuno.cxx >+++ b/pyuno/source/module/pyuno.cxx >@@ -595,6 +595,8 @@ int PyUNO_setattr (PyObject* self, char* name, PyObject* value) > // ensure object identity and struct equality > static PyObject* PyUNO_cmp( PyObject *self, PyObject *that, int op ) > { >+ PyObject *result; >+ > if(op != Py_EQ && op != Py_NE) > { > PyErr_SetString(PyExc_TypeError, "only '==' and '!=' comparisions are defined"); >@@ -602,7 +604,9 @@ static PyObject* PyUNO_cmp( PyObject *self, PyObject *that, int op ) > } > if( self == that ) > { >- return (op == Py_EQ ? Py_True : Py_False); >+ result = (op == Py_EQ ? Py_True : Py_False); >+ Py_INCREF(result); >+ return result; > } > try > { >@@ -624,14 +628,18 @@ static PyObject* PyUNO_cmp( PyObject *self, PyObject *that, int op ) > Reference< XMaterialHolder > xOther( other->members->xInvocation,UNO_QUERY ); > if( xMe->getMaterial() == xOther->getMaterial() ) > { >- return (op == Py_EQ ? Py_True : Py_False); >+ result = (op == Py_EQ ? Py_True : Py_False); >+ Py_INCREF(result); >+ return result; > } > } > else if( tcMe == com::sun::star::uno::TypeClass_INTERFACE ) > { > if( me->members->wrappedObject == other->members->wrappedObject ) > { >- return (op == Py_EQ ? Py_True : Py_False); >+ result = (op == Py_EQ ? Py_True : Py_False); >+ Py_INCREF(result); >+ return result; > } > } > } >@@ -641,7 +649,10 @@ static PyObject* PyUNO_cmp( PyObject *self, PyObject *that, int op ) > { > raisePyExceptionWithAny( makeAny( e ) ); > } >- return (op == Py_EQ ? Py_False : Py_True); >+ >+ result = (op == Py_EQ ? Py_False : Py_True); >+ Py_INCREF(result); >+ return result; > } > > /* Python 2 has a tp_flags value for rich comparisons. Python 3 does not (on by default) */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 46926
:
57987
|
58017
| 58412