mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 06:34:36 +00:00
Moves from using dStrCmp to the new String::compare static functions. Keeps things cleaner, consistent, and works with intellisense.
This commit is contained in:
parent
76c5e30869
commit
c999baf7ed
68 changed files with 168 additions and 144 deletions
|
|
@ -315,7 +315,7 @@ void GuiFileTreeCtrl::recurseInsert( Item* parent, StringTableEntry path )
|
|||
{
|
||||
bool allowed = (_isDirInMainDotCsPath(value) || matchesFilters(value));
|
||||
Item *exists = parent->findChildByValue( szValue );
|
||||
if( allowed && !exists && dStrcmp( curPos, "" ) != 0 )
|
||||
if( allowed && !exists && String::compare( curPos, "" ) != 0 )
|
||||
{
|
||||
// Since we're adding a child this parent can't be a virtual parent, so clear that flag
|
||||
parent->setVirtualParent( false );
|
||||
|
|
@ -357,7 +357,7 @@ void GuiFileTreeCtrl::recurseInsert( Item* parent, StringTableEntry path )
|
|||
}
|
||||
if( delim )
|
||||
{
|
||||
if( ( dStrcmp( delim, "" ) == 0 ) && item )
|
||||
if( ( String::compare( delim, "" ) == 0 ) && item )
|
||||
{
|
||||
item->setExpanded( false );
|
||||
if( parent && _hasChildren( item->getValue() ) )
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ bool GuiGameListOptionsCtrl::selectOption(S32 rowIndex, const char * theOption)
|
|||
|
||||
for (Vector<StringTableEntry>::iterator anOption = row->mOptions.begin(); anOption < row->mOptions.end(); ++anOption)
|
||||
{
|
||||
if (dStrcmp(*anOption, theOption) == 0)
|
||||
if (String::compare(*anOption, theOption) == 0)
|
||||
{
|
||||
S32 newIndex = anOption - row->mOptions.begin();
|
||||
row->mSelectedOption = newIndex;
|
||||
|
|
|
|||
|
|
@ -513,7 +513,7 @@ S32 GuiListBoxCtrl::findItemText( StringTableEntry text, bool caseSensitive )
|
|||
for( S32 i = 0; i < mItems.size(); i++ )
|
||||
{
|
||||
// Case Sensitive Compare?
|
||||
if( caseSensitive && ( dStrcmp( mItems[i]->itemText, text ) == 0 ) )
|
||||
if( caseSensitive && ( String::compare( mItems[i]->itemText, text ) == 0 ) )
|
||||
return i;
|
||||
else if (!caseSensitive && ( dStricmp( mItems[i]->itemText, text ) == 0 ))
|
||||
return i;
|
||||
|
|
@ -1584,7 +1584,7 @@ void GuiListBoxCtrl::addFilteredItem( String item )
|
|||
for ( S32 i = 0; i < mSelectedItems.size(); i++ )
|
||||
{
|
||||
String itemText = mSelectedItems[i]->itemText;
|
||||
if ( dStrcmp( itemText.c_str(), item.c_str() ) == 0 )
|
||||
if ( String::compare( itemText.c_str(), item.c_str() ) == 0 )
|
||||
{
|
||||
mSelectedItems.erase_fast( i );
|
||||
break;
|
||||
|
|
@ -1594,7 +1594,7 @@ void GuiListBoxCtrl::addFilteredItem( String item )
|
|||
for ( S32 i = 0; i < mItems.size(); i++ )
|
||||
{
|
||||
String itemText = mItems[i]->itemText;
|
||||
if( dStrcmp( itemText.c_str(), item.c_str() ) == 0 )
|
||||
if( String::compare( itemText.c_str(), item.c_str() ) == 0 )
|
||||
{
|
||||
mItems[i]->isSelected = false;
|
||||
mFilteredItems.push_front( mItems[i] );
|
||||
|
|
@ -1627,7 +1627,7 @@ void GuiListBoxCtrl::removeFilteredItem( String item )
|
|||
for ( S32 i = 0; i < mFilteredItems.size(); i++ )
|
||||
{
|
||||
String itemText = mFilteredItems[i]->itemText;
|
||||
if( dStrcmp( itemText.c_str(), item.c_str() ) == 0 )
|
||||
if( String::compare( itemText.c_str(), item.c_str() ) == 0 )
|
||||
{
|
||||
mItems.push_front( mFilteredItems[i] );
|
||||
mFilteredItems.erase( &mFilteredItems[i] );
|
||||
|
|
|
|||
|
|
@ -629,7 +629,7 @@ void GuiPopUpMenuCtrl::addEntry( const char *buf, S32 id, U32 scheme )
|
|||
// Ensure that there are no other entries with exactly the same name
|
||||
for ( U32 i = 0; i < mEntries.size(); i++ )
|
||||
{
|
||||
if ( dStrcmp( mEntries[i].buf, buf ) == 0 )
|
||||
if ( String::compare( mEntries[i].buf, buf ) == 0 )
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -745,7 +745,7 @@ S32 GuiPopUpMenuCtrl::findText( const char* text )
|
|||
{
|
||||
for ( U32 i = 0; i < mEntries.size(); i++ )
|
||||
{
|
||||
if ( dStrcmp( text, mEntries[i].buf ) == 0 )
|
||||
if ( String::compare( text, mEntries[i].buf ) == 0 )
|
||||
return( mEntries[i].id );
|
||||
}
|
||||
return( -1 );
|
||||
|
|
|
|||
|
|
@ -832,7 +832,7 @@ void GuiPopUpMenuCtrlEx::addEntry(const char *buf, S32 id, U32 scheme)
|
|||
// Ensure that there are no other entries with exactly the same name
|
||||
for ( U32 i = 0; i < mEntries.size(); i++ )
|
||||
{
|
||||
if ( dStrcmp( mEntries[i].buf, buf ) == 0 )
|
||||
if ( String::compare( mEntries[i].buf, buf ) == 0 )
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -930,7 +930,7 @@ S32 GuiPopUpMenuCtrlEx::findText( const char* text )
|
|||
{
|
||||
for ( U32 i = 0; i < mEntries.size(); i++ )
|
||||
{
|
||||
if ( dStrcmp( text, mEntries[i].buf ) == 0 )
|
||||
if ( String::compare( text, mEntries[i].buf ) == 0 )
|
||||
return( mEntries[i].id );
|
||||
}
|
||||
return( -1 );
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ void GuiTextEditCtrl::updateHistory( StringBuffer *inTxt, bool moveIndex )
|
|||
return;
|
||||
|
||||
// see if it's already in
|
||||
if(mHistoryLast == -1 || dStrcmp(txt, mHistoryBuf[mHistoryLast]))
|
||||
if(mHistoryLast == -1 || String::compare(txt, mHistoryBuf[mHistoryLast]))
|
||||
{
|
||||
if(mHistoryLast == mHistorySize-1) // we're at the history limit... shuffle the pointers around:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4372,7 +4372,7 @@ S32 GuiTreeViewCtrl::findItemByName(const char *name)
|
|||
continue;
|
||||
if( mItems[i]->mState.test( Item::InspectorData ) )
|
||||
continue;
|
||||
if (mItems[i] && dStrcmp(mItems[i]->getText(),name) == 0)
|
||||
if (mItems[i] && String::compare(mItems[i]->getText(),name) == 0)
|
||||
return mItems[i]->mId;
|
||||
}
|
||||
|
||||
|
|
@ -4389,7 +4389,7 @@ S32 GuiTreeViewCtrl::findItemByValue(const char *name)
|
|||
continue;
|
||||
if( mItems[i]->mState.test( Item::InspectorData ) )
|
||||
continue;
|
||||
if (mItems[i] && dStrcmp(mItems[i]->getValue(),name) == 0)
|
||||
if (mItems[i] && String::compare(mItems[i]->getValue(),name) == 0)
|
||||
return mItems[i]->mId;
|
||||
}
|
||||
|
||||
|
|
@ -5330,7 +5330,7 @@ DefineEngineMethod( GuiTreeViewCtrl, getTextToRoot, const char*, (S32 itemId, co
|
|||
"@param delimiter (Optional) delimiter to use between each branch concatenation."
|
||||
"@return text from the current node to the root.")
|
||||
{
|
||||
if (!dStrcmp(delimiter, "" ))
|
||||
if (!String::compare(delimiter, "" ))
|
||||
{
|
||||
Con::warnf("GuiTreeViewCtrl::getTextToRoot - Invalid number of arguments!");
|
||||
return ("");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue