From a4f2f2ec6c22ff067b54d1f0cc19640c1a06f4a0 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 db7426912e..8e19f1a4f0 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -1069,15 +1069,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); }