Преглед изворни кода

* fix for bug #4962, fix by Marton Pap

git-svn-id: trunk@2787 -
peter пре 19 година
родитељ
комит
492bc50fc2
1 измењених фајлова са 12 додато и 11 уклоњено
  1. 12 11
      fcl/inc/inifiles.pp

+ 12 - 11
fcl/inc/inifiles.pp

@@ -692,17 +692,18 @@ end;
 
 
 procedure TIniFile.DeleteKey(const Section, Ident: String);
 procedure TIniFile.DeleteKey(const Section, Ident: String);
 var
 var
-  oSection: TIniFileSection;
-  oKey: TIniFileKey;
-begin
-  oSection := FSectionList.SectionByName(Section);
-  if oSection <> nil then begin
-    oKey := oSection.KeyList.KeyByName(Ident);
-    if oKey <> nil then begin
-      oKey.Free;
-      UpdateFile;
-    end;
-  end;
+ oSection: TIniFileSection;
+ oKey: TIniFileKey;
+begin
+ oSection := FSectionList.SectionByName(Section);
+ if oSection <> nil then begin
+   oKey := oSection.KeyList.KeyByName(Ident);
+   if oKey <> nil then begin
+     oSection.KeyList.Delete(oSection.KeyList.IndexOf(oKey));
+     oKey.Free;
+     UpdateFile;
+   end;
+ end;
 end;
 end;
 
 
 procedure TIniFile.UpdateFile;
 procedure TIniFile.UpdateFile;