Use wxString's empty() when checking if the string is (non-)empty throughout wx.
Instead of constructs such as if "( s.length() )" and "if (s.length() > 0)" use "if ( !s.empty() )" instead. Similarly for "if (s.length() == 0)" or "if ( s.IsNull() )", use "if ( s.empty() )". No code changes intended except for a few instances where a construct like "if ( s.length() && wxFileExists(s) )" was changed to not check the length of the string and let wxFileExists handle such cases. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -444,7 +444,7 @@ bool wxPGTextCtrlEditor::GetTextCtrlValueFromControl( wxVariant& variant, wxPGPr
|
||||
wxTextCtrl* tc = wxStaticCast(ctrl, wxTextCtrl);
|
||||
wxString textVal = tc->GetValue();
|
||||
|
||||
if ( property->UsesAutoUnspecified() && !textVal.length() )
|
||||
if ( property->UsesAutoUnspecified() && textVal.empty() )
|
||||
{
|
||||
variant.MakeNull();
|
||||
return true;
|
||||
@@ -1070,10 +1070,10 @@ wxWindow* wxPGChoiceEditor::CreateControlsBase( wxPropertyGrid* propGrid,
|
||||
if ( index >= 0 && index < (int)cb->GetCount() )
|
||||
{
|
||||
cb->SetSelection( index );
|
||||
if ( defString.length() )
|
||||
if ( !defString.empty() )
|
||||
cb->SetText( defString );
|
||||
}
|
||||
else if ( !(extraStyle & wxCB_READONLY) && defString.length() )
|
||||
else if ( !(extraStyle & wxCB_READONLY) && !defString.empty() )
|
||||
{
|
||||
propGrid->SetupTextCtrlValue(defString);
|
||||
cb->SetValue( defString );
|
||||
@@ -1283,7 +1283,7 @@ bool wxPGComboBoxEditor::GetValueFromControl( wxVariant& variant, wxPGProperty*
|
||||
wxOwnerDrawnComboBox* cb = (wxOwnerDrawnComboBox*)ctrl;
|
||||
wxString textVal = cb->GetValue();
|
||||
|
||||
if ( property->UsesAutoUnspecified() && !textVal.length() )
|
||||
if ( property->UsesAutoUnspecified() && textVal.empty() )
|
||||
{
|
||||
variant.MakeNull();
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user