Skip to content

Commit daf05c7

Browse files
committed
+ Adição de tipo NONE para limpar formatação do campo.
1 parent 6ff4fe1 commit daf05c7

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

format/FMXFormat.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface
2828
'O', 'O', 'O', 'U', 'U', 'U', 'U', 'C', 'N', 'Y', 'Y');
2929

3030
type
31-
TFormato = (&Date, Bits, CEP, CEST, CFOP, CNH, CNPJ, CNPJorCPF, CPF, CREA, CRM,
31+
TFormato = (None, &Date, Bits, CEP, CEST, CFOP, CNH, CNPJ, CNPJorCPF, CPF, CREA, CRM,
3232
Dinheiro, Hora, HoraCurta, InscricaoEstadual, NCM, OAB, Personalizado, Peso,
3333
Porcentagem, Telefone, TituloEleitor, Valor, VeiculoMercosul, VeiculoTradicional);
3434

@@ -400,6 +400,9 @@ function TFormatHelper.Formatar(Formato: TFormato; Texto: string;
400400
ExtraArg: Variant): string;
401401
begin
402402
case Formato of
403+
None:
404+
Texto := AlfaNumerico(Texto);
405+
403406
&Date:
404407
Texto := FormataData(SomenteNumero(Texto));
405408

format/VCLFormat.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface
2828
'O', 'O', 'O', 'U', 'U', 'U', 'U', 'C', 'N', 'Y', 'Y');
2929

3030
type
31-
TFormato = (&Date, Bits, CEP, CEST, CFOP, CNH, CNPJ, CNPJorCPF, CPF, CREA, CRM,
31+
TFormato = (None, &Date, Bits, CEP, CEST, CFOP, CNH, CNPJ, CNPJorCPF, CPF, CREA, CRM,
3232
Dinheiro, Hora, HoraCurta, InscricaoEstadual, NCM, OAB, Personalizado, Peso,
3333
Porcentagem, Telefone, TituloEleitor, Valor, VeiculoMercosul, VeiculoTradicional);
3434

@@ -389,6 +389,9 @@ function TFormatHelper.Formatar(Formato: TFormato; Texto: string;
389389
ExtraArg: Variant): string;
390390
begin
391391
case Formato of
392+
None:
393+
Texto := AlfaNumerico(Texto);
394+
392395
&Date:
393396
Texto := FormataData(SomenteNumero(Texto));
394397

format/lclformat.pas

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Maiores Informações
1+
// Maiores Informações
22
// https://github.com/OpenSourceCommunityBrasil/PascalLibs/wiki
33

44
unit LCLFormat;
@@ -35,7 +35,7 @@ interface
3535
'O', 'O', 'O', 'O', 'O', 'U', 'U', 'U', 'U', 'C', 'N', 'Y', 'Y');
3636

3737
type
38-
TFormato = (&Date, Bits, CEP, CEST, CFOP, CNH, CNPJ, CNPJorCPF, CPF, CREA,
38+
TFormato = (None, &Date, Bits, CEP, CEST, CFOP, CNH, CNPJ, CNPJorCPF, CPF, CREA,
3939
CRM, Dinheiro, Hora, HoraCurta, InscricaoEstadual, NCM, OAB, Personalizado, Peso,
4040
Porcentagem, Telefone, TituloEleitor, Valor, VeiculoMercosul,
4141
VeiculoTradicional);
@@ -405,6 +405,9 @@ function TFormatHelper.Formatar(Formato: TFormato; Texto: string;
405405
ExtraArg: variant): string;
406406
begin
407407
case Formato of
408+
None:
409+
Texto := AlfaNumerico(Texto);
410+
408411
&Date:
409412
Texto := FormataData(SomenteNumero(Texto));
410413

@@ -580,6 +583,9 @@ function TFormatHelper.Primeiros(aStr: string; aDigitos: integer): string;
580583
Result := Copy(aStr, 1, aDigitos);
581584
end;
582585

586+
/// <returns>
587+
/// Devolve o texto sem acentuação mantendo os outros caracteres.
588+
/// </returns>
583589
function TFormatHelper.RemoveAcentos(aStr: string): string;
584590
var
585591
I: integer;

0 commit comments

Comments
 (0)