summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2011-02-21 17:31:56 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2011-02-21 17:31:56 +0100
commit5b5c2ecf2c91d97652e6a16b615b0f7d92ebf98b (patch)
treeb2da79d0d16bb17c6555bf44ec8c636f22a18409 /sfx2
parent231934e72e694f193135df62429b83d4b11aff1a (diff)
vcl119: #i114306# update jobsetup before and after print job
Diffstat (limited to 'sfx2')
-rwxr-xr-x[-rw-r--r--]sfx2/source/view/viewprn.cxx18
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 );