mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-02 23:37:18 +01:00
Designer: Support also (False) and (True) as Boolean values in Undo operation.
git-svn-id: trunk@51634 -
This commit is contained in:
parent
99194561d2
commit
ee7305772d
@ -81,6 +81,7 @@ type
|
||||
|
||||
procedure RegisterGetLookupRoot(const OnGetLookupRoot: TGetLookupRoot);
|
||||
procedure UnregisterGetLookupRoot(const OnGetLookupRoot: TGetLookupRoot);
|
||||
function StrToBoolOI(S: string): Boolean;
|
||||
|
||||
implementation
|
||||
|
||||
@ -125,6 +126,15 @@ begin
|
||||
GetLookupRoots.Remove(OnGetLookupRoot);
|
||||
end;
|
||||
|
||||
function StrToBoolOI(S: string): Boolean;
|
||||
// Like StrToBool but accepts also '(False)' and '(True)'.
|
||||
begin
|
||||
if S = '' then Exit(False);
|
||||
if (Length(S) > 2) and (S[1] = '(') and (S[Length(S)] = ')') then
|
||||
S := Copy(S, 2, Length(S)-2);
|
||||
Result := StrToBool(S);
|
||||
end;
|
||||
|
||||
{ TPersistentSelectionList }
|
||||
|
||||
function TPersistentSelectionList.Add(APersistent: TPersistent): integer;
|
||||
|
||||
@ -1330,7 +1330,7 @@ procedure TDesigner.ExecuteUndoItem(IsActUndo: boolean);
|
||||
tkFloat:
|
||||
SetFloatProp(tmpObj, fieldName, StrToFloat(tmpStr));
|
||||
tkBool:
|
||||
SetOrdProp(tmpObj, FUndoList[FUndoCurr].fieldName, Integer(StrToBool(tmpStr)));
|
||||
SetOrdProp(tmpObj, FUndoList[FUndoCurr].fieldName, Integer(StrToBoolOI(tmpStr)));
|
||||
tkString, tkLString, tkAString, tkUString, tkWString:
|
||||
SetStrProp(tmpObj, fieldName, tmpStr);
|
||||
tkSet:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user