[patch] JCF can't format System.UITypes operator := and case in records.
Original Reporter info from Mantis: DomingoGP @DomingoGP
-
Reporter name: Domingo Galmés
Original Reporter info from Mantis: DomingoGP @DomingoGP
- Reporter name: Domingo Galmés
Description:
JCF fails formating records like
TColorRec = record
var
case Integer of
0: {$IFDEF ENDIAN_BIG}
(A,B,G,R : Byte);
{$else}
(R,G,B,A : Byte);
{$ENDIF}
1: (Color : TColor);
end;
and the overloaded assignment operator.
class operator := (AColor : TColor): TColorRec; inline;
same problem as issue 0038957
The supplied patch solves the problem.
Steps to reproduce:
open Sistem.UITypes and call JCF Ctrl+D
Additional information:
The ugly format that the IFDEF remains is because JCF maintains the position X of the compiler directives {$ IF}, {$ELSE} if they are alone in a line, but not if they are not at the beginning of the line, so idents keeping the spaces
0: {$ IFDEF ENDIAN_BIG}
but not the rest.
case integer of
0: {$IFDEF ENDIAN_BIG}
(A,B,G,R : Byte);
{$else}
(R, G, B, A: byte);
{$ENDIF}
1: (Color: TColor);
end;
I have no idea how to fix this. :-)
Mantis conversion info:
- Mantis ID: 38995
- Version: 2.1 (SVN)
- Fixed in revision: r65223 (#6f17bec4)