From ce56ee1cb6eaeab303907a89a6704af58e4c9619 Mon Sep 17 00:00:00 2001 From: Robin Krom Date: Sat, 16 Oct 2021 23:07:22 +0200 Subject: [PATCH] With #321 it as reported that the reload functionality didn't work, there was actually a bug in the code replacing the values. --- src/Greenshot.Base/IniFile/IniSection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Greenshot.Base/IniFile/IniSection.cs b/src/Greenshot.Base/IniFile/IniSection.cs index a55ffe504..73a02ee1e 100644 --- a/src/Greenshot.Base/IniFile/IniSection.cs +++ b/src/Greenshot.Base/IniFile/IniSection.cs @@ -143,7 +143,7 @@ namespace Greenshot.Base.IniFile IniPropertyAttribute iniPropertyAttribute = (IniPropertyAttribute) fieldInfo.GetCustomAttributes(typeof(IniPropertyAttribute), false)[0]; if (!Values.ContainsKey(iniPropertyAttribute.Name)) { - Values.Add(iniPropertyAttribute.Name, new IniValue(this, fieldInfo, iniPropertyAttribute)); + Values[iniPropertyAttribute.Name] = new IniValue(this, fieldInfo, iniPropertyAttribute); } } } @@ -155,7 +155,7 @@ namespace Greenshot.Base.IniFile if (!Values.ContainsKey(propertyInfo.Name)) { IniPropertyAttribute iniPropertyAttribute = (IniPropertyAttribute) propertyInfo.GetCustomAttributes(typeof(IniPropertyAttribute), false)[0]; - Values.Add(iniPropertyAttribute.Name, new IniValue(this, propertyInfo, iniPropertyAttribute)); + Values[iniPropertyAttribute.Name] = new IniValue(this, propertyInfo, iniPropertyAttribute); } } }