From d43000198c9a82a0ed98c331198cc6e7d0abe486 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 12 Apr 2018 19:32:19 +0000 Subject: [PATCH] lazutils: compwriterpas: fixed writing bytebool git-svn-id: trunk@57646 - --- components/lazutils/compwriterpas.pas | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/components/lazutils/compwriterpas.pas b/components/lazutils/compwriterpas.pas index 7c08f0de2d..827045a094 100644 --- a/components/lazutils/compwriterpas.pas +++ b/components/lazutils/compwriterpas.pas @@ -619,11 +619,17 @@ begin WriteAssign(PropName,Ident) else begin // Integer has to be written just as number - aTypeData:=GetTypeData(PropInfo^.PropType); - if aTypeData^.MinValue>=0 then - WriteAssign(PropName,IntToStr(longword(Int32Value))) + case PropType^.Name of + 'ByteBool': WriteAssign(PropName,GetBoolLiteral(ByteBool(Int32Value))); + 'WordBool': WriteAssign(PropName,GetBoolLiteral(WordBool(Int32Value))); + 'LongBool': WriteAssign(PropName,GetBoolLiteral(LongBool(Int32Value))); else - WriteAssign(PropName,IntToStr(Int32Value)); + aTypeData:=GetTypeData(PropInfo^.PropType); + if aTypeData^.MinValue>=0 then + WriteAssign(PropName,IntToStr(longword(Int32Value))) + else + WriteAssign(PropName,IntToStr(Int32Value)); + end; end; end; tkChar: