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:
Robin Dunn
2004-02-06 22:15:00 +00:00
parent 7f8f0b88b7
commit c2e6d97098

View File

@@ -159,12 +159,13 @@
//---------------------------------------------------------------------------
// Typemap for wxArrayString from Python sequence objects
%typemap(in) wxArrayString& {
%typemap(in) wxArrayString& (bool temp=False) {
if (! PySequence_Check($input)) {
PyErr_SetString(PyExc_TypeError, "Sequence of strings expected.");
SWIG_fail;
}
$1 = new wxArrayString;
temp = True;
int i, len=PySequence_Length($input);
for (i=0; i<len; i++) {
PyObject* item = PySequence_GetItem($input, i);
@@ -180,18 +181,19 @@
}
%typemap(freearg) wxArrayString& {
if ($1) delete $1;
if (temp$argnum) delete $1;
}
//---------------------------------------------------------------------------
// Typemap for wxArrayInt from Python sequence objects
%typemap(in) wxArrayInt& {
%typemap(in) wxArrayInt& (bool temp=False) {
if (! PySequence_Check($input)) {
PyErr_SetString(PyExc_TypeError, "Sequence of integers expected.");
SWIG_fail;
}
$1 = new wxArrayInt;
temp = True;
int i, len=PySequence_Length($input);
for (i=0; i<len; i++) {
PyObject* item = PySequence_GetItem($input, i);
@@ -203,7 +205,7 @@
}
%typemap(freearg) wxArrayInt& {
if ($1) delete $1;
if (temp$argnum) delete $1;
}