diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2011-02-21 17:31:56 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2011-02-21 17:31:56 +0100 |
commit | 5b5c2ecf2c91d97652e6a16b615b0f7d92ebf98b (patch) | |
tree | b2da79d0d16bb17c6555bf44ec8c636f22a18409 /sfx2 | |
parent | rebase to DEV300_m100 (diff) | |
download | core-5b5c2ecf2c91d97652e6a16b615b0f7d92ebf98b.tar.gz core-5b5c2ecf2c91d97652e6a16b615b0f7d92ebf98b.zip |
vcl119: #i114306# update jobsetup before and after print job
Diffstat (limited to 'sfx2')
-rwxr-xr-x[-rw-r--r--] | sfx2/source/view/viewprn.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 515149c5a2d3..734ccda7a532 100644..100755 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -307,6 +307,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt { if ( mpObjectShell ) { + bool bCopyJobSetup = false; mpObjectShell->Broadcast( SfxPrintingHint( nState ) ); switch ( nState ) { @@ -334,6 +335,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt rBind.Invalidate( SID_PRINTDOC ); rBind.Invalidate( SID_PRINTDOCDIRECT ); rBind.Invalidate( SID_SETUPPRINTER ); + bCopyJobSetup = true; break; } @@ -341,6 +343,22 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt break; } + if( bCopyJobSetup && mpViewShell ) + { + SfxPrinter* pDocPrt = mpViewShell->GetPrinter(sal_False); + if( pDocPrt ) + { + if( pDocPrt->GetName() == getPrinter()->GetName() ) + pDocPrt->SetJobSetup( getPrinter()->GetJobSetup() ); + else + { + SfxPrinter* pNewPrt = new SfxPrinter( pDocPrt->GetOptions().Clone(), getPrinter()->GetName() ); + pNewPrt->SetJobSetup( getPrinter()->GetJobSetup() ); + mpViewShell->SetPrinter( pNewPrt, SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ); + } + } + } + if ( m_bNeedsChange ) mpObjectShell->EnableSetModified( m_bOrigStatus ); |