View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0004505 | JEDI VCL | 00 JVCL Components | public | 2008-10-07 06:56 | 2008-10-26 05:21 |
| Reporter | michael_jedi | Assigned To | AHUser | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Product Version | |||||
| Target Version | Fixed in Version | 3.36 | |||
| Summary | 0004505: JvValidateEdit allows entering DecimalSeparator more than once (with patch) | ||||
| Description | Steps to reproduce: - add new TJvaValidateEdit component onto a form - set format to dfFloat (or dfFloatGeneral, dfDecimal, dfPercent) - compile & run - now you are able to enter values like: '11,,,,0,00,11' and so on | ||||
| Additional Information | I have found out that in the source file of the component there is a check against it but it does not work correctly. This is now in the IsValidChar function (from JVCL334CompleteJCL1102-Build3072.zip): Result := (Pos(Key, FCheckChars) > 0) or ((Key = DecimalSeparator) and (Pos(DecimalSeparator, S) = 0)) or... But this check should be: Result := ((Pos(Key, FCheckChars) > 0) and (((Key = DecimalSeparator) and (Pos(DecimalSeparator, S) = 0)) or (Key <> DecimalSeparator))) or... I am attaching patch against 3.34 for this issues (corrected also for dfCurrency format) | ||||
| Tags | No tags attached. | ||||
|
2008-10-07 06:56
|
JvValidateEdit.pas.diff (1,466 bytes)
--- C:/temp/JvValidateEdit.pas Thu Oct 25 18:28:26 2007
+++ C:/temp/jvcl/run/JvValidateEdit.pas Tue Oct 07 15:33:38 2008
@@ -926,8 +926,8 @@
((Key = '+') and (Posn = 1) and ((Pos('+', S) = 0) or (SelLength > 0))) or
((Key = '-') and (Posn = 1) and ((Pos('-', S) = 0) or (SelLength > 0)));
dfFloat, dfFloatGeneral, dfDecimal, dfPercent:
- Result := (Pos(Key, FCheckChars) > 0) or
- ((Key = DecimalSeparator) and (Pos(DecimalSeparator, S) = 0)) or
+ Result := ((Pos(Key, FCheckChars) > 0) and
+ (((Key = DecimalSeparator) and (Pos(DecimalSeparator, S) = 0)) or (Key <> DecimalSeparator))) or
((Key = '+') and (Posn = 1) and ((Pos('+', S) = 0) or (SelLength > 0))) or
((Key = '-') and (Posn = 1) and ((Pos('-', S) = 0) or (SelLength > 0)));
dfCurrency:
@@ -967,8 +967,8 @@
if (Key = '(') and (Posn = 1) and (NegCurrFormat in [0, 4, 14, 15]) then
Key := '-';
- Result := (Pos(Key, FCheckChars) > 0) or
- ((Key = DecimalSeparator) and (Pos(DecimalSeparator, S) = 0)) or
+ Result := ((Pos(Key, FCheckChars) > 0) and
+ (((Key = DecimalSeparator) and (Pos(DecimalSeparator, S) = 0)) or (Key <> DecimalSeparator))) or
((Key = '+') and (Posn = 1) and ((Pos('+', S) = 0) or (SelLength > 0))) or
((Key = '-') and (Posn = ExpectedNegPos) and ((Pos(ExpectedNegChar, S) = 0) or (SelLength > 0)));
end;
|
|
|
Ok, thanks for the patch. Issue available for anyone to look at. |
|
|
Thanks for the patch. Fixed in SVN |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2008-10-07 06:56 | michael_jedi | New Issue | |
| 2008-10-07 06:56 | michael_jedi | File Added: JvValidateEdit.pas.diff | |
| 2008-10-10 05:12 | obones | Note Added: 0014820 | |
| 2008-10-10 05:12 | obones | Status | new => acknowledged |
| 2008-10-26 05:20 | AHUser | Status | acknowledged => resolved |
| 2008-10-26 05:20 | AHUser | Fixed in Version | => Daily / SVN |
| 2008-10-26 05:20 | AHUser | Resolution | open => fixed |
| 2008-10-26 05:20 | AHUser | Assigned To | => AHUser |
| 2008-10-26 05:20 | AHUser | Note Added: 0014909 |