diff --git a/components/printers/win32/winprinters.inc b/components/printers/win32/winprinters.inc index 4fa297e762..8f6aed629c 100644 --- a/components/printers/win32/winprinters.inc +++ b/components/printers/win32/winprinters.inc @@ -75,6 +75,12 @@ begin FreeDC; end; +procedure TWinPrinter.PrinterSelected; +begin + if PrinterIndex>=0 then + SetDC; +end; + function TWinPrinter.GetXDPI: Integer; begin Result:=72; @@ -659,10 +665,9 @@ begin [SysErrorMessage(GetlastError)]); end; - if UpdateDevMode(i) then begin - SetDC; - Result:=i; - end else + if UpdateDevMode(i) then + Result:=i + else Result:=-1; end; end; diff --git a/components/printers/win32/winprinters_h.inc b/components/printers/win32/winprinters_h.inc index 2f9bd9428d..c94e2d56b7 100644 --- a/components/printers/win32/winprinters_h.inc +++ b/components/printers/win32/winprinters_h.inc @@ -78,6 +78,7 @@ Type function GetHandlePrinter : HDC; procedure SetHandlePrinter(aValue : HDC); procedure RawModeChanging; override; + procedure PrinterSelected; override; public constructor Create; override; destructor Destroy; override; diff --git a/lcl/printers.pas b/lcl/printers.pas index 7a08500b25..f11ef079e5 100644 --- a/lcl/printers.pas +++ b/lcl/printers.pas @@ -182,6 +182,7 @@ type function GetYDPI: Integer; virtual; procedure CheckRawMode(const Value: boolean; Msg:string=''); procedure RawModeChanging; virtual; + procedure PrinterSelected; virtual; public constructor Create; virtual; destructor Destroy; override; @@ -399,7 +400,8 @@ begin fPrinterIndex:=i; end; end; - end + end; + PrinterSelected; end; function TPrinter.Write(const Buffer; Count:Integer; var Written: Integer): Boolean; @@ -455,6 +457,10 @@ begin // end; +procedure TPrinter.PrinterSelected; +begin +end; + //Get current copies number function TPrinter.GetCopies: Integer; Var i : Integer;