tvplanit: Fix page-breaks when printing contact grid to printer or preview.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8526 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-10-08 17:54:44 +00:00
parent 03cc304f83
commit 736c3abb6c
3 changed files with 63 additions and 91 deletions

View File

@@ -329,7 +329,7 @@ begin
FreeMem(FPageInfo[i]);
end;
FPageInfo.Clear;
CurPage := 0;
FCurPage := 0;
end;
{$IFDEF DELPHI}
@@ -694,8 +694,6 @@ end;
procedure TVpPrintPreview.LoadPage(PageNum: Integer;
StartDate, EndDate: TDateTime);
var
i: Integer;
LastPage: Boolean;
pageInfo: PVpPageInfo;
lDate: TDateTime;
lTask: Integer;
@@ -703,6 +701,13 @@ var
lLastPage: Boolean;
begin
Unused(EndDate);
if FPageInfo.Count = 0 then
raise Exception.Create('No pages to print');
if (PageNum < 0) then
PageNum := 0;
if (PageNum >= FPageInfo.Count) then
PageNum := FPageInfo.Count - 1;
pageInfo := PVpPageInfo(FPageInfo[PageNum]);
lDate := pageInfo.Date;