From d4440703b26d7189a8de82e8e49aef2ff4645a1a Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 10 May 2015 18:32:00 +0200 Subject: [PATCH] Fixed wxPropertyGrid::DoEndLabelEdit function When label editing is finished then property label has to be always updated. If there is a text which is cached in the corresponding cell then it also needs to be updated. See #16982. --- src/propgrid/propgrid.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 64c72ae52c..ad32175d84 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -1098,15 +1098,15 @@ void wxPropertyGrid::DoEndLabelEdit( bool commit, int selFlags ) { cell = &prop->GetCell(labelColIdx); } - else + else if ( labelColIdx != 0 ) { - if ( labelColIdx == 0 ) - prop->SetLabel(text); - else - cell = &prop->GetOrCreateCell(labelColIdx); + cell = &prop->GetOrCreateCell(labelColIdx); } - if ( cell ) + if ( labelColIdx == 0 ) + prop->SetLabel(text); + + if ( cell && cell->HasText() ) cell->SetText(text); }