Bug 1309272, part 6 - Add page start/end arguments to the PrintTarget::BeginPrinting virtual method and overloads. r=lsalzman

This commit is contained in:
Jonathan Watt 2016-11-29 07:54:30 +00:00
parent f8b487cf4e
commit d2ce7607c8
8 changed files with 23 additions and 8 deletions

View File

@ -481,7 +481,8 @@ nsDeviceContext::BeginDocument(const nsAString& aTitle,
int32_t aStartPage,
int32_t aEndPage)
{
nsresult rv = mPrintTarget->BeginPrinting(aTitle, aPrintToFileName);
nsresult rv = mPrintTarget->BeginPrinting(aTitle, aPrintToFileName,
aStartPage, aEndPage);
if (NS_SUCCEEDED(rv) && mDeviceContextSpec) {
rv = mDeviceContextSpec->BeginDocument(aTitle, aPrintToFileName,

View File

@ -30,7 +30,9 @@ public:
/// Must be matched 1:1 by an EndPrinting/AbortPrinting call.
virtual nsresult BeginPrinting(const nsAString& aTitle,
const nsAString& aPrintToFileName) {
const nsAString& aPrintToFileName,
int32_t aStartPage,
int32_t aEndPage) {
return NS_OK;
}
virtual nsresult EndPrinting() {

View File

@ -79,7 +79,9 @@ PrintTargetPS::CreateOrNull(nsIOutputStream *aStream,
nsresult
PrintTargetPS::BeginPrinting(const nsAString& aTitle,
const nsAString& aPrintToFileName)
const nsAString& aPrintToFileName,
int32_t aStartPage,
int32_t aEndPage)
{
if (mOrientation == PORTRAIT) {
cairo_ps_surface_dsc_comment(mCairoSurface, "%%Orientation: Portrait");

View File

@ -29,7 +29,9 @@ public:
PageOrientation aOrientation);
virtual nsresult BeginPrinting(const nsAString& aTitle,
const nsAString& aPrintToFileName) override;
const nsAString& aPrintToFileName,
int32_t aStartPage,
int32_t aEndPage) override;
virtual nsresult EndPage() override;
virtual void Finish() override;

View File

@ -78,7 +78,9 @@ PrintTargetThebes::GetReferenceDrawTarget(DrawEventRecorder* aRecorder)
nsresult
PrintTargetThebes::BeginPrinting(const nsAString& aTitle,
const nsAString& aPrintToFileName)
const nsAString& aPrintToFileName,
int32_t aStartPage,
int32_t aEndPage)
{
return mGfxSurface->BeginPrinting(aTitle, aPrintToFileName);
}

View File

@ -30,7 +30,9 @@ public:
CreateOrNull(gfxASurface* aSurface);
virtual nsresult BeginPrinting(const nsAString& aTitle,
const nsAString& aPrintToFileName) override;
const nsAString& aPrintToFileName,
int32_t aStartPage,
int32_t aEndPage) override;
virtual nsresult EndPrinting() override;
virtual nsresult AbortPrinting() override;
virtual nsresult BeginPage() override;

View File

@ -55,7 +55,9 @@ PrintTargetWindows::CreateOrNull(HDC aDC)
nsresult
PrintTargetWindows::BeginPrinting(const nsAString& aTitle,
const nsAString& aPrintToFileName)
const nsAString& aPrintToFileName,
int32_t aStartPage,
int32_t aEndPage)
{
const uint32_t DOC_TITLE_LENGTH = MAX_PATH - 1;

View File

@ -24,7 +24,9 @@ public:
CreateOrNull(HDC aDC);
virtual nsresult BeginPrinting(const nsAString& aTitle,
const nsAString& aPrintToFileName) override;
const nsAString& aPrintToFileName,
int32_t aStartPage,
int32_t aEndPage) override;
virtual nsresult EndPrinting() override;
virtual nsresult AbortPrinting() override;
virtual nsresult BeginPage() override;