[wpdev-commits] wolfpack/python char.cpp,1.115,1.116 item.cpp,1.80,1.81
Brought to you by:
rip,
thiagocorrea
|
From: <dar...@pr...> - 2004-01-28 02:13:27
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8334/python Modified Files: char.cpp item.cpp Log Message: Fixes for Unicode in Properties/Tags. Needed for Books. Index: char.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** char.cpp 25 Jan 2004 20:24:26 -0000 1.115 --- char.cpp 28 Jan 2004 02:12:20 -0000 1.116 *************** *** 664,667 **** --- 664,669 ---- if (PyString_Check(object)) { self->pChar->setTag(key, cVariant(PyString_AsString(object))); + } else if (PyUnicode_Check(object)) { + self->pChar->setTag(key, cVariant(QString::fromUcs2(PyUnicode_AsUnicode(object)))); } else if (PyInt_Check(object)) { self->pChar->setTag(key, cVariant((int)PyInt_AsLong(object))); *************** *** 1924,1927 **** --- 1926,1931 ---- if( PyString_Check( value ) ) val = cVariant( PyString_AsString( value ) ); + else if( PyUnicode_Check( value ) ) + val = cVariant(QString::fromUcs2(PyUnicode_AsUnicode(value))); else if( PyInt_Check( value ) ) val = cVariant( PyInt_AsLong( value ) ); Index: item.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** item.cpp 25 Jan 2004 20:24:26 -0000 1.80 --- item.cpp 28 Jan 2004 02:12:20 -0000 1.81 *************** *** 377,380 **** --- 377,382 ---- if (PyString_Check(object)) { self->pItem->setTag(key, cVariant(PyString_AsString(object))); + } else if (PyUnicode_Check(object)) { + self->pItem->setTag(key, cVariant(QString::fromUcs2(PyUnicode_AsUnicode(object)))); } else if (PyInt_Check(object)) { self->pItem->setTag(key, cVariant((int)PyInt_AsLong(object))); *************** *** 810,813 **** --- 812,817 ---- if( PyString_Check( value ) ) val = cVariant( PyString_AsString( value ) ); + else if( PyUnicode_Check( value ) ) + val = cVariant(QString::fromUcs2(PyUnicode_AsUnicode(value))); else if( PyInt_Check( value ) ) val = cVariant( PyInt_AsLong( value ) ); |