aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/GeckoPrintService.cpp2
-rw-r--r--embed/mozilla/GeckoPrintSession.cpp13
-rw-r--r--embed/mozilla/GeckoPrintSession.h3
3 files changed, 14 insertions, 4 deletions
diff --git a/embed/mozilla/GeckoPrintService.cpp b/embed/mozilla/GeckoPrintService.cpp
index 98acb7dd9..1d00eab76 100644
--- a/embed/mozilla/GeckoPrintService.cpp
+++ b/embed/mozilla/GeckoPrintService.cpp
@@ -239,7 +239,7 @@ GeckoPrintService::ShowPrintDialog (nsIDOMWindow *aParent,
g_object_unref (settings);
settings = settingsCopy;
- rv = session->SetSettings (settings, pageSetup, printer);
+ rv = session->SetSettings (aSettings, settings, pageSetup, printer);
/* Now translate the settings to nsIPrintSettings */
if (NS_SUCCEEDED (rv)) {
diff --git a/embed/mozilla/GeckoPrintSession.cpp b/embed/mozilla/GeckoPrintSession.cpp
index 67f2d3819..edfd64d9c 100644
--- a/embed/mozilla/GeckoPrintSession.cpp
+++ b/embed/mozilla/GeckoPrintSession.cpp
@@ -98,13 +98,17 @@ GeckoPrintSession::GetSourceFile (nsACString &aSource)
}
nsresult
-GeckoPrintSession::SetSettings (GtkPrintSettings *aSettings,
+GeckoPrintSession::SetSettings (nsIPrintSettings *aPrintSettings,
+ GtkPrintSettings *aSettings,
GtkPageSetup *aPageSetup,
GtkPrinter *aPrinter)
{
- NS_ASSERTION (!mSettings && !mPageSetup && !mPrinter, "Already have settings!");
+ NS_ASSERTION (!mPrintSettings && !mSettings && !mPageSetup && !mPrinter, "Already have settings!");
+ NS_ENSURE_ARG (aPrintSettings);
NS_ENSURE_ARG (aSettings);
+
+ mPrintSettings = aPrintSettings;
mSettings = (GtkPrintSettings *) g_object_ref (aSettings);
NS_ENSURE_ARG (aPageSetup);
@@ -562,10 +566,15 @@ GeckoPrintSession::GetProcessCanceledByUser (PRBool *aProcessCanceledByUser)
*aProcessCanceledByUser = mCancelled;
return NS_OK;
}
+
NS_IMETHODIMP
GeckoPrintSession::SetProcessCanceledByUser (PRBool aProcessCanceledByUser)
{
mCancelled = aProcessCanceledByUser;
+ if (mPrintSettings) {
+ mPrintSettings->SetIsCancelled (aProcessCanceledByUser);
+ }
+
return NS_OK;
}
diff --git a/embed/mozilla/GeckoPrintSession.h b/embed/mozilla/GeckoPrintSession.h
index e0ddb5259..027f01e23 100644
--- a/embed/mozilla/GeckoPrintSession.h
+++ b/embed/mozilla/GeckoPrintSession.h
@@ -58,7 +58,7 @@ class GeckoPrintSession : public nsIPrintSession,
NS_DECL_NSIPRINTPROGRESS
NS_DECL_NSIPRINTPROGRESSPARAMS
- nsresult SetSettings (GtkPrintSettings*, GtkPageSetup*, GtkPrinter*);
+ nsresult SetSettings (nsIPrintSettings *, GtkPrintSettings*, GtkPageSetup*, GtkPrinter*);
void GetSourceFile (nsACString&);
static GeckoPrintSession *FromSettings (nsIPrintSettings *);
@@ -70,6 +70,7 @@ class GeckoPrintSession : public nsIPrintSession,
void JobError (const char *);
private:
+ nsCOMPtr<nsIPrintSettings> mPrintSettings;
GtkPrintSettings *mSettings;
GtkPageSetup *mPageSetup;
GtkPrinter *mPrinter;