View Issue Details

IDProjectCategoryView StatusLast Update
0006673JEDI VCL00 JVCL Componentspublic2019-04-25 20:09
ReportervtrheAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in VersionDaily / GIT 
Summary0006673: Assigning empty TStrings to TJvSpinEdit.Items raises SListIndexError
DescriptionCreate an empty TStringList and assign it to TJvSpinEdit.Items. This raises a SListIndexError exception.
Additional Informationprocedure TForm1.Button1Click(Sender: TObject);
var
  MyStringList: TStringList;
begin
  MyStringList := TStringList.Create;
  try
    JvSpinEdit1.Items := MyStringList; //<-- raises Exception
  finally
    MyStringList.Free;
  end;
end;


  Possible Solution:
  Unit JvSpin.pas

 ...

  procedure TJvCustomSpinEdit.SetItems(const AValue: TStrings);
  begin
    FItems.Assign(AValue);
    Value := 0;
    if FItems.Count = 0 then // <-- Check for Num of Strings
      Text := ''
    else
      Text := FItems[0];
  end;

 ...

TagsNo tags attached.

Activities

2019-04-24 08:29

 

JvSpinEdit_Bug.zip (53,595 bytes)

mh

2019-04-25 20:01

reporter   ~0021733

Pull request with your fix created:
https://github.com/project-jedi/jvcl/pull/88

Issue History

Date Modified Username Field Change
2019-04-24 08:22 vtrhe New Issue
2019-04-24 08:29 vtrhe File Added: JvSpinEdit_Bug.zip
2019-04-25 20:01 mh Note Added: 0021733
2019-04-25 20:09 obones Status new => resolved
2019-04-25 20:09 obones Fixed in Version => Daily / GIT
2019-04-25 20:09 obones Resolution open => fixed
2019-04-25 20:09 obones Assigned To => obones