[pywin32-checkins] /hgroot/pywin32/pywin32: Don't throw an error when CListCtrl::Ge...
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <pyw...@li...> - 2012-08-23 22:09:52
|
changeset e647878b4ccc in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=e647878b4ccc summary: Don't throw an error when CListCtrl::GetItemText returns an empty string, as it can do so legitimately diffstat: Pythonwin/win32ctrlList.cpp | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diffs (27 lines): diff -r 4f51918ce379 -r e647878b4ccc Pythonwin/win32ctrlList.cpp --- a/Pythonwin/win32ctrlList.cpp Wed Aug 22 22:57:09 2012 -0400 +++ b/Pythonwin/win32ctrlList.cpp Thu Aug 23 18:07:43 2012 -0400 @@ -486,7 +486,7 @@ PyObject *PyCListCtrl_GetItemText( PyObject *self, PyObject *args ) { int item, sub; - TCHAR buf[256]; + // TCHAR buf[256]; if (!PyArg_ParseTuple( args, "ii:GetItemText", &item, // @pyparm int|item||The index of the item whose text is to be retrieved. &sub)) // @pyparm int|sub||Specifies the subitem whose text is to be retrieved. @@ -494,11 +494,10 @@ CListCtrl *pList = GetListCtrl(self); if (!pList) return NULL; GUI_BGN_SAVE; - int len = pList->GetItemText(item, sub, buf, sizeof(buf)/sizeof(TCHAR)); + // int len = pList->GetItemText(item, sub, buf, sizeof(buf)/sizeof(TCHAR)); + CString s = pList->GetItemText(item, sub); GUI_END_SAVE; - if (len==0) - RETURN_ERR("GetItemText failed"); - return PyWinObject_FromTCHAR(buf,len); + return PyWinObject_FromTCHAR(s); } // @pymethod int|PyCListCtrl|SetItemText|Changes the text of a list view item or subitem. |