diff options
author | Philipp Lohmann <pl@openoffice.org> | 2009-08-05 15:02:39 +0000 |
---|---|---|
committer | Philipp Lohmann <pl@openoffice.org> | 2009-08-05 15:02:39 +0000 |
commit | 4bcda09aeec59e01797f96a163f408b642491a46 (patch) | |
tree | 0ba9dde2424359556620b5750ff0c35e25f44897 /vcl | |
parent | e22c6a289e98b6ee7889b41851cad6fff5b67361 (diff) |
#i96606# fix API print (no dialogs)
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/aqua/source/gdi/salprn.cxx | 5 | ||||
-rw-r--r-- | vcl/inc/vcl/print.hxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 11 |
3 files changed, 14 insertions, 4 deletions
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index b3bc494bde17..d68c026d5ebe 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -40,7 +40,6 @@ #include "vcl/salptype.hxx" #include "vcl/print.hxx" #include "vcl/unohelp.hxx" -#include "vcl/svapp.hxx" #include <boost/bind.hpp> @@ -546,7 +545,7 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, beans::PropertyValue* pMonitor = i_rController.getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MonitorVisible" ) ) ); if( pMonitor ) pMonitor->Value >>= bShowProgressPanel; - if( Application::IsHeadlessModeEnabled() ) + if( ! i_rController.isShowDialogs() ) bShowProgressPanel = sal_False; // FIXME: jobStarted() should be done after the print dialog has ended (if there is one) @@ -622,7 +621,7 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, if( pPrintOperation ) { NSObject* pReleaseAfterUse = nil; - bool bShowPanel = (! bIsQuickJob && getUseNativeDialog() && ! Application::IsHeadlessModeEnabled() ); + bool bShowPanel = (! bIsQuickJob && getUseNativeDialog() && i_rController.isShowDialogs() ); [pPrintOperation setShowsPrintPanel: bShowPanel ? YES : NO ]; [pPrintOperation setShowsProgressPanel: bShowProgressPanel ? YES : NO]; diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 94680d10d3e7..789571bc7d0e 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -486,6 +486,8 @@ public: void abortJob(); + bool isShowDialogs() const; + // implementation details, not usable outside vcl SAL_DLLPRIVATE int getFilteredPageCount(); SAL_DLLPRIVATE Size getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf, bool i_bMayUseCache = false ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 8251c5f2f506..c7ad36a48d7c 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -331,7 +331,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr bool bIsQuick = rQuick.Len() && rQuick.EqualsIgnoreCaseAscii( "true" ); if( ! pController->getPrinter()->GetCapabilities( PRINTER_CAPABILITIES_EXTERNALDIALOG ) && ! bIsQuick && - ! Application::IsHeadlessModeEnabled() + pController->isShowDialogs() ) { try @@ -1143,6 +1143,15 @@ void PrinterController::pushPropertiesToPrinter() mpImplData->mpPrinter->SetCopyCount( static_cast<USHORT>(nCopyCount), bCollate ); } +bool PrinterController::isShowDialogs() const +{ + sal_Bool bApi = sal_False; + const com::sun::star::beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsApi" ) ) ); + if( pVal ) + pVal->Value >>= bApi; + return ! bApi && ! Application::IsHeadlessModeEnabled(); +} + /* * PrinterOptionsHelper **/ |