Refactor wxPropertyGrid::OnComboItemPaint
Make the code more readable by reducing scope of some local variables, by simplifying their initialization, etc.
This commit is contained in:
@@ -731,20 +731,18 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
|
|||||||
wxString text;
|
wxString text;
|
||||||
|
|
||||||
const wxPGChoices& choices = p->GetChoices();
|
const wxPGChoices& choices = p->GetChoices();
|
||||||
const wxPGCommonValue* comVal = NULL;
|
|
||||||
int comVals = p->GetDisplayedCommonValueCount();
|
|
||||||
int comValIndex = -1;
|
int comValIndex = -1;
|
||||||
|
|
||||||
int choiceCount = 0;
|
const int choiceCount = choices.IsOk()? choices.GetCount(): 0;
|
||||||
if ( choices.IsOk() )
|
|
||||||
choiceCount = choices.GetCount();
|
|
||||||
|
|
||||||
if ( item >= choiceCount && comVals > 0 )
|
if ( item >= choiceCount && p->GetDisplayedCommonValueCount() > 0 )
|
||||||
{
|
{
|
||||||
comValIndex = item - choiceCount;
|
comValIndex = item - choiceCount;
|
||||||
comVal = GetCommonValue(comValIndex);
|
|
||||||
if ( !p->IsValueUnspecified() )
|
if ( !p->IsValueUnspecified() )
|
||||||
text = comVal->GetLabel();
|
{
|
||||||
|
const wxPGCommonValue* cv = GetCommonValue(comValIndex);
|
||||||
|
text = cv->GetLabel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user