Set default values for printable/paper/physical rect.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10974 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
673bc6b1e1
commit
17f76af5ea
@ -119,11 +119,14 @@ void JobData::load(BMessage *msg, const PrinterCap *cap, Settings settings)
|
|||||||
fMsg = msg;
|
fMsg = msg;
|
||||||
fSettings = settings;
|
fSettings = settings;
|
||||||
|
|
||||||
|
const PaperCap *paperCap = NULL;
|
||||||
|
|
||||||
if (msg->HasInt32(kJDPaper))
|
if (msg->HasInt32(kJDPaper))
|
||||||
fPaper = (Paper)msg->FindInt32(kJDPaper);
|
fPaper = (Paper)msg->FindInt32(kJDPaper);
|
||||||
else if (cap->isSupport(PrinterCap::kPaper))
|
else if (cap->isSupport(PrinterCap::kPaper)) {
|
||||||
fPaper = ((const PaperCap *)cap->getDefaultCap(PrinterCap::kPaper))->paper;
|
paperCap = (const PaperCap *)cap->getDefaultCap(PrinterCap::kPaper);
|
||||||
else
|
fPaper = paperCap->paper;
|
||||||
|
} else
|
||||||
fPaper = kA4;
|
fPaper = kA4;
|
||||||
|
|
||||||
if (msg->HasInt64(kJDXRes)) {
|
if (msg->HasInt64(kJDXRes)) {
|
||||||
@ -160,26 +163,38 @@ void JobData::load(BMessage *msg, const PrinterCap *cap, Settings settings)
|
|||||||
|
|
||||||
if (msg->HasRect(kJDPaperRect)) {
|
if (msg->HasRect(kJDPaperRect)) {
|
||||||
fPaperRect = msg->FindRect(kJDPaperRect);
|
fPaperRect = msg->FindRect(kJDPaperRect);
|
||||||
|
} else if (paperCap != NULL) {
|
||||||
|
fPaperRect = paperCap->paper_rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg->HasRect(kJDScaledPaperRect)) {
|
if (msg->HasRect(kJDScaledPaperRect)) {
|
||||||
fScaledPaperRect = msg->FindRect(kJDScaledPaperRect);
|
fScaledPaperRect = msg->FindRect(kJDScaledPaperRect);
|
||||||
|
} else {
|
||||||
|
fScaledPaperRect = fPaperRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg->HasRect(kJDPrintableRect)) {
|
if (msg->HasRect(kJDPrintableRect)) {
|
||||||
fPrintableRect = msg->FindRect(kJDPrintableRect);
|
fPrintableRect = msg->FindRect(kJDPrintableRect);
|
||||||
|
} else if (paperCap != NULL) {
|
||||||
|
fPrintableRect = paperCap->physical_rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg->HasRect(kJDScaledPrintableRect)) {
|
if (msg->HasRect(kJDScaledPrintableRect)) {
|
||||||
fScaledPrintableRect = msg->FindRect(kJDScaledPrintableRect);
|
fScaledPrintableRect = msg->FindRect(kJDScaledPrintableRect);
|
||||||
|
} else {
|
||||||
|
fScaledPrintableRect = fPrintableRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg->HasRect(kJDPhysicalRect)) {
|
if (msg->HasRect(kJDPhysicalRect)) {
|
||||||
fPhysicalRect = msg->FindRect(kJDPhysicalRect);
|
fPhysicalRect = msg->FindRect(kJDPhysicalRect);
|
||||||
|
} else if (paperCap != NULL) {
|
||||||
|
fPhysicalRect = paperCap->physical_rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg->HasRect(kJDScaledPhysicalRect)) {
|
if (msg->HasRect(kJDScaledPhysicalRect)) {
|
||||||
fScaledPhysicalRect = msg->FindRect(kJDScaledPhysicalRect);
|
fScaledPhysicalRect = msg->FindRect(kJDScaledPhysicalRect);
|
||||||
|
} else {
|
||||||
|
fScaledPhysicalRect = fPhysicalRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg->HasInt32(kJDFirstPage))
|
if (msg->HasInt32(kJDFirstPage))
|
||||||
|
Loading…
Reference in New Issue
Block a user