< prev index next >

src/jdk.incubator.jpackage/share/native/libapplauncher/IniFile.cpp

Print this page

        

*** 107,119 **** std::list<TString> contents; std::vector<TString> keys = FMap.GetKeys(); for (unsigned int index = 0; index < keys.size(); index++) { TString name = keys[index]; ! IniSectionData *section; ! if (FMap.GetValue(name, section) == true) { contents.push_back(_T("[") + name + _T("]")); std::list<TString> lines = section->GetLines(); contents.insert(contents.end(), lines.begin(), lines.end()); contents.push_back(_T("")); } --- 107,119 ---- std::list<TString> contents; std::vector<TString> keys = FMap.GetKeys(); for (unsigned int index = 0; index < keys.size(); index++) { TString name = keys[index]; ! IniSectionData *section = NULL; ! if (FMap.GetValue(name, section) == true && section != NULL) { contents.push_back(_T("[") + name + _T("]")); std::list<TString> lines = section->GetLines(); contents.insert(contents.end(), lines.begin(), lines.end()); contents.push_back(_T("")); }
*** 126,136 **** } void IniFile::Append(const TString SectionName, const TString Key, TString Value) { if (FMap.ContainsKey(SectionName) == true) { ! IniSectionData* section; if (FMap.GetValue(SectionName, section) == true && section != NULL) { section->SetValue(Key, Value); } } --- 126,136 ---- } void IniFile::Append(const TString SectionName, const TString Key, TString Value) { if (FMap.ContainsKey(SectionName) == true) { ! IniSectionData* section = NULL; if (FMap.GetValue(SectionName, section) == true && section != NULL) { section->SetValue(Key, Value); } }
*** 142,152 **** } void IniFile::AppendSection(const TString SectionName, OrderedMap<TString, TString> Values) { if (FMap.ContainsKey(SectionName) == true) { ! IniSectionData* section; if (FMap.GetValue(SectionName, section) == true && section != NULL) { section->Append(Values); } } --- 142,152 ---- } void IniFile::AppendSection(const TString SectionName, OrderedMap<TString, TString> Values) { if (FMap.ContainsKey(SectionName) == true) { ! IniSectionData* section = NULL; if (FMap.GetValue(SectionName, section) == true && section != NULL) { section->Append(Values); } }
*** 157,167 **** } bool IniFile::GetValue(const TString SectionName, const TString Key, TString& Value) { bool result = false; ! IniSectionData* section; if (FMap.GetValue(SectionName, section) == true && section != NULL) { result = section->GetValue(Key, Value); } --- 157,167 ---- } bool IniFile::GetValue(const TString SectionName, const TString Key, TString& Value) { bool result = false; ! IniSectionData* section = NULL; if (FMap.GetValue(SectionName, section) == true && section != NULL) { result = section->GetValue(Key, Value); }
*** 169,179 **** } bool IniFile::SetValue(const TString SectionName, const TString Key, TString Value) { bool result = false; ! IniSectionData* section; if (FMap.GetValue(SectionName, section) && section != NULL) { result = section->SetValue(Key, Value); } else { --- 169,179 ---- } bool IniFile::SetValue(const TString SectionName, const TString Key, TString Value) { bool result = false; ! IniSectionData* section = NULL; if (FMap.GetValue(SectionName, section) && section != NULL) { result = section->SetValue(Key, Value); } else {
< prev index next >