AV after creating horizontal series with no values

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

AV after creating horizontal series with no values

Post by TestAlways » Tue Jan 27, 2015 4:57 pm

TChart Pro 2015.14.150120 32 bit VCL

See the attached demo that raises an exception as soon as the "Update Chart" button is clicked. The button simply creates a series for the chart but doesn't add any data to the series.

I have Pro version, and need to get this fixed so I can get it out to my customers. I would appreciate a code fix.

Ed Dressel
Attachments
AV on Horz Series.zip
(1.94 KiB) Downloaded 739 times

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: AV after creating horizontal series with no values

Post by Yeray » Wed Jan 28, 2015 1:23 pm

Hi Ed,

This bug was already found and fixed.
I've added it to the public tracker so other customers can find it if they try to report it:
http://bugs.teechart.net/show_bug.cgi?id=1106

The fix is, at Chart.pas, where says:

Code: Select all

function TCustomChartLegend.CalcItemWidth(const ACol,AIndex:Integer):Integer;
var tmpSt : String;
    tmpLines : Integer;
begin
  if FItems.Custom and (FItems.Count>AIndex-FirstValue) then
     if ACol=0 then
        tmpSt:=FItems[AIndex-FirstValue].FText
     else
        tmpSt:=FItems[AIndex-FirstValue].FText2
  else
     tmpSt:=IItems[AIndex-FirstValue,ACol];

  if tmpSt='' then
     result:=0
  else
     result:=ParentChart.MultiLineTextWidth(tmpSt,tmpLines,TextFormat)+FTextSymbolGap;
end;
Change it for this:

Code: Select all

function TCustomChartLegend.CalcItemWidth(const ACol,AIndex:Integer):Integer;
var tmpSt : String;
    tmpLines : Integer;
begin
  if FItems.Custom and (FItems.Count>AIndex-FirstValue) then
     if ACol=0 then
        tmpSt:=FItems[AIndex-FirstValue].FText
     else
        tmpSt:=FItems[AIndex-FirstValue].FText2
  else if (Length(IItems)>0) then
    tmpSt:=IItems[AIndex-FirstValue,ACol]
  else
    tmpSt:= '';

  if tmpSt='' then
     result:=0
  else
     result:=ParentChart.MultiLineTextWidth(tmpSt,tmpLines,TextFormat)+FTextSymbolGap;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

Re: AV after creating horizontal series with no values

Post by TestAlways » Wed Jan 28, 2015 3:55 pm

Thank you.

Is there any way to get a list of patches for 2015.14? This would be embarrassing if our internal testing did not pick this up and a customer did. If there are other items like this, I would like to get them fixed.

Thank you,

Ed Dressel

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: AV after creating horizontal series with no values

Post by Yeray » Thu Jan 29, 2015 9:12 am

Hi Ed,

I'm not sure to understand what do you exactly mean.
Bugzilla allows you to do customizable searches like:
- Tickets created after 20th January 2015, when v2015.14 was published: link
- Tickets closed as "fixed" since 20th January 2015, when v2015.14 was published: link
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply