diff options
author | Kai Ahrens <ka@openoffice.org> | 2001-05-03 07:12:44 +0000 |
---|---|---|
committer | Kai Ahrens <ka@openoffice.org> | 2001-05-03 07:12:44 +0000 |
commit | 5513596a0315ec9f3cfecdb87b196c6cb77ff475 (patch) | |
tree | 2c91563a4b4244fccd68a1d4d37cb4d065b678d0 /sfx2 | |
parent | 0f17b0673193797bc154c720b33eaebdfd3390e9 (diff) |
added ::InitJob
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/printer.cxx | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 3165e549ae9c..8e1e5e719b5e 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: printer.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:52:36 $ + * last change: $Author: ka $ $Date: 2001-05-03 08:12:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,9 +71,17 @@ #ifndef _SV_PRINTDLG_HXX_ //autogen #include <svtools/printdlg.hxx> #endif +#ifndef INCLUDED_SVTOOLS_PRINTWARNINGOPTIONS_HXX +#include <svtools/printwarningoptions.hxx> +#endif +#ifndef INCLUDED_SVTOOLS_PRINTOPTIONS_HXX +#include <svtools/printoptions.hxx> +#endif + #pragma hdrstop #include "printer.hxx" +#include "printopt.hxx" #include "sfxtypes.hxx" #include "prnmon.hxx" #include "viewsh.hxx" @@ -489,6 +497,53 @@ const SfxFont* SfxPrinter::GetFontByName( const String &rFontName ) //-------------------------------------------------------------------- +BOOL SfxPrinter::InitJob( Window* pUIParent, BOOL bDocumentContainsTransparentObjects ) +{ + BOOL bTransparencyWarningShown = FALSE; + BOOL bReduceTransparency = FALSE; + BOOL bRet = TRUE; + + if( bDocumentContainsTransparentObjects ) + { + SvtPrintWarningOptions aWarnOpt; + + if( aWarnOpt.IsTransparency() ) + { + TransparencyPrintWarningBox aWarnBox( pUIParent ); + const USHORT nRet = aWarnBox.Execute(); + + if( nRet == RET_CANCEL ) + bRet = FALSE; + else + { + bTransparencyWarningShown = TRUE; + bReduceTransparency = ( nRet != RET_NO ); + aWarnOpt.SetTransparency( !aWarnBox.IsNoWarningChecked() ); + } + } + } + + if( bRet ) + { + const SvtPrinterOptions aPrinterOpt; + const SvtPrintFileOptions aPrintFileOpt; + const SvtBasePrintOptions* pPrinterOpt = &aPrinterOpt; + const SvtBasePrintOptions* pPrintFileOpt = &aPrintFileOpt; + PrinterOptions aNewPrinterOptions; + + ( ( IsPrintFileEnabled() && GetPrintFile().Len() ) ? pPrintFileOpt : pPrinterOpt )->GetPrinterOptions( aNewPrinterOptions ); + + if( bTransparencyWarningShown ) + aNewPrinterOptions.SetReduceTransparency( bReduceTransparency ); + + SetPrinterOptions( aNewPrinterOptions ); + } + + return bRet; +} + +//-------------------------------------------------------------------- + SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent, SfxViewShell *pViewShell, const SfxItemSet *pSet ): |