vcl120: #i114306# tweak defaultprinter behavior again

This commit is contained in:
Philipp Lohmann [pl] 2011-03-10 13:28:06 +01:00
parent 5170c9fde2
commit da4071958c

View file

@ -333,30 +333,13 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
// setup printer
// if no specific printer is already set, create one
// #i108686#
// in case of a UI (platform independent or system dialog) print job, make the printer persistent over jobs
// however if no printer was already set by the print job's originator,
// and this is an API job, then use the system default location (because
// this is the only sensible default available if the user has no means of changing
// the destination
// #i114306# changed behavior back from persistence
// if no specific printer is already set, create the default printer
if( ! pController->getPrinter() )
{
rtl::OUString aPrinterName( i_rInitSetup.GetPrinterName() );
bool bSetJobSetup = true;
if( ! aPrinterName.getLength() && pController->isShowDialogs() && ! pController->isDirectPrint() )
{
// get printer name from configuration
SettingsConfigItem* pItem = SettingsConfigItem::get();
aPrinterName = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPrinterUsed" ) ) );
bSetJobSetup = false;
}
boost::shared_ptr<Printer> pPrinter( new Printer( aPrinterName ) );
if( bSetJobSetup )
pPrinter->SetJobSetup( i_rInitSetup );
pPrinter->SetJobSetup( i_rInitSetup );
pController->setPrinter( pPrinter );
}