printer4lazarus: carbon - replace OSX 10.5 (driver specific) code with OSX 10.0 compatible code for getting printerinters DPI

git-svn-id: trunk@48507 -
This commit is contained in:
dmitry 2015-03-26 00:48:36 +00:00
parent 2368d8ad9a
commit 575e6ac4fd

View File

@ -338,14 +338,17 @@ end;
function TCarbonPrinter.GetOutputResolution: PMResolution; function TCarbonPrinter.GetOutputResolution: PMResolution;
var var
res: OSStatus; res: OSStatus;
prn: PMPrinter;
cnt: UInt32;
begin begin
// PMPrinterGetOutputResolution is supported on OS X 10.5 and later prn := GetCurrentPrinter;
// TODO: check version instead, because 10.5 may still support PowerPC PMPrinterGetPrinterResolutionCount(prn, cnt);
{$if defined(PowerPC) or defined(__ppc__) or defined(ppc)} if cnt>0 then
res := noErr+1; //todo: get the first one or the highest one?
{$else} res:=PMPrinterGetIndexedPrinterResolution(prn, 1, Result)
res := PMPrinterGetOutputResolution(GetCurrentPrinter, PrintSettings, Result{%H-}); else
{$endif} res:=noErr+1;
if res<>noErr then if res<>noErr then
begin begin
Result.vRes:=72; Result.vRes:=72;