Fix wxArrayString and wxArrayInt typemaps so they can be used with
default args. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -159,12 +159,13 @@
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Typemap for wxArrayString from Python sequence objects
|
// Typemap for wxArrayString from Python sequence objects
|
||||||
|
|
||||||
%typemap(in) wxArrayString& {
|
%typemap(in) wxArrayString& (bool temp=False) {
|
||||||
if (! PySequence_Check($input)) {
|
if (! PySequence_Check($input)) {
|
||||||
PyErr_SetString(PyExc_TypeError, "Sequence of strings expected.");
|
PyErr_SetString(PyExc_TypeError, "Sequence of strings expected.");
|
||||||
SWIG_fail;
|
SWIG_fail;
|
||||||
}
|
}
|
||||||
$1 = new wxArrayString;
|
$1 = new wxArrayString;
|
||||||
|
temp = True;
|
||||||
int i, len=PySequence_Length($input);
|
int i, len=PySequence_Length($input);
|
||||||
for (i=0; i<len; i++) {
|
for (i=0; i<len; i++) {
|
||||||
PyObject* item = PySequence_GetItem($input, i);
|
PyObject* item = PySequence_GetItem($input, i);
|
||||||
@@ -180,18 +181,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
%typemap(freearg) wxArrayString& {
|
%typemap(freearg) wxArrayString& {
|
||||||
if ($1) delete $1;
|
if (temp$argnum) delete $1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Typemap for wxArrayInt from Python sequence objects
|
// Typemap for wxArrayInt from Python sequence objects
|
||||||
|
|
||||||
%typemap(in) wxArrayInt& {
|
%typemap(in) wxArrayInt& (bool temp=False) {
|
||||||
if (! PySequence_Check($input)) {
|
if (! PySequence_Check($input)) {
|
||||||
PyErr_SetString(PyExc_TypeError, "Sequence of integers expected.");
|
PyErr_SetString(PyExc_TypeError, "Sequence of integers expected.");
|
||||||
SWIG_fail;
|
SWIG_fail;
|
||||||
}
|
}
|
||||||
$1 = new wxArrayInt;
|
$1 = new wxArrayInt;
|
||||||
|
temp = True;
|
||||||
int i, len=PySequence_Length($input);
|
int i, len=PySequence_Length($input);
|
||||||
for (i=0; i<len; i++) {
|
for (i=0; i<len; i++) {
|
||||||
PyObject* item = PySequence_GetItem($input, i);
|
PyObject* item = PySequence_GetItem($input, i);
|
||||||
@@ -203,7 +205,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
%typemap(freearg) wxArrayInt& {
|
%typemap(freearg) wxArrayInt& {
|
||||||
if ($1) delete $1;
|
if (temp$argnum) delete $1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user