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:
@@ -699,7 +699,7 @@ void wxPropertyGridInterface::SetPropertyCell( wxPGPropArg id,
|
||||
wxPG_PROP_ARG_CALL_PROLOG()
|
||||
|
||||
wxPGCell& cell = p->GetCell(column);
|
||||
if ( text.length() && text != wxPG_LABEL )
|
||||
if ( !text.empty() && text != wxPG_LABEL )
|
||||
cell.SetText(text);
|
||||
if ( bitmap.IsOk() )
|
||||
cell.SetBitmap(bitmap);
|
||||
@@ -932,7 +932,7 @@ wxString wxPropertyGridInterface::SaveEditableState( int includedStates ) const
|
||||
}
|
||||
|
||||
// Remove last '|'
|
||||
if ( result.length() )
|
||||
if ( !result.empty() )
|
||||
result.RemoveLast();
|
||||
|
||||
return result;
|
||||
@@ -1034,13 +1034,13 @@ bool wxPropertyGridInterface::RestoreEditableState( const wxString& src, int res
|
||||
{
|
||||
if ( pageState->IsDisplayed() )
|
||||
{
|
||||
if ( values[0].length() )
|
||||
if ( !values[0].empty() )
|
||||
newSelection = GetPropertyByName(value);
|
||||
pgSelectionSet = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( values[0].length() )
|
||||
if ( !values[0].empty() )
|
||||
pageState->DoSetSelection(GetPropertyByName(value));
|
||||
else
|
||||
pageState->DoClearSelection();
|
||||
|
Reference in New Issue
Block a user