diff --git a/Core/GameEngine/Include/Common/AsciiString.h b/Core/GameEngine/Include/Common/AsciiString.h index 2b04b813d46..53c1e83fc6e 100644 --- a/Core/GameEngine/Include/Common/AsciiString.h +++ b/Core/GameEngine/Include/Common/AsciiString.h @@ -125,7 +125,7 @@ class AsciiString string, so we don't need to construct temporaries for such a common thing. */ - static AsciiString TheEmptyString; + static const AsciiString TheEmptyString; /** Default constructor -- construct a new, empty AsciiString. diff --git a/Core/GameEngine/Include/Common/UnicodeString.h b/Core/GameEngine/Include/Common/UnicodeString.h index 78e0b3e180a..ee362284f9d 100644 --- a/Core/GameEngine/Include/Common/UnicodeString.h +++ b/Core/GameEngine/Include/Common/UnicodeString.h @@ -125,7 +125,7 @@ class UnicodeString string, so we don't need to construct temporaries for such a common thing. */ - static UnicodeString TheEmptyString; + static const UnicodeString TheEmptyString; /** Default constructor -- construct a new, empty UnicodeString. diff --git a/Core/GameEngine/Source/Common/System/AsciiString.cpp b/Core/GameEngine/Source/Common/System/AsciiString.cpp index 1be78989935..9828f7f1e20 100644 --- a/Core/GameEngine/Source/Common/System/AsciiString.cpp +++ b/Core/GameEngine/Source/Common/System/AsciiString.cpp @@ -49,7 +49,7 @@ // ----------------------------------------------------- -/*static*/ AsciiString AsciiString::TheEmptyString; +/*static*/ const AsciiString AsciiString::TheEmptyString; //----------------------------------------------------------------------------- inline char* skipSeps(char* p, const char* seps) diff --git a/Core/GameEngine/Source/Common/System/UnicodeString.cpp b/Core/GameEngine/Source/Common/System/UnicodeString.cpp index 3f0fe47b04f..2d37d843640 100644 --- a/Core/GameEngine/Source/Common/System/UnicodeString.cpp +++ b/Core/GameEngine/Source/Common/System/UnicodeString.cpp @@ -49,7 +49,7 @@ // ----------------------------------------------------- -/*static*/ UnicodeString UnicodeString::TheEmptyString; +/*static*/ const UnicodeString UnicodeString::TheEmptyString; // ----------------------------------------------------- #ifdef RTS_DEBUG diff --git a/Generals/Code/GameEngine/Include/GameClient/IMEManager.h b/Generals/Code/GameEngine/Include/GameClient/IMEManager.h index be703e1bb4a..7b245c5e845 100644 --- a/Generals/Code/GameEngine/Include/GameClient/IMEManager.h +++ b/Generals/Code/GameEngine/Include/GameClient/IMEManager.h @@ -88,7 +88,7 @@ class IMEManagerInterface : public SubsystemInterface virtual Int getCandidateCount() = 0; ///< Returns the total number of candidates - virtual UnicodeString*getCandidate( Int index ) = 0; ///< Returns the candidate string + virtual const UnicodeString* getCandidate( Int index ) = 0; ///< Returns the candidate string virtual Int getSelectedCandidateIndex() = 0; ///< Returns the indexed of the currently selected candidate virtual Int getCandidatePageSize() = 0; ///< Returns the page size for the candidates list virtual Int getCandidatePageStart() = 0; ///< Returns the index of the first visibel candidate diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp index c55a5c984ff..460e2dbed97 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp @@ -202,7 +202,7 @@ void IMECandidateTextAreaDraw( GameWindow *window, WinInstanceData *instData ) for ( Int i = 0; i < count; i++, y+= height ) { - UnicodeString *candidate = ime->getCandidate( first + i ); + const UnicodeString *candidate = ime->getCandidate( first + i ); Int tcolor, bcolor; if ( i == selected ) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp index 0857283fed7..36972035016 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp @@ -109,7 +109,7 @@ class IMEManager : public IMEManagerInterface virtual Int getIndexBase( void ); ///< Get index base for candidate list virtual Int getCandidateCount(); ///< Returns the total number of candidates - virtual UnicodeString*getCandidate( Int index ); ///< Returns the candidate string + virtual const UnicodeString* getCandidate( Int index ); ///< Returns the candidate string virtual Int getSelectedCandidateIndex(); ///< Returns the indexed of the currently selected candidate virtual Int getCandidatePageSize(); ///< Returns the page size for the candidates list virtual Int getCandidatePageStart(); ///< Returns the index of the first visibel candidate @@ -1528,7 +1528,7 @@ Int IMEManager::getCandidateCount() // IMEManager::getCandidate //============================================================================ -UnicodeString* IMEManager::getCandidate( Int index ) +const UnicodeString* IMEManager::getCandidate( Int index ) { if ( m_candidateString != NULL && index >=0 && index < m_candidateCount ) { diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/IMEManager.h b/GeneralsMD/Code/GameEngine/Include/GameClient/IMEManager.h index dace4e4092f..5d916675274 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/IMEManager.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/IMEManager.h @@ -88,7 +88,7 @@ class IMEManagerInterface : public SubsystemInterface virtual Int getCandidateCount() = 0; ///< Returns the total number of candidates - virtual UnicodeString*getCandidate( Int index ) = 0; ///< Returns the candidate string + virtual const UnicodeString* getCandidate( Int index ) = 0; ///< Returns the candidate string virtual Int getSelectedCandidateIndex() = 0; ///< Returns the indexed of the currently selected candidate virtual Int getCandidatePageSize() = 0; ///< Returns the page size for the candidates list virtual Int getCandidatePageStart() = 0; ///< Returns the index of the first visibel candidate diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp index 3cfbe4722ce..548e53f3669 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp @@ -202,7 +202,7 @@ void IMECandidateTextAreaDraw( GameWindow *window, WinInstanceData *instData ) for ( Int i = 0; i < count; i++, y+= height ) { - UnicodeString *candidate = ime->getCandidate( first + i ); + const UnicodeString *candidate = ime->getCandidate( first + i ); Int tcolor, bcolor; if ( i == selected ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp index 8ca208be057..cd7daaad19e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/IMEManager.cpp @@ -109,7 +109,7 @@ class IMEManager : public IMEManagerInterface virtual Int getIndexBase( void ); ///< Get index base for candidate list virtual Int getCandidateCount(); ///< Returns the total number of candidates - virtual UnicodeString*getCandidate( Int index ); ///< Returns the candidate string + virtual const UnicodeString* getCandidate( Int index ); ///< Returns the candidate string virtual Int getSelectedCandidateIndex(); ///< Returns the indexed of the currently selected candidate virtual Int getCandidatePageSize(); ///< Returns the page size for the candidates list virtual Int getCandidatePageStart(); ///< Returns the index of the first visibel candidate @@ -1528,7 +1528,7 @@ Int IMEManager::getCandidateCount() // IMEManager::getCandidate //============================================================================ -UnicodeString* IMEManager::getCandidate( Int index ) +const UnicodeString* IMEManager::getCandidate( Int index ) { if ( m_candidateString != NULL && index >=0 && index < m_candidateCount ) {