Kaydet (Commit) 419ae576 authored tarafından Mike Kaganski's avatar Mike Kaganski

Partially revert c3609f10

Change-Id: I92c84d0d0fba1adcd0adfc93e3fe9b5ea6b8cbf2
Reviewed-on: https://gerrit.libreoffice.org/43065Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
Tested-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst addd1c34
...@@ -43,7 +43,7 @@ PyRef ustring2PyUnicode( const OUString & str ) ...@@ -43,7 +43,7 @@ PyRef ustring2PyUnicode( const OUString & str )
ret = PyRef( PyUnicode_FromUnicode( reinterpret_cast<const unsigned short *>(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE ); ret = PyRef( PyUnicode_FromUnicode( reinterpret_cast<const unsigned short *>(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE );
#else #else
static_assert(sizeof (wchar_t) == Py_UNICODE_SIZE, "bad assumption"); static_assert(sizeof (wchar_t) == Py_UNICODE_SIZE, "bad assumption");
ret = PyRef( PyUnicode_FromUnicode( SAL_W(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE ); ret = PyRef( PyUnicode_FromUnicode( reinterpret_cast<wchar_t const *>(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE );
#endif #endif
#else #else
OString sUtf8(OUStringToOString(str, RTL_TEXTENCODING_UTF8)); OString sUtf8(OUStringToOString(str, RTL_TEXTENCODING_UTF8));
...@@ -64,7 +64,8 @@ OUString pyString2ustring( PyObject *pystr ) ...@@ -64,7 +64,8 @@ OUString pyString2ustring( PyObject *pystr )
if( PyUnicode_Check( pystr ) ) if( PyUnicode_Check( pystr ) )
{ {
#if Py_UNICODE_SIZE == 2 #if Py_UNICODE_SIZE == 2
ret = SAL_U(PyUnicode_AS_UNICODE( pystr )); ret = OUString(
reinterpret_cast<sal_Unicode const *>(PyUnicode_AS_UNICODE( pystr )) );
#else #else
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
Py_ssize_t size(0); Py_ssize_t size(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment