Recent

Author Topic: Is lazarus trunk tachart working?  (Read 3017 times)

parcel

  • Full Member
  • ***
  • Posts: 143
Is lazarus trunk tachart working?
« on: November 23, 2015, 06:35:22 am »
I got problem with lazarus trunk.
When tchart drop on Form, IDE raise strange AV exception.  >:(

Is it really working recent trunk version?


balazsszekely

  • Guest
Re: Is lazarus trunk tachart working?
« Reply #1 on: November 23, 2015, 06:39:55 am »
I just tested with r50475 and it's working fine(no AV). Did you try a cleanup?

parcel

  • Full Member
  • ***
  • Posts: 143
Re: Is lazarus trunk tachart working?
« Reply #2 on: November 23, 2015, 08:15:48 am »
I also tried with r50475 with FPC trunk, it raise AV excetions.

I tried runtime creation.

Code: Pascal  [Select][+][-]
  1.   mychart := TChart.Create(self);
  2.   mychart.Parent:=Self;
  3.   mychart.Align:=alClient;
  4.  

FScale function pointer is nil and raise exception, but IDE drop still raise AV exception.

Code: Pascal  [Select][+][-]
  1. Index: components/tachart/tacustomsource.pas
  2. ===================================================================
  3. --- components/tachart/tacustomsource.pas       (revision 50475)
  4. +++ components/tachart/tacustomsource.pas       (working copy)
  5. @@ -252,8 +252,12 @@
  6.  begin
  7.    with FIntervals do
  8.      Result := not (
  9. -      (aipUseMinLength in Options) and (AStep < FScale(MinLength)) or
  10. -      (aipUseMaxLength in Options) and (AStep > FScale(MaxLength)));
  11. +      (aipUseMinLength in Options) and
  12. +      (TIntegerTransformFunc(FScale)<>nil) and
  13. +      (AStep < FScale(MinLength)) or
  14. +      (aipUseMaxLength in Options) and
  15. +      (TIntegerTransformFunc(FScale)<>nil) and
  16. +      (AStep > FScale(MaxLength)));
  17.  end;
  18.  
  19.  procedure TValuesInRangeParams.RoundToImage(var AValue: Double);
  20. @@ -822,7 +826,9 @@
  21.      imagePos: Integer;
  22.    begin
  23.      with AParams do
  24. -      if aipUseMinLength in FIntervals.Options then begin
  25. +      if (aipUseMinLength in FIntervals.Options) and
  26. +      (TIntegerTransformFunc(FScale)<>nil) then
  27. +      begin
  28.          imagePos := ToImage(AValue);
  29.          Result := Abs(imagePos - prevImagePos) < FScale(FIntervals.MinLength);
  30.        end;
  31. Index: components/tachart/taintervalsources.pas
  32. ===================================================================
  33. --- components/tachart/taintervalsources.pas    (revision 50475)
  34. +++ components/tachart/taintervalsources.pas    (working copy)
  35. @@ -195,12 +195,13 @@
  36.      // However, both minimax and maximin will be achieved on equal steps.
  37.      with AParams do
  38.        imageWidth := Abs(ToImage(FMax) - ToImage(FMin));
  39. -    if aipUseMinLength in Params.Options then
  40. +    if (aipUseMinLength in Params.Options) and (TIntegerTransformFunc(AParams.FScale)<>nil) then
  41.        len := AParams.FScale(Max(Params.MinLength, 2))
  42.      else
  43.        len := 2;
  44.      AMaxCount := Max(imageWidth div len, 2);
  45. -    if aipUseMaxLength in Params.Options then begin
  46. +    if (aipUseMaxLength in Params.Options) and (TIntegerTransformFunc(AParams.FScale)<>nil) then
  47. +    begin
  48.        len := AParams.FScale(Max(Params.MaxLength, 2));
  49.        AMinCount := Max((imageWidth + 1) div len, 2);
  50.      end
  51.  
  52.  

parcel

  • Full Member
  • ***
  • Posts: 143
Re: Is lazarus trunk tachart working?
« Reply #3 on: November 23, 2015, 09:57:52 am »
I made patch, more checking on method pointers in objects.

bug report
http://bugs.freepascal.org/view.php?id=29073

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: Is lazarus trunk tachart working?
« Reply #4 on: November 25, 2015, 09:28:57 pm »
Should work again after Jonas had fixed the originating fpc bug.

parcel

  • Full Member
  • ***
  • Posts: 143
Re: Is lazarus trunk tachart working?
« Reply #5 on: November 26, 2015, 03:05:15 am »
Thank you  :)

 

TinyPortal © 2005-2018