зеркало из https://github.com/mozilla/gecko-dev.git
Used the height and width of the page returned from the nsDeviceContext instead of hard coded values. r=buster
This commit is contained in:
Родитель
74f7b8e000
Коммит
c9543cdc78
|
@ -74,26 +74,34 @@ PrintContext::IsPaginated(PRBool* aResult)
|
|||
NS_IMETHODIMP
|
||||
PrintContext::GetPageWidth(nscoord* aResult)
|
||||
{
|
||||
PRInt32 width,height;
|
||||
|
||||
NS_PRECONDITION(nsnull != aResult, "null ptr");
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
// XXX assumes a 1/2 margin around all sides
|
||||
*aResult = (nscoord) NS_INCHES_TO_TWIPS(7.5);
|
||||
mDeviceContext->GetDeviceSurfaceDimensions(width,height);
|
||||
// a xp margin can be added here
|
||||
*aResult = width;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PrintContext::GetPageHeight(nscoord* aResult)
|
||||
{
|
||||
PRInt32 width,height;
|
||||
|
||||
NS_PRECONDITION(nsnull != aResult, "null ptr");
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
// XXX assumes a 1/2 margin around all sides
|
||||
*aResult = (nscoord) NS_INCHES_TO_TWIPS(10);
|
||||
mDeviceContext->GetDeviceSurfaceDimensions(width,height);
|
||||
// a xp margin or header/footer space can be added here
|
||||
*aResult = height;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче