mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 16:18:19 +02:00
EditorOptions, Mouse config, added safety check to loading
git-svn-id: trunk@21226 -
This commit is contained in:
parent
c015e291e8
commit
bf5bb6aec3
@ -134,6 +134,7 @@ type
|
||||
function GetDisplayName: string; override;
|
||||
public
|
||||
procedure Assign(Source: TPersistent); override;
|
||||
procedure Clear;
|
||||
function IsMatchingShiftState(AShift: TShiftState): Boolean;
|
||||
function IsMatchingClick(ABtn: TMouseButton; ACCount: TSynMAClickCount;
|
||||
ACDir: TSynMAClickDir): Boolean;
|
||||
@ -383,6 +384,19 @@ begin
|
||||
TSynEditMouseActions(Collection).AssertNoConflict(self);
|
||||
end;
|
||||
|
||||
procedure TSynEditMouseAction.Clear;
|
||||
begin
|
||||
FCommand := 0;
|
||||
FClickCount := ccSingle;
|
||||
FClickDir := cdUp;
|
||||
FButton := mbLeft;
|
||||
FShift := [];
|
||||
FShiftMask := [];
|
||||
FMoveCaret := False;
|
||||
FOption := 0;
|
||||
FPriority := 0;
|
||||
end;
|
||||
|
||||
function TSynEditMouseAction.IsMatchingShiftState(AShift: TShiftState): Boolean;
|
||||
begin
|
||||
Result := AShift * FShiftMask = FShift;
|
||||
|
@ -2183,6 +2183,7 @@ var
|
||||
MAct := TSynEditMouseActionKeyCmdHelper.Create(nil);
|
||||
c := XMLConfig.GetValue(Path + 'CountDel', 0);
|
||||
for i := 0 to c - 1 do begin
|
||||
Mact.Clear;
|
||||
XMLConfig.ReadObject(Path + 'Del' + IntToStr(i) + '/', MAct);
|
||||
j := MActions.IndexOf(MAct, True);
|
||||
if j >= 0 then MActions.Delete(j);
|
||||
@ -2193,6 +2194,8 @@ var
|
||||
try
|
||||
MActions.IncAssertLock;
|
||||
try
|
||||
// If the object would ever be extended, old configs will not have all properties.
|
||||
Mact.Clear;
|
||||
XMLConfig.ReadObject(Path + 'M' + IntToStr(i) + '/', MAct);
|
||||
j := MActions.IndexOf(MAct, True);
|
||||
if j >= 0 then
|
||||
|
@ -581,6 +581,7 @@ var
|
||||
try
|
||||
MActions.IncAssertLock;
|
||||
try
|
||||
Mact.Clear;
|
||||
xml.ReadObject(Path + 'M' + IntToStr(i) + '/', MAct);
|
||||
MActions.Add.Assign(MAct);
|
||||
finally
|
||||
|
Loading…
Reference in New Issue
Block a user