@@ -55,15 +55,15 @@ void EnvVarList::AddVariable(const wxString& setName, const wxString& name, cons
5555 wxString currentValueStr = DoGetSetVariablesStr (setName, actualSetName);
5656 wxArrayString currentValues = wxStringTokenize (currentValueStr, wxT (" \r\n " ), wxTOKEN_STRTOK);
5757
58- if (currentValues.Index (newEntry) == wxNOT_FOUND)
58+ if (currentValues.Index (newEntry) == wxNOT_FOUND)
5959 currentValues.Add (newEntry);
6060
6161 currentValueStr.Clear ();
62- for (size_t i = 0 ; i < currentValues.GetCount (); i++) {
62+ for (size_t i = 0 ; i < currentValues.GetCount (); i++) {
6363 currentValueStr << currentValues.Item (i) << wxT (" \n " );
6464 }
6565
66- if (currentValueStr.IsEmpty () == false )
66+ if (currentValueStr.IsEmpty () == false )
6767 currentValueStr.RemoveLast ();
6868
6969 m_envVarSets[actualSetName] = currentValueStr;
@@ -76,47 +76,49 @@ void EnvVarList::InsertVariable(const wxString& setName, const wxString& name, c
7676 DoGetSetVariablesStr (setName, actualSetName);
7777
7878 EnvMap set = GetVariables (actualSetName, false , wxEmptyString, wxEmptyString);
79- if (!set.Contains (name)) {
79+ if (!set.Contains (name)) {
8080 set.Put (name, value);
8181 }
8282 m_envVarSets[actualSetName] = set.String ();
8383}
8484
85- EnvMap EnvVarList::GetVariables (const wxString& setName, bool includeWorkspaceEnvs, const wxString& projectName,
85+ EnvMap EnvVarList::GetVariables (const wxString& setName,
86+ bool includeWorkspaceEnvs,
87+ const wxString& projectName,
8688 const wxString& configName)
8789{
8890 EnvMap variables;
8991 wxString actualSetName;
9092
9193 wxString currentValueStr = DoGetSetVariablesStr (setName, actualSetName);
9294
93- if (includeWorkspaceEnvs && !clCxxWorkspaceST::Get ()->GetName ().IsEmpty ()) {
95+ if (includeWorkspaceEnvs && !clCxxWorkspaceST::Get ()->GetName ().IsEmpty ()) {
9496 currentValueStr.Trim ().Trim (false );
9597 currentValueStr << wxT (" \n " );
9698 currentValueStr << clCxxWorkspaceST::Get ()->GetEnvironmentVariables ();
9799
98- if (projectName.IsEmpty () == false ) {
100+ if (projectName.IsEmpty () == false ) {
99101 currentValueStr.Trim ().Trim (false );
100102 BuildConfigPtr buildConf = clCxxWorkspaceST::Get ()->GetProjBuildConf (projectName, configName);
101- if (buildConf) {
103+ if (buildConf) {
102104 currentValueStr << wxT (" \n " );
103105 currentValueStr << buildConf->GetEnvvars ();
104106 }
105107 }
106108 }
107109
108110 wxArrayString currentValues = wxStringTokenize (currentValueStr, wxT (" \r\n " ), wxTOKEN_STRTOK);
109- for (size_t i = 0 ; i < currentValues.GetCount (); i++) {
111+ for (size_t i = 0 ; i < currentValues.GetCount (); i++) {
110112 wxString entry = currentValues.Item (i);
111113
112114 // remove any comment from the line
113115 int where = entry.Find (wxT (" #" ));
114- if (where != wxNOT_FOUND) {
116+ if (where != wxNOT_FOUND) {
115117 entry = entry.Left (where);
116118 }
117119
118120 entry.Trim ().Trim (false );
119- if (entry.IsEmpty ()) {
121+ if (entry.IsEmpty ()) {
120122 continue ;
121123 }
122124
@@ -136,17 +138,17 @@ wxString EnvVarList::DoGetSetVariablesStr(const wxString& setName, wxString& sel
136138
137139 selectedSetName = setName;
138140 wxStringMap_t::iterator iter = m_envVarSets.find (setName);
139- if (iter != m_envVarSets.end ())
141+ if (iter != m_envVarSets.end ())
140142 currentValueStr = iter->second ;
141143 else {
142144 iter = m_envVarSets.find (m_activeSet);
143- if (iter != m_envVarSets.end ()) {
145+ if (iter != m_envVarSets.end ()) {
144146 currentValueStr = iter->second ;
145147 selectedSetName = m_activeSet;
146148 } else {
147149 selectedSetName = wxT (" Default" );
148150 iter = m_envVarSets.find (selectedSetName);
149- if (iter != m_envVarSets.end ())
151+ if (iter != m_envVarSets.end ())
150152 currentValueStr = iter->second ;
151153 }
152154 }
@@ -160,7 +162,7 @@ bool EnvVarList::IsSetExist(const wxString& setName) { return m_envVarSets.find(
160162bool EnvMap::Get (const wxString& key, wxString& val)
161163{
162164 int where = m_keys.Index (key);
163- if (where == wxNOT_FOUND)
165+ if (where == wxNOT_FOUND)
164166 return false ;
165167
166168 val = m_values.Item (where);
@@ -184,7 +186,7 @@ size_t EnvMap::GetCount() { return m_keys.GetCount(); }
184186
185187bool EnvMap::Get (size_t index, wxString& key, wxString& val)
186188{
187- if (index >= m_keys.GetCount ())
189+ if (index >= m_keys.GetCount ())
188190 return false ;
189191
190192 key = m_keys.Item (index);
@@ -197,11 +199,11 @@ bool EnvMap::Contains(const wxString& key) { return m_keys.Index(key) != wxNOT_F
197199wxString EnvMap::String ()
198200{
199201 wxString s;
200- for (size_t i = 0 ; i < m_keys.GetCount (); i++) {
202+ for (size_t i = 0 ; i < m_keys.GetCount (); i++) {
201203 s << m_keys.Item (i) << wxT (" =" ) << m_values.Item (i) << wxT (" \n " );
202204 }
203205
204- if (s.IsEmpty () == false )
206+ if (s.IsEmpty () == false )
205207 s.RemoveLast ();
206208
207209 return s;
0 commit comments