Fixes crash when calling Treeview_EndEditLabelNow and no node is
currently edited.
This commit is contained in:
parent
820da77db3
commit
bfd5b31a0e
|
@ -3116,7 +3116,7 @@ TREEVIEW_EndEditLabelNow (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
else if( newText!=NULL )
|
else if( newText!=NULL )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
** Is really this necasery? shouldnt an app update its internal data in TVN_ENDLABELEDITA?
|
** Is really this necessary? shouldnt an app update its internal data in TVN_ENDLABELEDITA?
|
||||||
*/
|
*/
|
||||||
if( !bRevert )
|
if( !bRevert )
|
||||||
{
|
{
|
||||||
|
@ -3910,10 +3910,11 @@ TREEVIEW_SetScrollTime (HWND hwnd, UINT uScrollTime)
|
||||||
static LRESULT WINAPI
|
static LRESULT WINAPI
|
||||||
TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
TREEVIEW_INFO *infoPtr;
|
||||||
if (uMsg==WM_CREATE)
|
if (uMsg==WM_CREATE)
|
||||||
return TREEVIEW_Create (hwnd, wParam, lParam);
|
return TREEVIEW_Create (hwnd, wParam, lParam);
|
||||||
|
|
||||||
if (!TREEVIEW_GetInfoPtr(hwnd))
|
if (!(infoPtr = TREEVIEW_GetInfoPtr(hwnd)))
|
||||||
return DefWindowProcA (hwnd, uMsg, wParam, lParam);
|
return DefWindowProcA (hwnd, uMsg, wParam, lParam);
|
||||||
|
|
||||||
switch (uMsg) {
|
switch (uMsg) {
|
||||||
|
@ -3998,6 +3999,7 @@ TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
return TREEVIEW_SortChildrenCB(hwnd, wParam, lParam);
|
return TREEVIEW_SortChildrenCB(hwnd, wParam, lParam);
|
||||||
|
|
||||||
case TVM_ENDEDITLABELNOW:
|
case TVM_ENDEDITLABELNOW:
|
||||||
|
if (infoPtr->editItem)
|
||||||
return TREEVIEW_EndEditLabelNow (hwnd, wParam, lParam);
|
return TREEVIEW_EndEditLabelNow (hwnd, wParam, lParam);
|
||||||
|
|
||||||
case TVM_GETISEARCHSTRINGA:
|
case TVM_GETISEARCHSTRINGA:
|
||||||
|
|
Loading…
Reference in New Issue