diff options
author | Philipp Lohmann <pl@openoffice.org> | 2009-08-05 14:46:00 +0000 |
---|---|---|
committer | Philipp Lohmann <pl@openoffice.org> | 2009-08-05 14:46:00 +0000 |
commit | e22c6a289e98b6ee7889b41851cad6fff5b67361 (patch) | |
tree | 37b8636009ba07072fd2f6cdee8e3109ff954a6f /vcl/aqua/source/gdi/salprn.cxx | |
parent | a793801516881bf70ffbf7dcb8284d53a0f2246d (diff) |
#i103253# #i103252# fix headless printing, duplicate free
Diffstat (limited to 'vcl/aqua/source/gdi/salprn.cxx')
-rw-r--r-- | vcl/aqua/source/gdi/salprn.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index 7a5b0c7ba483..b3bc494bde17 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -40,6 +40,7 @@ #include "vcl/salptype.hxx" #include "vcl/print.hxx" #include "vcl/unohelp.hxx" +#include "vcl/svapp.hxx" #include <boost/bind.hpp> @@ -545,6 +546,8 @@ 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() ) + bShowProgressPanel = sal_False; // FIXME: jobStarted() should be done after the print dialog has ended (if there is one) // how do I know when that might be ? @@ -607,7 +610,10 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, [pPrintDict setObject: [[NSNumber numberWithInt: (int)i_rController.getPrinter()->GetCopyCount()] autorelease] forKey: NSPrintCopies]; [pPrintDict setObject: [[NSNumber numberWithBool: YES] autorelease] forKey: NSPrintDetailedErrorReporting]; [pPrintDict setObject: [[NSNumber numberWithInt: 1] autorelease] forKey: NSPrintFirstPage]; - [pPrintDict setObject: [[NSNumber numberWithInt: mnCurPageRangeCount] autorelease] forKey: NSPrintLastPage]; + // #i103253# weird: for some reason, autoreleasing the value below like the others above + // leads do a double free malloc error. Why this value should behave differently from all the others + // is a mystery. + [pPrintDict setObject: [NSNumber numberWithInt: mnCurPageRangeCount] forKey: NSPrintLastPage]; // create print operation @@ -616,7 +622,7 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, if( pPrintOperation ) { NSObject* pReleaseAfterUse = nil; - bool bShowPanel = (! bIsQuickJob && getUseNativeDialog() ); + bool bShowPanel = (! bIsQuickJob && getUseNativeDialog() && ! Application::IsHeadlessModeEnabled() ); [pPrintOperation setShowsPrintPanel: bShowPanel ? YES : NO ]; [pPrintOperation setShowsProgressPanel: bShowProgressPanel ? YES : NO]; |