View | Details | Raw Unified | Return to issue 17967
Collapse All | Expand All

(-)svtools/source/dialogs/printdlg.cxx (+16 lines)
Lines 432-437 bool PrintDialog::ImplGetFilename() Link Here
432
            aServiceType[0] <<= TemplateDescription::FILESAVE_SIMPLE;
432
            aServiceType[0] <<= TemplateDescription::FILESAVE_SIMPLE;
433
            xInit->initialize( aServiceType );
433
            xInit->initialize( aServiceType );
434
434
435
	    INetURLObject aLocation( maFiPrintFile.GetText(), INET_PROT_FILE );
436
437
	    xFilePicker->setDefaultName( aLocation.GetLastName() );
438
	    xFilePicker->setDisplayDirectory ( aLocation.GetPartBeforeLastName() );
439
435
#ifdef UNX
440
#ifdef UNX
436
            if( ! Application::IsRemoteServer() )
441
            if( ! Application::IsRemoteServer() )
437
                // sensible only for Unix local
442
                // sensible only for Unix local
Lines 452-457 bool PrintDialog::ImplGetFilename() Link Here
452
                        xFilterMgr->appendFilter( OUString( RTL_CONSTASCII_USTRINGPARAM( "PostScript" ) ), OUString( RTL_CONSTASCII_USTRINGPARAM( "*.ps" ) ) );
457
                        xFilterMgr->appendFilter( OUString( RTL_CONSTASCII_USTRINGPARAM( "PostScript" ) ), OUString( RTL_CONSTASCII_USTRINGPARAM( "*.ps" ) ) );
453
                    if( bPDF )
458
                    if( bPDF )
454
                        xFilterMgr->appendFilter( OUString( RTL_CONSTASCII_USTRINGPARAM( "Portable Document Format" ) ), OUString( RTL_CONSTASCII_USTRINGPARAM( "*.pdf" ) ) );
459
                        xFilterMgr->appendFilter( OUString( RTL_CONSTASCII_USTRINGPARAM( "Portable Document Format" ) ), OUString( RTL_CONSTASCII_USTRINGPARAM( "*.pdf" ) ) );
460
461
		    String aFilter = pPrinter->GetJobValue( String::CreateFromAscii( "Filter#" ) );
462
		    if (aFilter.Len())
463
			    xFilterMgr->setCurrentFilter( aFilter );
455
                }
464
                }
456
                catch( IllegalArgumentException& rExc )
465
                catch( IllegalArgumentException& rExc )
457
                {
466
                {
Lines 475-480 bool PrintDialog::ImplGetFilename() Link Here
475
                Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
484
                Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
476
				INetURLObject aObj( aPathSeq[0] );
485
				INetURLObject aObj( aPathSeq[0] );
477
				maFiPrintFile.SetText( aObj.PathToFileName() );
486
				maFiPrintFile.SetText( aObj.PathToFileName() );
487
488
#ifdef UNX
489
		Printer* pPrinter = TEMPPRINTER() ? TEMPPRINTER() : mpPrinter;
490
		if ( pPrinter )
491
			pPrinter->SetJobValue( String::CreateFromAscii( "Filter#" ),
492
					       xFilterMgr->getCurrentFilter() );
493
#endif
478
                return true;
494
                return true;
479
            }
495
            }
480
        }
496
        }

Return to issue 17967