diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-09-18 10:15:03 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-09-18 10:15:03 +0000 |
commit | 5ed3fa4c39a67b2b12b4206bef6680fb757e1b75 (patch) | |
tree | d85ce99214129673a433b6a5c52181367bce2f13 /sw/source/ui/uiview/viewprt.cxx | |
parent | 8493b85dfcbac97bd23393ceec8f057ea5a8cc82 (diff) |
CWS-TOOLING: integrate CWS mba32issues02
2009-09-17 mb93783 merge commit
2009-09-03 tb121644 #i104748 - slot unification to .uno:PasteSpecial
2009-09-01 mba #101455#: code simplification
2009-08-31 mb93783 iso locales for norwegian builds are nb and nn, not no
2009-08-25 mba merge to m55
2009-07-29 mba cleanup after rebase
2009-07-29 mba #i103200#: wrong order of first and last name in CJK UI
2009-07-27 mba adding dictionary changes from broken svn CWS
2009-07-27 mba adding dictionary changes from broken svn CWS
2009-07-27 mba apply patch from broken svn CWS
Diffstat (limited to 'sw/source/ui/uiview/viewprt.cxx')
-rw-r--r-- | sw/source/ui/uiview/viewprt.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx index 6d219e71ab30..5e45f9a9a48c 100644 --- a/sw/source/ui/uiview/viewprt.cxx +++ b/sw/source/ui/uiview/viewprt.cxx @@ -141,6 +141,10 @@ void SetPrinter( IDocumentDeviceAccess* pIDDA, SfxPrinter* pNew, BOOL bWeb ) USHORT __EXPORT SwView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool ) { SwWrtShell &rSh = GetWrtShell(); + SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false ); + if ( pOld && pOld->IsPrinting() ) + return SFX_PRINTERROR_BUSY; + if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags ) { rSh.getIDocumentDeviceAccess()->setPrinter( pNew, true, true ); @@ -431,9 +435,19 @@ ErrCode SwView::DoPrint( SfxPrinter *pPrinter, PrintDialog *pDlg, BOOL bSilent, } pProgress->Stop(); - pProgress->DeleteOnEndPrint(); - pPrinter->EndJob(); - return pPrinter->GetError(); + if ( pPrinter->IsJobActive() ) + { + pProgress->DeleteOnEndPrint(); + pPrinter->EndJob(); + return pPrinter->GetError(); + } + else + { + // the next call might destroy pPrinter (in case it is not the usual document printer); so get the error before + ULONG nError = pPrinter->GetError(); + pProgress->DeleteOnEndPrint(); + return nError; + } } |