mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-01 03:00:59 +02:00
* Create key when writing (fix bug ID #25483)
git-svn-id: trunk@26762 -
This commit is contained in:
parent
2152622803
commit
e65fd31b0b
@ -77,7 +77,7 @@ end;
|
||||
|
||||
procedure TRegIniFile.WriteBool(const Section, Ident: string; Value: Boolean);
|
||||
begin
|
||||
if OpenSection(Section) then
|
||||
if OpenSection(Section,True) then
|
||||
try
|
||||
if not fPreferStringValues then
|
||||
inherited WriteBool(Ident,Value)
|
||||
@ -94,7 +94,7 @@ end;
|
||||
|
||||
procedure TRegIniFile.WriteInteger(const Section, Ident: string; Value: LongInt);
|
||||
begin
|
||||
if OpenSection(Section) then
|
||||
if OpenSection(Section,True) then
|
||||
try
|
||||
if not fPreferStringValues then
|
||||
inherited WriteInteger(Ident,Value)
|
||||
@ -111,7 +111,7 @@ end;
|
||||
|
||||
procedure TRegIniFile.WriteString(const Section, Ident, Value: String);
|
||||
begin
|
||||
if OpenSection(Section) then
|
||||
if OpenSection(Section,True) then
|
||||
try
|
||||
inherited WriteString(Ident,Value);
|
||||
finally
|
||||
@ -161,10 +161,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TRegIniFile.OpenSection(const Section: string): boolean;
|
||||
function TRegIniFile.OpenSection(const Section: string; CreateSection : Boolean = false): boolean;
|
||||
var
|
||||
k: HKEY;
|
||||
begin
|
||||
if CreateSection then
|
||||
CreateKey(Section);
|
||||
ASSERT(fOldCurKey = 0);
|
||||
if Section <> '' then begin
|
||||
k:=GetKey(Section);
|
||||
|
@ -134,7 +134,7 @@ type
|
||||
fPreferStringValues: Boolean;
|
||||
fOldCurKey : HKEY;
|
||||
|
||||
function OpenSection(const Section: string): boolean;
|
||||
function OpenSection(const Section: string; CreateSection : Boolean = false): boolean;
|
||||
procedure CloseSection;
|
||||
public
|
||||
constructor Create(const FN: string); overload;
|
||||
|
Loading…
Reference in New Issue
Block a user