+#define WRAP_COLUMN 80
+
+ wxArrayString toinsert;
+ toinsert.Add(INDENTATION_STR + tmp.GetAsString() + ";");
+
+ int nStartColumn = toinsert[0].Find('(');
+ wxASSERT(nStartColumn != wxNOT_FOUND);
+
+ // wrap lines too long at comma boundaries
+ for (unsigned int i=0; i<toinsert.GetCount(); i++)
+ {
+ size_t len = toinsert[i].Len();
+ if (len > WRAP_COLUMN)
+ {
+ wxASSERT(i == toinsert.GetCount()-1);
+
+ // break this line
+ wxString tmpleft = toinsert[i].Left(WRAP_COLUMN);
+ int comma = tmpleft.Find(',', true /* from end */);
+ if (comma == wxNOT_FOUND)
+ break; // break out of the for cycle...
+
+ toinsert.Add(wxString(' ', nStartColumn+1) +
+ toinsert[i].Right(len-comma-2)); // exclude the comma and the space after it
+ toinsert[i] = tmpleft.Left(comma+1); // include the comma
+ }
+ }
+
+ // insert the new lines
+ for (unsigned int i=0; i<toinsert.GetCount(); i++)
+ file.InsertLine(toinsert[i], start+i);