Explorar o código

* Fix bug ID #35731 (ReadSectionRaw needs to read comments)

git-svn-id: trunk@42247 -
michael %!s(int64=6) %!d(string=hai) anos
pai
achega
db2c9183f1
Modificáronse 2 ficheiros con 7 adicións e 3 borrados
  1. 7 2
      packages/fcl-base/examples/testini.pp
  2. 0 1
      packages/fcl-base/src/inifiles.pp

+ 7 - 2
packages/fcl-base/examples/testini.pp

@@ -33,8 +33,13 @@ begin
       for i:=0 to lines.Count-1 do 
         WriteLn('  ', lines[i]);
       lines.Clear();
-      ini.ReadSectionValues('main', lines,[svoIncludeComments]);
-      WriteLn('ReadSectionValues (with comments, no invalid):');
+      ini.ReadSectionValues('main', lines,[]);
+      WriteLn('ReadSectionValues (no options):');
+      for i:=0 to lines.Count-1 do
+        WriteLn('  ', lines[i]);
+      lines.Clear();
+      ini.ReadSectionRaw('main', lines);
+      WriteLn('ReadSectionRaw (with comments, no invalid):');
       for i:=0 to lines.Count-1 do
         WriteLn('  ', lines[i]);
       lines.Clear();

+ 0 - 1
packages/fcl-base/src/inifiles.pp

@@ -1190,7 +1190,6 @@ begin
     oSection := FSectionList.SectionByName(Section,CaseSensitive);
     if oSection <> nil then with oSection.KeyList do
       for i := 0 to Count-1 do
-        if not IsComment(Items[i].Ident) then
          begin
            if Items[i].Ident<>'' then
             Strings.Add(Items[i].Ident + Separator +Items[i].Value)