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 544 - Crash after export to metaFile, if CursorTool->Active set to false
Summary: Crash after export to metaFile, if CursorTool->Active set to false
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Tools (show other bugs)
Version: 131119
Hardware: PC Windows
: --- critical
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-21 09:23 EST by garethtyeparc
Modified: 2014-01-22 10:16 EST (History)
2 users (show)

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


Attachments
Simple C++builder project to reproduce error (12.96 KB, application/zip)
2014-01-21 09:23 EST, garethtyeparc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description garethtyeparc 2014-01-21 09:23:52 EST
Created attachment 73 [details]
Simple C++builder project to reproduce error

Access violation occurs after exporting chart as metafile with the TCusorTool
"Active" property set to false.

C++Builder XE4, TeeChartPro 131119
Windows 7 64bit

Steps to reproduce:
1) Create new VCL Project
2) Add TChart and add line series (Series1)
3) Add TCursorTool (ChartTool1)
4) Add OnFormCreate event to Form1 and add following to void TForm1::FormCreate() 
     Series1->FillSampleValues(50);
     ChartTool->Active = false;
5) Add TButton to Form1 (Button1)
6) Add OnClick Event and add following to void TForm1::Button1Click()
     TeeExport( this, Chart1 );
7) In Export Chart dialog box select "as Metafile" in Format list box and then press "Preview..." button close preview and close dialog box
8) Click on Chart1 then get Access Violation.
Comment 1 sandra pazos 2014-01-22 09:50:03 EST
The problem only occurs if you have GDI+ mode activate. In Delphi occurs, too. 

Delphi Code: 

uses Series, TeExport;
procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TLineSeries).FillSampleValues;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
  TeeExport(Self, Chart1);
end;
Comment 2 david berneda 2014-01-22 10:16:41 EST
Fixed. After creating the Metafile (using a TMetafileCanvas), the problem was the "real" GDI+ chart canvas still had a wrong reference to the metafile canvas at its private "IXorCanvas" variable (used to draw the zoom rectangle when clicking and dragging a chart)