@@ -95,19 +95,9 @@ void CPythonListViewImpl::DrawItem(LPDRAWITEMSTRUCT lpDIS)
9595        obDC = Py_None;
9696    }
9797
98-     PyObject *args = helper.build_args (" iiiiiiO(iiii)O" CtlType , lpDIS->CtlID , lpDIS->itemID , lpDIS->itemAction ,
99-                                    lpDIS->itemState , lpDIS->hwndItem , obDC, lpDIS->rcItem .left , lpDIS->rcItem .top ,
100-                                    lpDIS->rcItem .right , lpDIS->rcItem .bottom , obData);
101-     ASSERT (args);
102-     if  (!args) {
103-         gui_print_error ();
104-         PyErr_SetString (ui_module_error, " DrawItem could not convert args - handler not called." 
105-         return ;  //  not too much we can do
106-     }
107-     //  make the call.
108-     helper.call_args (args);
109-     //  Cleanup.
110-     Py_DECREF (args);
98+     helper.call_args (" iiiiiiO(iiii)O" CtlType , lpDIS->CtlID , lpDIS->itemID , lpDIS->itemAction ,
99+                      lpDIS->itemState , lpDIS->hwndItem , obDC, lpDIS->rcItem .left , lpDIS->rcItem .top ,
100+                      lpDIS->rcItem .right , lpDIS->rcItem .bottom , obData);
111101    //  The DC is no longer valid.
112102    Python_delete_assoc (pDC);
113103}
@@ -141,19 +131,9 @@ void CPythonTreeViewImpl::DrawItem(LPDRAWITEMSTRUCT lpDIS)
141131        obDC = Py_None;
142132    }
143133
144-     PyObject *args = helper.build_args (" iiiiiiO(iiii)O" CtlType , lpDIS->CtlID , lpDIS->itemID , lpDIS->itemAction ,
145-                                    lpDIS->itemState , lpDIS->hwndItem , obDC, lpDIS->rcItem .left , lpDIS->rcItem .top ,
146-                                    lpDIS->rcItem .right , lpDIS->rcItem .bottom , obData);
147-     ASSERT (args);
148-     if  (!args) {
149-         gui_print_error ();
150-         PyErr_SetString (ui_module_error, " DrawItem could not convert args - handler not called." 
151-         return ;  //  not too much we can do
152-     }
153-     //  make the call.
154-     helper.call_args (args);
155-     //  Cleanup.
156-     Py_DECREF (args);
134+     helper.call_args (" iiiiiiO(iiii)O" CtlType , lpDIS->CtlID , lpDIS->itemID , lpDIS->itemAction ,
135+                      lpDIS->itemState , lpDIS->hwndItem , obDC, lpDIS->rcItem .left , lpDIS->rcItem .top ,
136+                      lpDIS->rcItem .right , lpDIS->rcItem .bottom , obData);
157137    //  The DC is no longer valid.
158138    Python_delete_assoc (pDC);
159139}
0 commit comments