mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-01-06 07:22:34 +01:00
LazReport, fix crosstab compiling when using FPC stable (reported by Julio and Swen)
git-svn-id: trunk@46133 -
This commit is contained in:
parent
25ff00e44c
commit
b8f6f5f548
@ -38,10 +38,19 @@ uses
|
||||
Classes, SysUtils, DB;
|
||||
|
||||
type
|
||||
|
||||
{ TExItem }
|
||||
|
||||
TExItem = class
|
||||
private
|
||||
FCelCol:string;
|
||||
FValue:Variant;
|
||||
Bookmark:TBookMark;
|
||||
FDataset: TDataset;
|
||||
FBookmark:TBookMark;
|
||||
public
|
||||
procedure SaveBookmark(Ds: TDataset);
|
||||
function IsBookmarkValid: boolean;
|
||||
destructor destroy; override;
|
||||
end;
|
||||
|
||||
type
|
||||
@ -93,6 +102,28 @@ type
|
||||
implementation
|
||||
uses math, variants;
|
||||
|
||||
{ TExItem }
|
||||
|
||||
procedure TExItem.SaveBookmark(Ds: TDataset);
|
||||
begin
|
||||
if IsBookmarkValid then
|
||||
FDataset.FreeBookmark(FBookmark);
|
||||
FDataset := Ds;
|
||||
FBookmark := FDataset.GetBookmark;
|
||||
end;
|
||||
|
||||
function TExItem.IsBookmarkValid: boolean;
|
||||
begin
|
||||
result := (FDataset<>nil) and FDataset.BookmarkValid(FBookmark)
|
||||
end;
|
||||
|
||||
destructor TExItem.destroy;
|
||||
begin
|
||||
if IsBookmarkValid then
|
||||
FDataset.FreeBookmark(FBookmark);
|
||||
inherited destroy;
|
||||
end;
|
||||
|
||||
{ TExRow }
|
||||
|
||||
function TExRow.GetCell(ACol: Variant): Variant;
|
||||
|
||||
@ -369,7 +369,7 @@ begin
|
||||
|
||||
FCalcTotal:=FD.DataType in NumericFieldTypes;
|
||||
|
||||
P:=FData.Bookmark;
|
||||
P:=FData.GetBookmark;
|
||||
FData.DisableControls;
|
||||
try
|
||||
FData.First;
|
||||
@ -392,11 +392,12 @@ begin
|
||||
|
||||
ExItem:=FExVarArray.CellData[FC.DisplayText, FR.DisplayText];
|
||||
if Assigned(ExItem) then
|
||||
ExItem.Bookmark:=FData.Bookmark;
|
||||
ExItem.SaveBookmark(FData);
|
||||
FData.Next;
|
||||
end;
|
||||
finally
|
||||
FData.Bookmark:=P;
|
||||
FData.GotoBookmark(P);
|
||||
FData.FreeBookmark(P);
|
||||
FData.EnableControls;
|
||||
end;
|
||||
|
||||
@ -565,8 +566,8 @@ begin
|
||||
AView.FillColor:=DataCell.FillColor;
|
||||
|
||||
ExItem:=FExVarArray.CellData[SC, SR];
|
||||
if Assigned(ExItem) and Assigned(ExItem.Bookmark) then
|
||||
FData.Bookmark:=ExItem.Bookmark;
|
||||
if Assigned(ExItem) and ExItem.IsBookmarkValid then
|
||||
ExItem.SaveBookmark(FData);
|
||||
end
|
||||
else
|
||||
if S = '-RowTitle-' then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user