summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-01-19 14:05:37 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2016-03-24 22:40:37 +0100
commitdea0abc58c558d3c62e806d06035b1a30420264e (patch)
treee6f5be01ca0d6e922e8fc1d243ac5645e54f2ce4 /sw/source
parent4ba9bf6ad0e7383e0af421a5fea79e3b9d34fce6 (diff)
tdf#93236 Revert "support fast MM printing in...
non-single-file mode only for CUPS" This reverts commit 138d29aa09417eba4d15ade4c9f4dab2620b6326. The patch breaks all print opions affecting multiple pages, i.e. page range selection, pages per sheet, blank pages, reverse page order and copies. Conflicts: configure.ac sw/source/uibase/dbui/dbmgr.cxx vcl/inc/cupsmgr.hxx vcl/unx/generic/printer/cupsmgr.cxx Change-Id: I8c39e7f0e71ef9688254c0a0dba049e1836b733c
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx40
1 files changed, 4 insertions, 36 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 0c26cb120d2a..2eb6b4336893 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -137,10 +137,6 @@
#include <dbfld.hxx>
#include <memory>
-#include <config_cups.h>
-#if ENABLE_CUPS && !defined(MACOSX)
-#include <vcl/printerinfomanager.hxx>
-#endif
#include <comphelper/propertysequence.hxx>
#include <officecfg/Office/Common.hxx>
@@ -910,27 +906,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
bool bNoError = true;
const bool bEMail = rMergeDescriptor.nMergeType == DBMGR_MERGE_EMAIL;
const bool bMergeShell = rMergeDescriptor.nMergeType == DBMGR_MERGE_SHELL;
- bool bCreateSingleFile = rMergeDescriptor.bCreateSingleFile;
-
- if( rMergeDescriptor.nMergeType == DBMGR_MERGE_PRINTER )
- {
- // It is possible to do MM printing in both modes for the same result, but the singlefile mode
- // is slower because of all the temporary document copies and merging them together
- // into the single file, while the other mode simply updates fields and prints for every record.
- // However, this would cause one print job for every record, and e.g. CUPS refuses new jobs
- // if it has many jobs enqueued (500 by default), and with the current printing framework
- // (which uses a pull model) it's rather complicated to create a single print job
- // in steps.
- // To handle this, CUPS backend has been changed to cache all the documents to print
- // and send them to CUPS only as one job at the very end. Therefore, with CUPS, it's ok
- // to use the faster mode. As I have no idea about other platforms, keep them using
- // the slower singlefile mode (or feel free to check them, or rewrite the printing code).
-#if ENABLE_CUPS && !defined(MACOSX)
- bCreateSingleFile = !psp::PrinterInfoManager::get().supportsBatchPrint();
-#else
- bCreateSingleFile = true;
-#endif
- }
+ const bool bCreateSingleFile = rMergeDescriptor.bCreateSingleFile;
::rtl::Reference< MailDispatcher > xMailDispatcher;
OUString sBodyMimeType;
@@ -1342,13 +1318,10 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
}
}
pWorkView->StartPrint( aOptions, IsMergeSilent(), rMergeDescriptor.bPrintAsync );
- SfxPrinter* pDocPrt = pWorkView->GetPrinter();
- JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : SfxViewShell::GetJobSetup();
+ // some GetPrinter functions have a true default, so keep the false
+ SfxPrinter* pDocPrt = pWorkView->GetPrinter( false );
+ JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : pWorkView->GetJobSetup();
bCancel = !Printer::PreparePrintJob( pWorkView->GetPrinterController(), aJobSetup );
-#if ENABLE_CUPS && !defined(MACOSX)
- if( !bCancel )
- psp::PrinterInfoManager::get().startBatchPrint();
-#endif
}
if( !bCancel && !Printer::ExecutePrintJob( pWorkView->GetPrinterController()))
bCancel = true;
@@ -1491,12 +1464,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
if( !bCreateSingleFile )
{
if( rMergeDescriptor.nMergeType == DBMGR_MERGE_PRINTER )
- {
Printer::FinishPrintJob( pWorkView->GetPrinterController());
-#if ENABLE_CUPS && !defined(MACOSX)
- psp::PrinterInfoManager::get().flushBatchPrint();
-#endif
- }
if( !bIsPDFexport )
{
pWorkDoc->SetDBManager( pOldDBManager );