From 1591be495b96297657f15cf0334093e393f36b44 Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 26 Sep 2012 11:37:44 +0000 Subject: [PATCH] SynEdit: Cleanup (TBetterRegistry removed) Issue #0022509 Patch by Zaher Dirkey git-svn-id: trunk@38848 - --- components/synedit/synedithighlighter.pp | 34 +++++++++--------------- components/synedit/synhighlighterany.pas | 8 +++--- components/synedit/synhighlightercpp.pp | 2 +- components/synedit/synhighlighterpas.pp | 2 +- 4 files changed, 18 insertions(+), 28 deletions(-) diff --git a/components/synedit/synedithighlighter.pp b/components/synedit/synedithighlighter.pp index ceb478fc58..5e206d7119 100644 --- a/components/synedit/synedithighlighter.pp +++ b/components/synedit/synedithighlighter.pp @@ -36,17 +36,7 @@ uses Graphics, FileUtil, LCLProc, LCLIntf, LCLType, Registry, IniFiles, SynEditTypes, SynEditTextBase; -{$DEFINE _Gp_MustEnhanceRegistry} -{$IFDEF SYN_COMPILER_4_UP} - {$UNDEF _Gp_MustEnhanceRegistry} -{$ENDIF} type - TBetterRegistry = class(TRegistry) - {$IFDEF _Gp_MustEnhanceRegistry} - function OpenKeyReadOnly(const Key: string): Boolean; - {$ENDIF} - end; - { TSynHighlighterRangeList } TSynHighlighterRangeList = class(TSynManagedStorageMem) @@ -176,8 +166,8 @@ type procedure InternalSaveDefaultValues; function LoadFromBorlandRegistry(rootKey: HKEY; attrKey, attrName: string; oldStyle: boolean): boolean; virtual; - function LoadFromRegistry(Reg: TBetterRegistry): boolean; - function SaveToRegistry(Reg: TBetterRegistry): boolean; + function LoadFromRegistry(Reg: TRegistry): boolean; + function SaveToRegistry(Reg: TRegistry): boolean; function LoadFromFile(Ini : TIniFile): boolean; function SaveToFile(Ini : TIniFile): boolean; public @@ -831,7 +821,7 @@ const fgIndex16: string; bgIndex16: string; {$ENDIF} - reg : TBetterRegistry; + reg : TRegistry; function Get(var name: string): string; var @@ -846,7 +836,7 @@ const begin { LoadOldStyle } Result := false; try - reg := TBetterRegistry.Create; + reg := TRegistry.Create; reg.RootKey := rootKey; try with reg do begin @@ -894,7 +884,7 @@ const fgDefault : string; bgDefault : string; {$ENDIF} - reg : TBetterRegistry; + reg : TRegistry; function IsTrue(value: string): boolean; begin @@ -904,7 +894,7 @@ const begin Result := false; try - reg := TBetterRegistry.Create; + reg := TRegistry.Create; reg.RootKey := rootKey; try with reg do begin @@ -957,7 +947,7 @@ begin else Result := LoadNewStyle(rootKey, attrKey, attrName); end; { TSynHighlighterAttributes.LoadFromBorlandRegistry } -function TSynHighlighterAttributes.LoadFromRegistry(Reg: TBetterRegistry): boolean; +function TSynHighlighterAttributes.LoadFromRegistry(Reg: TRegistry): boolean; {$IFNDEF SYN_LAZARUS} var key: string; @@ -984,7 +974,7 @@ begin {$ENDIF} end; -function TSynHighlighterAttributes.SaveToRegistry(Reg: TBetterRegistry): boolean; +function TSynHighlighterAttributes.SaveToRegistry(Reg: TRegistry): boolean; var key: string; begin @@ -1190,12 +1180,12 @@ end; function TSynCustomHighlighter.LoadFromRegistry(RootKey: HKEY; Key: string): boolean; var - r: TBetterRegistry; + r: TRegistry; {$IFNDEF FPC} i: integer; {$ENDIF} begin - r := TBetterRegistry.Create; + r := TRegistry.Create; try r.RootKey := RootKey; {$IFNDEF FPC} @@ -1214,10 +1204,10 @@ end; function TSynCustomHighlighter.SaveToRegistry(RootKey: HKEY; Key: string): boolean; var - r: TBetterRegistry; + r: TRegistry; i: integer; begin - r := TBetterRegistry.Create; + r := TRegistry.Create; try r.RootKey := RootKey; if r.OpenKey(Key,true) then begin diff --git a/components/synedit/synhighlighterany.pas b/components/synedit/synhighlighterany.pas index 5420324eb3..ad09a9a5fb 100644 --- a/components/synedit/synhighlighterany.pas +++ b/components/synedit/synhighlighterany.pas @@ -895,9 +895,9 @@ end; function TSynAnySyn.LoadFromRegistry(RootKey: HKEY; Key: string): boolean; var - r: TBetterRegistry; + r: TRegistry; begin - r:= TBetterRegistry.Create; + r:= TRegistry.Create; try r.RootKey := RootKey; if r.OpenKeyReadOnly(Key) then begin @@ -910,9 +910,9 @@ end; function TSynAnySyn.SaveToRegistry(RootKey: HKEY; Key: string): boolean; var - r: TBetterRegistry; + r: TRegistry; begin - r:= TBetterRegistry.Create; + r:= TRegistry.Create; try r.RootKey := RootKey; if r.OpenKey(Key,true) then begin diff --git a/components/synedit/synhighlightercpp.pp b/components/synedit/synhighlightercpp.pp index 6ad4c67a16..2292cea953 100644 --- a/components/synedit/synhighlightercpp.pp +++ b/components/synedit/synhighlightercpp.pp @@ -1528,7 +1528,7 @@ end; procedure TSynCppSyn.EnumUserSettings(settings: TStrings); begin { returns the user settings that exist in the registry } - with TBetterRegistry.Create do + with TRegistry.Create do begin try RootKey := HKEY_LOCAL_MACHINE; diff --git a/components/synedit/synhighlighterpas.pp b/components/synedit/synhighlighterpas.pp index d9ceaf5cc9..d944f6dc5e 100644 --- a/components/synedit/synhighlighterpas.pp +++ b/components/synedit/synhighlighterpas.pp @@ -3092,7 +3092,7 @@ end; procedure TSynPasSyn.EnumUserSettings(settings: TStrings); begin { returns the user settings that exist in the registry } - with TBetterRegistry.Create do + with TRegistry.Create do begin try RootKey := HKEY_LOCAL_MACHINE;