summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/inc/salprn.h7
-rw-r--r--vcl/aqua/source/gdi/salprn.cxx22
-rw-r--r--vcl/inc/vcl/print.hxx2
-rw-r--r--vcl/inc/vcl/salprn.hxx4
-rw-r--r--vcl/os2/inc/salprn.h4
-rw-r--r--vcl/os2/source/gdi/salprn.cxx4
-rw-r--r--vcl/source/gdi/print.cxx82
-rw-r--r--vcl/source/gdi/print3.cxx21
-rw-r--r--vcl/unx/headless/svpprn.hxx4
-rw-r--r--vcl/unx/inc/salprn.h4
-rw-r--r--vcl/unx/source/gdi/salprnpsp.cxx15
-rw-r--r--vcl/win/inc/salprn.h4
-rw-r--r--vcl/win/source/gdi/salprn.cxx4
13 files changed, 52 insertions, 125 deletions
diff --git a/vcl/aqua/inc/salprn.h b/vcl/aqua/inc/salprn.h
index a572641dd59e..bf9c3c25bc87 100644
--- a/vcl/aqua/inc/salprn.h
+++ b/vcl/aqua/inc/salprn.h
@@ -106,8 +106,7 @@ class AquaSalInfoPrinter : public SalInfoPrinter
const String& rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
- vcl::PrinterController& i_rController,
- bool bIsQuickJob );
+ vcl::PrinterController& i_rController );
BOOL EndJob();
BOOL AbortJob();
SalGraphics* StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData );
@@ -142,7 +141,9 @@ class AquaSalPrinter : public SalPrinter
virtual BOOL StartJob( const XubString* i_pFileName,
const XubString& i_rJobName,
const XubString& i_rAppName,
- ULONG i_nCopies, BOOL i_bCollate,
+ ULONG i_nCopies,
+ bool i_bCollate,
+ bool i_bDirect,
ImplJobSetup* i_pSetupData );
// implement pull model print system
virtual BOOL StartJob( const String* i_pFileName,
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx
index d68c026d5ebe..6575f89d3fa0 100644
--- a/vcl/aqua/source/gdi/salprn.cxx
+++ b/vcl/aqua/source/gdi/salprn.cxx
@@ -519,8 +519,8 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
const String& i_rJobName,
const String& i_rAppName,
ImplJobSetup* i_pSetupData,
- vcl::PrinterController& i_rController,
- bool bIsQuickJob )
+ vcl::PrinterController& i_rController
+ )
{
if( mbJob )
return FALSE;
@@ -621,7 +621,7 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
if( pPrintOperation )
{
NSObject* pReleaseAfterUse = nil;
- bool bShowPanel = (! bIsQuickJob && getUseNativeDialog() && i_rController.isShowDialogs() );
+ bool bShowPanel = (! i_rController.isDirectPrint() && getUseNativeDialog() && i_rController.isShowDialogs() );
[pPrintOperation setShowsPrintPanel: bShowPanel ? YES : NO ];
[pPrintOperation setShowsProgressPanel: bShowProgressPanel ? YES : NO];
@@ -736,17 +736,7 @@ BOOL AquaSalPrinter::StartJob( const String* i_pFileName,
ImplJobSetup* i_pSetupData,
vcl::PrinterController& i_rController )
{
- bool bIsQuickJob = false;
- std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator quick_it =
- i_pSetupData->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsQuickJob" ) ) );
-
- if( quick_it != i_pSetupData->maValueMap.end() )
- {
- if( quick_it->second.equalsIgnoreAsciiCaseAscii( "true" ) )
- bIsQuickJob = true;
- }
-
- return mpInfoPrinter->StartJob( i_pFileName, i_rJobName, i_rAppName, i_pSetupData, i_rController, bIsQuickJob );
+ return mpInfoPrinter->StartJob( i_pFileName, i_rJobName, i_rAppName, i_pSetupData, i_rController );
}
// -----------------------------------------------------------------------
@@ -754,7 +744,9 @@ BOOL AquaSalPrinter::StartJob( const String* i_pFileName,
BOOL AquaSalPrinter::StartJob( const XubString* i_pFileName,
const XubString& i_rJobName,
const XubString& i_rAppName,
- ULONG i_nCopies, BOOL i_bCollate,
+ ULONG i_nCopies,
+ bool i_bCollate,
+ bool i_bDirect,
ImplJobSetup* i_pSetupData )
{
DBG_ERROR( "should never be called" );
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index 789571bc7d0e..d5d42466b611 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -270,7 +270,6 @@ private:
private:
SAL_DLLPRIVATE void ImplEndPrint();
- SAL_DLLPRIVATE BOOL StartJob( const XubString& rJobName );
SAL_DLLPRIVATE BOOL EndJob();
SAL_DLLPRIVATE Printer( const Printer& rPrinter );
SAL_DLLPRIVATE Printer& operator =( const Printer& rPrinter );
@@ -487,6 +486,7 @@ public:
void abortJob();
bool isShowDialogs() const;
+ bool isDirectPrint() const;
// implementation details, not usable outside vcl
SAL_DLLPRIVATE int getFilteredPageCount();
diff --git a/vcl/inc/vcl/salprn.hxx b/vcl/inc/vcl/salprn.hxx
index 4ffa969a674f..73f5454457cf 100644
--- a/vcl/inc/vcl/salprn.hxx
+++ b/vcl/inc/vcl/salprn.hxx
@@ -116,7 +116,9 @@ public: // public for Sal Implementation
virtual BOOL StartJob( const String* pFileName,
const String& rJobName,
const String& rAppName,
- ULONG nCopies, BOOL bCollate,
+ ULONG nCopies,
+ bool bCollate,
+ bool bDirect,
ImplJobSetup* pSetupData ) = 0;
// implement for pull model print systems only,
diff --git a/vcl/os2/inc/salprn.h b/vcl/os2/inc/salprn.h
index bddb29f61442..2c95965bc609 100644
--- a/vcl/os2/inc/salprn.h
+++ b/vcl/os2/inc/salprn.h
@@ -135,7 +135,9 @@ public:
virtual BOOL StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies, BOOL bCollate,
+ ULONG nCopies,
+ bool bCollate,
+ bool bDirect,
ImplJobSetup* pSetupData );
virtual BOOL EndJob();
virtual BOOL AbortJob();
diff --git a/vcl/os2/source/gdi/salprn.cxx b/vcl/os2/source/gdi/salprn.cxx
index b8207ed317f2..a31a4bb779f8 100644
--- a/vcl/os2/source/gdi/salprn.cxx
+++ b/vcl/os2/source/gdi/salprn.cxx
@@ -1559,7 +1559,9 @@ Os2SalPrinter::~Os2SalPrinter()
BOOL Os2SalPrinter::StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies, BOOL bCollate,
+ ULONG nCopies,
+ bool bCollate,
+ bool bDirect,
ImplJobSetup* pSetupData )
{
DEVOPENSTRUC aDevOpenStruc;
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 0ff5f283b5fa..eee954076278 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1257,88 +1257,6 @@ IMPL_LINK( Printer, ImplDestroyPrinterAsync, void*, pSalPrinter )
// -----------------------------------------------------------------------
-BOOL Printer::StartJob( const XubString& rJobName )
-{
- mnError = PRINTER_OK;
-
- if ( IsDisplayPrinter() )
- return FALSE;
-
- if ( IsJobActive() || IsPrinting() )
- return FALSE;
-
- ULONG nCopies = mnCopyCount;
- BOOL bCollateCopy = mbCollateCopy;
- BOOL bUserCopy = FALSE;
- if ( nCopies > 1 )
- {
- ULONG nDevCopy;
-
- if ( bCollateCopy )
- nDevCopy = GetCapabilities( PRINTER_CAPABILITIES_COLLATECOPIES );
- else
- nDevCopy = GetCapabilities( PRINTER_CAPABILITIES_COPIES );
-
- // Muessen Kopien selber gemacht werden?
- if ( nCopies > nDevCopy )
- {
- bUserCopy = TRUE;
- nCopies = 1;
- bCollateCopy = FALSE;
- }
- }
- else
- bCollateCopy = FALSE;
-
- ImplSVData* pSVData = ImplGetSVData();
- mpPrinter = pSVData->mpDefInst->CreatePrinter( mpInfoPrinter );
-
- if ( !mpPrinter )
- return FALSE;
-
- XubString* pPrintFile;
- if ( mbPrintFile )
- pPrintFile = &maPrintFile;
- else
- pPrintFile = NULL;
-
- // #125075# StartJob can Reschedule on Windows, sfx
- // depends on IsPrinting() in case of closing a document
- BOOL bSaveNewJobSetup = mbNewJobSetup;
- mbNewJobSetup = FALSE;
- String aSaveJobName = maJobName;
- maJobName = rJobName;
- mnCurPage = 1;
- mnCurPrintPage = 1;
- mbPrinting = TRUE;
-
- if( ! ImplGetSVData()->maGDIData.mbPrinterPullModel )
- {
- if ( !mpPrinter->StartJob( pPrintFile, rJobName, Application::GetDisplayName(),
- nCopies, bCollateCopy,
- maJobSetup.ImplGetConstData() ) )
- {
- mnError = ImplSalPrinterErrorCodeToVCL( mpPrinter->GetErrorCode() );
- if ( !mnError )
- mnError = PRINTER_GENERALERROR;
- pSVData->mpDefInst->DestroyPrinter( mpPrinter );
- mbNewJobSetup = bSaveNewJobSetup;
- maJobName = aSaveJobName;
- mnCurPage = 0;
- mnCurPrintPage = 0;
- mbPrinting = FALSE;
- mpPrinter = NULL;
- return FALSE;
- }
- }
-
- mbJobActive = TRUE;
-
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
BOOL Printer::EndJob()
{
BOOL bRet = FALSE;
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index c7ad36a48d7c..1888fbdcad49 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -327,10 +327,8 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
// check if the printer brings up its own dialog
// in that case leave the work to that dialog
- const String& rQuick( i_rInitSetup.GetValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsQuickJob" ) ) ) );
- bool bIsQuick = rQuick.Len() && rQuick.EqualsIgnoreCaseAscii( "true" );
if( ! pController->getPrinter()->GetCapabilities( PRINTER_CAPABILITIES_EXTERNALDIALOG ) &&
- ! bIsQuick &&
+ ! pController->isDirectPrint() &&
pController->isShowDialogs()
)
{
@@ -382,8 +380,8 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
return FALSE;
ULONG nCopies = mnCopyCount;
- BOOL bCollateCopy = mbCollateCopy;
- BOOL bUserCopy = FALSE;
+ bool bCollateCopy = mbCollateCopy;
+ bool bUserCopy = FALSE;
if ( nCopies > 1 )
{
@@ -475,7 +473,9 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
if( mpPrinter->StartJob( pPrintFile,
i_rJobName,
Application::GetDisplayName(),
- nCopies, bCollateCopy,
+ nCopies,
+ bCollateCopy,
+ i_pController->isDirectPrint(),
maJobSetup.ImplGetConstData() ) )
{
mbJobActive = TRUE;
@@ -1152,6 +1152,15 @@ bool PrinterController::isShowDialogs() const
return ! bApi && ! Application::IsHeadlessModeEnabled();
}
+bool PrinterController::isDirectPrint() const
+{
+ sal_Bool bDirect = sal_False;
+ const com::sun::star::beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDirect" ) ) );
+ if( pVal )
+ pVal->Value >>= bDirect;
+ return bDirect == sal_True;
+}
+
/*
* PrinterOptionsHelper
**/
diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/unx/headless/svpprn.hxx
index 154273f6da88..8f5a47fed118 100644
--- a/vcl/unx/headless/svpprn.hxx
+++ b/vcl/unx/headless/svpprn.hxx
@@ -90,7 +90,9 @@ public:
virtual BOOL StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies, BOOL bCollate,
+ ULONG nCopies,
+ bool bCollate,
+ bool bDirect,
ImplJobSetup* pSetupData );
virtual BOOL EndJob();
virtual BOOL AbortJob();
diff --git a/vcl/unx/inc/salprn.h b/vcl/unx/inc/salprn.h
index b1c92300ac49..59a5c3eef56a 100644
--- a/vcl/unx/inc/salprn.h
+++ b/vcl/unx/inc/salprn.h
@@ -90,7 +90,9 @@ public:
virtual BOOL StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies, BOOL bCollate,
+ ULONG nCopies,
+ bool bCollate,
+ bool bDirect,
ImplJobSetup* pSetupData );
virtual BOOL EndJob();
virtual BOOL AbortJob();
diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx
index dcdb3431ce59..d47e30a89633 100644
--- a/vcl/unx/source/gdi/salprnpsp.cxx
+++ b/vcl/unx/source/gdi/salprnpsp.cxx
@@ -928,7 +928,9 @@ BOOL PspSalPrinter::StartJob(
const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies, BOOL bCollate,
+ ULONG nCopies,
+ bool bCollate,
+ bool bDirect,
ImplJobSetup* pJobSetup )
{
vcl_sal::PrinterUpdate::jobStarted();
@@ -990,15 +992,6 @@ BOOL PspSalPrinter::StartJob(
}
m_aPrinterGfx.Init( m_aJobData );
- bool bIsQuickJob = false;
- std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator quick_it =
- pJobSetup->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsQuickJob" ) ) );
- if( quick_it != pJobSetup->maValueMap.end() )
- {
- if( quick_it->second.equalsIgnoreAsciiCaseAscii( "true" ) )
- bIsQuickJob = true;
- }
-
// set/clear backwards compatibility flag
bool bStrictSO52Compatibility = false;
std::hash_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
@@ -1011,7 +1004,7 @@ BOOL PspSalPrinter::StartJob(
}
m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility );
- return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bIsQuickJob ) ? TRUE : FALSE;
+ return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ) ? TRUE : FALSE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/win/inc/salprn.h b/vcl/win/inc/salprn.h
index 09473cf518e0..890ff70bc3d6 100644
--- a/vcl/win/inc/salprn.h
+++ b/vcl/win/inc/salprn.h
@@ -116,7 +116,9 @@ public:
virtual BOOL StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies, BOOL bCollate,
+ ULONG nCopies,
+ bool bCollate,
+ bool bDirect,
ImplJobSetup* pSetupData );
virtual BOOL EndJob();
virtual BOOL AbortJob();
diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx
index 7b0dfaf1fa98..8fe9b5d8f4d0 100644
--- a/vcl/win/source/gdi/salprn.cxx
+++ b/vcl/win/source/gdi/salprn.cxx
@@ -1966,7 +1966,9 @@ static int lcl_StartDocA( HDC hDC, DOCINFOA* pInfo, WinSalPrinter* pPrt )
BOOL WinSalPrinter::StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString&,
- ULONG nCopies, BOOL bCollate,
+ ULONG nCopies,
+ bool bCollate,
+ bool bDirect,
ImplJobSetup* pSetupData )
{
mnError = 0;