View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001696 | JEDI VCL | 00 JVCL Components | public | 2004-04-25 08:38 | 2004-04-27 01:13 |
Reporter | SVitaliy | Assigned To | user72 | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0001696: Exists invalid for TJvSpinEdit.DisplayFormat strings, but valid for Delphi FormatFloat function. | ||||
Description | The component TJvSpinEdit failed to set value when DisplayFormat contains non-format characters. For example .##’%’. Possible solution: upgrade function TextToValText in file JvSpinEdit. | ||||
Tags | No tags attached. | ||||
|
Not that I think the current behavior is incorrect (it is a spin edit, not a mask edit), the following should fix it: function TextToValText(const AValue: string): string; var i, j:integer; begin Result := DelRSpace(AValue); if DecimalSeparator <> ThousandSeparator then Result := DelChars(Result, ThousandSeparator); if (DecimalSeparator <> '.') and (ThousandSeparator <> '.') then Result := ReplaceStr(Result, '.', DecimalSeparator); if (DecimalSeparator <> ',') and (ThousandSeparator <> ',') then Result := ReplaceStr(Result, ',', DecimalSeparator); j := 1; for i := 1 to Length(Result) do if Result[i] in ['0'..'9', DecimalSeparator] then begin Result[j] := Result[i]; Inc(j); end; SetLength(Result, j - 1); if Result = '' then Result := '0' else if Result = '-' then Result := '-0'; end; edited on: 04-25-04 23:42 |
|
Just to make it clear: I don't think SpinEdit needs to support anything but 0..9, DecimalSeparator (and maybe ThousandsSeparator) since those are the only characters you should be able to put into it. |
|
I agree with Your statement. What You say about defense DisplayFormat against incorrect input? |
|
You mean change TextToValText so it just trims out anything invalid and return the rest? I guess that would be feasible... |
|
I feel that solution found! |
|
Note that there is an adjusted TextToValText in JvBaseEdits.pas. |
|
Fixed in CVS: Fixed TextToValText moved to JvJCLUtils |
Date Modified | Username | Field | Change |
---|---|---|---|
2004-04-25 08:38 | SVitaliy | New Issue | |
2004-04-25 23:40 |
|
Note Added: 0004072 | |
2004-04-25 23:41 |
|
Note Edited: 0004072 | |
2004-04-25 23:42 |
|
Note Edited: 0004072 | |
2004-04-26 05:29 |
|
Status | new => feedback |
2004-04-26 06:20 |
|
Note Added: 0004079 | |
2004-04-26 09:53 | SVitaliy | Note Added: 0004084 | |
2004-04-26 10:05 |
|
Note Added: 0004085 | |
2004-04-26 11:21 | SVitaliy | Note Added: 0004088 | |
2004-04-26 17:16 | remkobonte | Note Added: 0004089 | |
2004-04-27 01:13 |
|
Status | feedback => resolved |
2004-04-27 01:13 |
|
Resolution | open => fixed |
2004-04-27 01:13 |
|
Assigned To | => user72 |
2004-04-27 01:13 |
|
Note Added: 0004091 |