summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-05-06 13:01:57 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-05-06 13:02:41 +0100
commit7847a338f13071dcd591617f0e8d8fd69b2b0818 (patch)
tree2c2f1b4f90b88dc6b086e361ec90f70afd81e37f
parentc47f7dfb3045b7b029859ea1fac80143b996945b (diff)
cancel doesn't cancel printing
regression from commit e0ad036eed6b151ea81311fcf9ba46f1726b103c Author: Luboš Luňák <l.lunak@collabora.com> Date: Thu Feb 19 16:39:06 2015 +0100 mailmerge doesn't need to use the singlefile technique for printing Change-Id: Ib1a7ae3033c03d13ba930cb6b94d85bd8041334c
-rw-r--r--include/vcl/print.hxx2
-rw-r--r--vcl/source/gdi/print3.cxx17
2 files changed, 11 insertions, 8 deletions
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index e6d3b28c1638..7fe9e7926d71 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -408,7 +408,7 @@ public:
// These 3 together are more modular PrintJob(), allowing printing more documents as one print job
// by repeated calls to ExecutePrintJob(). Used by mailmerge.
- static void PreparePrintJob( std::shared_ptr<vcl::PrinterController> i_pController,
+ static bool PreparePrintJob( std::shared_ptr<vcl::PrinterController> i_pController,
const JobSetup& i_rInitSetup );
static bool ExecutePrintJob( std::shared_ptr<vcl::PrinterController> i_pController );
static void FinishPrintJob( std::shared_ptr<vcl::PrinterController> i_pController );
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 6b181b6155a9..e55329389d5d 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -297,7 +297,7 @@ void Printer::PrintJob(const std::shared_ptr<PrinterController>& i_xController,
}
}
-void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
+bool Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
const JobSetup& i_rInitSetup)
{
// check if there is a default printer; if not, show an error box (if appropriate)
@@ -459,7 +459,7 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
nullptr, "ErrorNoContentDialog",
"vcl/ui/errornocontentdialog.ui");
aBox->Execute();
- return;
+ return false;
}
}
@@ -476,7 +476,7 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
if( ! aDlg->Execute() )
{
xController->abortJob();
- return;
+ return false;
}
if( aDlg->isPrintToFile() )
{
@@ -484,7 +484,7 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
if( aFile.isEmpty() )
{
xController->abortJob();
- return;
+ return false;
}
xController->setValue( OUString( "LocalFileName" ),
makeAny( aFile ) );
@@ -501,6 +501,7 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
}
xController->pushPropertiesToPrinter();
+ return true;
}
bool Printer::ExecutePrintJob(std::shared_ptr<PrinterController> xController)
@@ -522,9 +523,11 @@ void Printer::FinishPrintJob(std::shared_ptr<PrinterController> xController)
void Printer::ImplPrintJob(std::shared_ptr<PrinterController> xController,
const JobSetup& i_rInitSetup)
{
- PreparePrintJob( xController, i_rInitSetup );
- ExecutePrintJob( xController );
- FinishPrintJob( xController );
+ if (PreparePrintJob(xController, i_rInitSetup))
+ {
+ ExecutePrintJob( xController );
+ FinishPrintJob( xController );
+ }
}
bool Printer::StartJob( const OUString& i_rJobName, std::shared_ptr<vcl::PrinterController>& i_xController)