Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1767 - EIndexOutOfRange when loading a chart with series groups (Incl fix)
Summary: EIndexOutOfRange when loading a chart with series groups (Incl fix)
Status: RESOLVED WORKSFORME
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Editors (show other bugs)
Version: 17.160426
Hardware: PC Windows
: High major
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-07 05:06 EST by h.hasenack
Modified: 2018-02-27 08:34 EST (History)
2 users (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description h.hasenack 2017-02-07 05:06:41 EST
There is some code causing an EIndexOutOfrange error. I do not have the code to reproduce the error at hand as it involves quite some steps (by hand).

Here is the proposed fix in TeEngine.pas:
(********************)
Procedure TCustomAxisPanel.Loaded;
var t, tt: Integer;
{$IFDEF HH_PATCH_TCustomAxisPanel_Loaded} // works around index out of range error
    idx:integer;
{$endif}
begin
  inherited;

  if SeriesGroups.Count>0 then
  begin
    for t:=0 to SeriesGroups.Count-1 do
    begin
       with SeriesGroups[t] do
       begin
          try
            if (Assigned(FTempSeries)) and (FTempSeries.Count>0) then
            begin
              for tt:=0 to FSeries.Count-1 do
                FSeries.Delete(tt);

              for tt:=0 to FTempSeries.Count-1 do
{$IFDEF HH_PATCH_TCustomAxisPanel_Loaded} // works around index out of range error
              begin
                idx:=StrToInt(FTempSeries[tt]);
                if InRange(idx,0,SeriesList.Count-1) then
                  FSeries.Add(SeriesList.Items[idx]);
              end
{$else}
              FSeries.Add(SeriesList.Items[StrToInt(FTempSeries[tt])]);
{$endif}
            end;
          finally
            Freeandnil(FTempSeries);
          end;
       end;
    end;
  end;
end;
Comment 1 sandra pazos 2018-02-27 08:34:10 EST
Hello 

The problem, as told you in bug 1780 doesn't appear using TeeChart Pro VCL/FMX v2017.23. 

Thanks in advance