From b7c4b51b41ab8221572ffca01570591d95f07871 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Wed, 13 May 2015 20:51:50 +0200 Subject: [PATCH] Fix wxPropertyGrid::DoEndLabelEdit function, cont. Explicit cell content handling for edited label is necessary only for column other then 0 because cell handling for label in column is 0 is done inside wxPGProperty::SetLabel() function. --- src/propgrid/propgrid.cpp | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index ad32175d84..102a18e3b2 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -1093,21 +1093,30 @@ void wxPropertyGrid::DoEndLabelEdit( bool commit, int selFlags ) } wxString text = m_labelEditor->GetValue(); - wxPGCell* cell = NULL; - if ( prop->HasCell(labelColIdx) ) - { - cell = &prop->GetCell(labelColIdx); - } - else if ( labelColIdx != 0 ) - { - cell = &prop->GetOrCreateCell(labelColIdx); - } - if ( labelColIdx == 0 ) + // Cell handling for label in column 0 + // is done internally in SetLabel() function + if ( labelColIdx == 0 ) + { prop->SetLabel(text); + } + else + { + wxPGCell* cell = NULL; + if ( prop->HasCell(labelColIdx) ) + { + cell = &prop->GetCell(labelColIdx); + } + else + { + cell = &prop->GetOrCreateCell(labelColIdx); + } - if ( cell && cell->HasText() ) - cell->SetText(text); + if ( cell && cell->HasText() ) + { + cell->SetText(text); + } + } } m_selColumn = 1;