diff --git a/components/ideintf/propeditutils.pp b/components/ideintf/propeditutils.pp index 803a838a0e..9a708231c4 100644 --- a/components/ideintf/propeditutils.pp +++ b/components/ideintf/propeditutils.pp @@ -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; diff --git a/designer/designer.pp b/designer/designer.pp index d363facf67..20429b7056 100644 --- a/designer/designer.pp +++ b/designer/designer.pp @@ -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: