Integrate C++11 branch into 5_1-new
This commit is contained in:
@@ -79,7 +79,7 @@ static bool ValidateLocalProfileName( const RString &sAnswer, RString &sErrorOut
|
||||
}
|
||||
|
||||
Profile *pProfile = PROFILEMAN->GetLocalProfile( GAMESTATE->m_sEditLocalProfileID );
|
||||
if( pProfile != NULL && sAnswer == pProfile->m_sDisplayName )
|
||||
if( pProfile != nullptr && sAnswer == pProfile->m_sDisplayName )
|
||||
return true; // unchanged
|
||||
|
||||
vector<RString> vsProfileNames;
|
||||
@@ -127,12 +127,12 @@ void ScreenOptionsManageProfiles::BeginScreen()
|
||||
|
||||
PROFILEMAN->GetLocalProfileIDs( m_vsLocalProfileID );
|
||||
|
||||
FOREACH_CONST( RString, m_vsLocalProfileID, s )
|
||||
for (RString const &s : m_vsLocalProfileID)
|
||||
{
|
||||
Profile *pProfile = PROFILEMAN->GetLocalProfile( *s );
|
||||
ASSERT( pProfile != NULL );
|
||||
Profile *pProfile = PROFILEMAN->GetLocalProfile( s );
|
||||
ASSERT( pProfile != nullptr );
|
||||
|
||||
RString sCommand = ssprintf( "gamecommand;screen,ScreenOptionsCustomizeProfile;profileid,%s;name,dummy", s->c_str() );
|
||||
RString sCommand = ssprintf( "gamecommand;screen,ScreenOptionsCustomizeProfile;profileid,%s;name,dummy", s.c_str() );
|
||||
OptionRowHandler *pHand = OptionRowHandlerUtil::Make( ParseCommands(sCommand) );
|
||||
OptionRowDefinition &def = pHand->m_Def;
|
||||
def.m_layoutType = LAYOUT_SHOW_ALL_IN_ROW;
|
||||
@@ -143,7 +143,7 @@ void ScreenOptionsManageProfiles::BeginScreen()
|
||||
|
||||
PlayerNumber pn = PLAYER_INVALID;
|
||||
FOREACH_PlayerNumber( p )
|
||||
if( *s == ProfileManager::m_sDefaultLocalProfileID[p].Get() )
|
||||
if( s == ProfileManager::m_sDefaultLocalProfileID[p].Get() )
|
||||
pn = p;
|
||||
if( pn != PLAYER_INVALID )
|
||||
def.m_vsChoices.push_back( PlayerNumberToLocalizedString(pn) );
|
||||
@@ -217,12 +217,13 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM )
|
||||
if( iNumProfiles < NUM_PLAYERS )
|
||||
{
|
||||
int iFirstUnused = -1;
|
||||
FOREACH_CONST( Preference<RString>*, PROFILEMAN->m_sDefaultLocalProfileID.m_v, i )
|
||||
int index = 0;
|
||||
for (Preference<RString> const *i : PROFILEMAN->m_sDefaultLocalProfileID.m_v)
|
||||
{
|
||||
RString sLocalProfileID = (*i)->Get();
|
||||
RString sLocalProfileID = i->Get();
|
||||
if( sLocalProfileID.empty() )
|
||||
{
|
||||
iFirstUnused = i - PROFILEMAN->m_sDefaultLocalProfileID.m_v.begin();
|
||||
iFirstUnused = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -278,7 +279,7 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM )
|
||||
if( !ScreenMiniMenu::s_bCancelled )
|
||||
{
|
||||
Profile *pProfile = PROFILEMAN->GetLocalProfile( GAMESTATE->m_sEditLocalProfileID );
|
||||
ASSERT( pProfile != NULL );
|
||||
ASSERT( pProfile != nullptr );
|
||||
|
||||
switch( ScreenMiniMenu::s_iLastRowCode )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user