From dec03c5d897542e2e9ad640ee24013229e7de596 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek <7330332+a-wi@users.noreply.github.com> Date: Fri, 6 Jan 2023 17:51:32 +0200 Subject: [PATCH] Use dedicated function to get common value label in wxPropertyGrid --- include/wx/propgrid/propgrid.h | 2 +- src/propgrid/editors.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index f23c52efcc..fe6ad9f2c4 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1136,7 +1136,7 @@ public: wxString GetCommonValueLabel( unsigned int i ) const { wxCHECK_MSG( i < m_commonValues.size(), wxString(), "Invalid item index" ); - return GetCommonValue(i)->GetLabel(); + return m_commonValues[i]->GetLabel(); } // Returns index of common value that will truly change value to diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 4cb0017210..6be641df03 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -716,8 +716,7 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, comValIndex = item - choiceCount; if ( !p->IsValueUnspecified() || !(flags & wxODCB_PAINTING_CONTROL) ) { - const wxPGCommonValue* cv = GetCommonValue(comValIndex); - text = cv->GetLabel(); + text = GetCommonValueLabel(comValIndex); } } else