mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 12:40:22 +02:00
LCL: Improve handling of PageNumber in various Printer classes. Issue #37682, patch from Joeny Ang.
git-svn-id: trunk@64104 -
This commit is contained in:
parent
039687aae1
commit
16ffa2572f
@ -362,6 +362,7 @@ end;
|
||||
|
||||
procedure TCairoPrinterCanvas.NewPage;
|
||||
begin
|
||||
inherited NewPage;
|
||||
EndPage;
|
||||
BeginPage;
|
||||
end;
|
||||
|
@ -376,7 +376,7 @@ begin
|
||||
|
||||
Include(fFlags, pfPrinting);
|
||||
Exclude(fFlags, pfAborted);
|
||||
fPageNumber := 0;
|
||||
fPageNumber := 1;
|
||||
|
||||
if not RawMode then begin
|
||||
Canvas.Refresh;
|
||||
@ -414,6 +414,7 @@ end;
|
||||
//Create an new page
|
||||
procedure TPrinter.NewPage;
|
||||
begin
|
||||
Inc(fPageNumber);
|
||||
if TMethod(@Self.DoNewPage).Code = Pointer(@TPrinter.DoNewPage) then
|
||||
begin
|
||||
// DoNewPage has not been overriden, use the new method
|
||||
@ -423,7 +424,6 @@ begin
|
||||
begin
|
||||
// Use the old method as DoNewPage has been overriden in descendat TPrinter
|
||||
CheckPrinting(True);
|
||||
Inc(fPageNumber);
|
||||
if not RawMode then
|
||||
TPrinterCanvas(Canvas).NewPage;
|
||||
DoNewPage;
|
||||
@ -433,7 +433,6 @@ end;
|
||||
procedure TPrinter.BeginPage;
|
||||
begin
|
||||
CheckPrinting(True);
|
||||
inc(fPageNumber);
|
||||
if not RawMode then
|
||||
TPrinterCanvas(Canvas).BeginPage;
|
||||
DoBeginPage;
|
||||
@ -1397,12 +1396,13 @@ end;
|
||||
|
||||
procedure TPrinterCanvas.NewPage;
|
||||
begin
|
||||
Inc(fPageNum);
|
||||
BeginPage;
|
||||
end;
|
||||
|
||||
procedure TPrinterCanvas.BeginPage;
|
||||
begin
|
||||
Inc(fPageNum);
|
||||
|
||||
end;
|
||||
|
||||
procedure TPrinterCanvas.EndPage;
|
||||
|
Loading…
Reference in New Issue
Block a user