diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2011-01-06 12:12:27 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2011-01-06 12:12:27 +0100 |
commit | 4982f03b0ffd19a5bfcb406d22a249245a070960 (patch) | |
tree | 599408be39a0b8b9572655e0014f67a7c65c94ce /sfx2 | |
parent | 26907c9299b703213bac1dc67b6d152b7714828e (diff) | |
parent | f732a8d1b57c4ec214a6f114e386fedd6b57872b (diff) |
CWS-TOOLING: integrate CWS vcl117
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/pch/precompiled_sfx2.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sfx2/event.hxx | 1 | ||||
-rw-r--r-- | sfx2/inc/sfx2/mnumgr.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sfx2/module.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sfx2/printer.hxx | 60 | ||||
-rw-r--r-- | sfx2/inc/sfx2/viewsh.hxx | 5 | ||||
-rw-r--r-- | sfx2/source/appl/appmain.cxx | 15 | ||||
-rwxr-xr-x | sfx2/source/doc/printhelper.cxx | 74 | ||||
-rw-r--r-- | sfx2/source/view/printer.cxx | 314 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 155 |
10 files changed, 7 insertions, 623 deletions
diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx index 4463b0003e..ea0e774b03 100644 --- a/sfx2/inc/pch/precompiled_sfx2.hxx +++ b/sfx2/inc/pch/precompiled_sfx2.hxx @@ -654,7 +654,7 @@ #include "vcl/stdtext.hxx" #include "vcl/timer.hxx" #include "vcl/unohelp.hxx" -#include "vcl/wintypes.hxx" +#include "tools/wintypes.hxx" #include "vos/diagnose.hxx" #include "vos/module.hxx" #include "vos/mutex.hxx" diff --git a/sfx2/inc/sfx2/event.hxx b/sfx2/inc/sfx2/event.hxx index c81329b0c5..7f33941a2b 100644 --- a/sfx2/inc/sfx2/event.hxx +++ b/sfx2/inc/sfx2/event.hxx @@ -119,7 +119,6 @@ public: SfxObjectShell* GetObjShell() const { return _pObjShell; } }; -class PrintDialog; class Printer; class SfxPrintingHint : public SfxHint { diff --git a/sfx2/inc/sfx2/mnumgr.hxx b/sfx2/inc/sfx2/mnumgr.hxx index c0bfb134f9..63ade086ab 100644 --- a/sfx2/inc/sfx2/mnumgr.hxx +++ b/sfx2/inc/sfx2/mnumgr.hxx @@ -32,7 +32,7 @@ #ifndef _MENU_HXX //autogen //wg. MENU_APPEND !!!! #include <vcl/menu.hxx> #endif -#include <vcl/wintypes.hxx> +#include <tools/wintypes.hxx> #include <tools/link.hxx> #include <com/sun/star/embed/VerbDescriptor.hpp> #include <com/sun/star/uno/Sequence.hxx> diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx index 2cb48c64da..8ccfa7a258 100644 --- a/sfx2/inc/sfx2/module.hxx +++ b/sfx2/inc/sfx2/module.hxx @@ -33,7 +33,7 @@ #include <sfx2/shell.hxx> #include <sfx2/imgdef.hxx> #include <sal/types.h> -#include <vcl/fldunit.hxx> +#include <tools/fldunit.hxx> class ImageList; diff --git a/sfx2/inc/sfx2/printer.hxx b/sfx2/inc/sfx2/printer.hxx index 64cbcb2226..37986794eb 100644 --- a/sfx2/inc/sfx2/printer.hxx +++ b/sfx2/inc/sfx2/printer.hxx @@ -34,60 +34,11 @@ #include <vcl/print.hxx> #endif -class SfxFont; class SfxTabPage; class SfxItemSet; struct SfxPrinter_Impl; -#define SFX_RANGE_NOTSET ((USHORT)0xFFFF) - -// class SfxFontSizeInfo ------------------------------------------------- - -class SfxFontSizeInfo -{ -private: - static USHORT pStaticSizes[]; - Size* pSizes; - USHORT nSizes; - BOOL bScalable; - -public: - SfxFontSizeInfo( const SfxFont& rFont, const OutputDevice& rDevice ); - ~SfxFontSizeInfo(); - - BOOL HasSize(const Size &rSize) const; - BOOL IsScalable() const { return bScalable; } - - USHORT SizeCount() const { return nSizes; } - const Size& GetSize( USHORT nNo ) const - { return pSizes[nNo]; } -}; - -// class SfxFont --------------------------------------------------------- - -class SFX2_DLLPUBLIC SfxFont -{ -private: - String aName; - FontFamily eFamily; - FontPitch ePitch; - CharSet eCharSet; - - SfxFont& operator=(const SfxFont& rFont); // not implemented - -public: - SfxFont( const FontFamily eFam, - const String& aName, - const FontPitch eFontPitch = PITCH_DONTKNOW, - const CharSet eFontCharSet = RTL_TEXTENCODING_DONTKNOW ); - // ZugriffsMethoden: - inline const String& GetName() const { return aName; } - inline FontFamily GetFamily() const { return eFamily; } - inline FontPitch GetPitch() const { return ePitch; } - inline CharSet GetCharSet() const { return eCharSet; } -}; - // class SfxPrinter ------------------------------------------------------ class SFX2_DLLPUBLIC SfxPrinter : public Printer @@ -125,19 +76,8 @@ public: const SfxItemSet& GetOptions() const { return *pOptions; } void SetOptions( const SfxItemSet &rNewOptions ); - void EnableRange( USHORT nRange ); - void DisableRange( USHORT nRange ); - BOOL IsRangeEnabled( USHORT nRange ) const; - BOOL IsKnown() const { return bKnown; } BOOL IsOriginal() const { return bKnown; } - - using OutputDevice::GetFont; - USHORT GetFontCount(); - const SfxFont* GetFont( USHORT nNo ) const; - const SfxFont* GetFontByName( const String &rFontName ); - - BOOL InitJob( Window* pUIParent, BOOL bAskAboutTransparentObjects ); }; #endif diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index 354edb836b..a471a205aa 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -59,7 +59,6 @@ class SfxItemPool; class SfxTabPage; class SfxPrintMonitor; class SfxFrameSetDescriptor; -class PrintDialog; class Printer; class SfxPrinter; class SfxProgress; @@ -239,13 +238,9 @@ public: void AdjustVisArea(const Rectangle& rRect); // Printing Interface - virtual void PreparePrint( PrintDialog *pPrintDialog = 0 ); - virtual ErrCode DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ); - virtual USHORT Print( SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pPrintDialog = 0 ); virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE ); virtual USHORT SetPrinter( SfxPrinter *pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=FALSE ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); - virtual PrintDialog* CreatePrintDialog( Window *pParent ); void LockPrinter( BOOL bLock = TRUE ); BOOL IsPrinterLocked() const; virtual JobSetup GetJobSetup() const; diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx index ded60743dc..5664fbc2e2 100644 --- a/sfx2/source/appl/appmain.cxx +++ b/sfx2/source/appl/appmain.cxx @@ -116,21 +116,6 @@ void SfxApplication::Init <SfxApplication::OpenClients()> */ { -#ifdef DDE_AVAILABLE -#ifndef DBG_UTIL - InitializeDde(); -#else - if( !InitializeDde() ) - { - ByteString aStr( "Kein DDE-Service moeglich. Fehler: " ); - if( GetDdeService() ) - aStr += GetDdeService()->GetError(); - else - aStr += '?'; - DBG_ASSERT( sal_False, aStr.GetBuffer() ) - } -#endif -#endif } //-------------------------------------------------------------------- diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index fee1e4df3c..78c236f385 100755 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -53,7 +53,6 @@ #include <ucbhelper/content.hxx> #include <cppuhelper/interfacecontainer.hxx> #include <vos/mutex.hxx> -#include <svtools/printdlg.hxx> #include <cppuhelper/implbase1.hxx> #include <sfx2/viewfrm.hxx> @@ -799,81 +798,8 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin { if ( !m_xPrintJob.is() ) m_xPrintJob = new SfxPrintJob_Impl( this ); -/* - PrintDialog* pDlg = pPrintHint->GetPrintDialog(); - Printer* pPrinter = pPrintHint->GetPrinter(); - ::rtl::OUString aPrintFile ( ( pPrinter && pPrinter->IsPrintFileEnabled() ) ? pPrinter->GetPrintFile() : String() ); - ::rtl::OUString aRangeText ( ( pDlg && pDlg->IsRangeChecked(PRINTDIALOG_RANGE) ) ? pDlg->GetRangeText() : String() ); - sal_Bool bSelectionOnly = ( ( pDlg && pDlg->IsRangeChecked(PRINTDIALOG_SELECTION) ) ? sal_True : sal_False ); - - sal_Int32 nArgs = 2; - if ( aPrintFile.getLength() ) - nArgs++; - if ( aRangeText.getLength() ) - nArgs++; - else if ( bSelectionOnly ) - nArgs++; - - m_aPrintOptions.realloc(nArgs); - m_aPrintOptions[0].Name = DEFINE_CONST_UNICODE("CopyCount"); - m_aPrintOptions[0].Value <<= (sal_Int16) (pPrinter ? pPrinter->GetCopyCount() : 1 ); - m_aPrintOptions[1].Name = DEFINE_CONST_UNICODE("Collate"); - m_aPrintOptions[1].Value <<= (sal_Bool) (pDlg ? pDlg->IsCollateChecked() : sal_False ); - - if ( bSelectionOnly ) - { - m_aPrintOptions[2].Name = DEFINE_CONST_UNICODE("Selection"); - m_aPrintOptions[2].Value <<= bSelectionOnly; - } - else if ( aRangeText.getLength() ) - { - m_aPrintOptions[2].Name = DEFINE_CONST_UNICODE("Pages"); - m_aPrintOptions[2].Value <<= aRangeText; - } - - if ( aPrintFile.getLength() ) - { - m_aPrintOptions[nArgs-1].Name = DEFINE_CONST_UNICODE("FileName"); - m_aPrintOptions[nArgs-1].Value <<= aPrintFile; - } -*/ m_aPrintOptions = pPrintHint->GetOptions(); } -/* - else if ( pPrintHint->GetWhich() == -3 ) // -3 : AdditionalPrintOptions - { - uno::Sequence < beans::PropertyValue >& lOldOpts = m_aPrintOptions; - const uno::Sequence < beans::PropertyValue >& lNewOpts = pPrintHint->GetAdditionalOptions(); - sal_Int32 nOld = lOldOpts.getLength(); - sal_Int32 nAdd = lNewOpts.getLength(); - lOldOpts.realloc( nOld + nAdd ); - - // assume that all new elements are overwriting old ones and so don't need to be added - sal_Int32 nTotal = nOld; - for ( sal_Int32 n=0; n<nAdd; n++ ) - { - sal_Int32 m; - for ( m=0; m<nOld; m++ ) - if ( lNewOpts[n].Name == lOldOpts[m].Name ) - // new option overwrites old one - break; - - if ( m == nOld ) - { - // this is a new option, so add it to the resulting sequence - counter must be incremented - lOldOpts[nTotal].Name = lNewOpts[n].Name; - lOldOpts[nTotal++].Value = lNewOpts[n].Value; - } - else - // overwrite old option with new value, counter stays unmodified - lOldOpts[m].Value = lNewOpts[n].Value; - } - - if ( nTotal != lOldOpts.getLength() ) - // at least one new options has overwritten an old one, so we allocated too much - lOldOpts.realloc( nTotal ); - } -*/ else if ( pPrintHint->GetWhich() != -2 ) // -2 : CancelPrintJob { view::PrintJobEvent aEvent; diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index b12f4ce7b0..8db0147da2 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -30,7 +30,6 @@ #include <vcl/virdev.hxx> #include <vcl/metric.hxx> #include <vcl/msgbox.hxx> -#include <svtools/printdlg.hxx> #include <unotools/printwarningoptions.hxx> #include <svtools/printoptions.hxx> #include <vector> @@ -47,54 +46,23 @@ #include "sfx2/sfxresid.hxx" #include "view.hrc" -#ifdef MSC -// der ist buggy -#define NEW_OBJECTS(Class, nCount) ((Class*) new char[ sizeof(Class) * (nCount) ]) -#else -#define NEW_OBJECTS(Class, nCount) (new Class[nCount]) -#endif - - -USHORT SfxFontSizeInfo::pStaticSizes[] = -{ - 60, - 80, - 100, - 120, - 140, - 180, - 240, - 360, - 480, - 600, - 720 -}; - -//-------------------------------------------------------------------- - -SV_DECL_PTRARR_DEL(SfxFontArr_Impl,SfxFont*,10,5) - // struct SfxPrinter_Impl ------------------------------------------------ struct SfxPrinter_Impl { - SfxFontArr_Impl* mpFonts; BOOL mbAll; BOOL mbSelection; BOOL mbFromTo; BOOL mbRange; SfxPrinter_Impl() : - mpFonts ( NULL ), mbAll ( TRUE ), mbSelection ( TRUE ), mbFromTo ( TRUE ), mbRange ( TRUE ) {} - ~SfxPrinter_Impl() { delete mpFonts; } + ~SfxPrinter_Impl() {} }; -#define FONTS() pImpl->mpFonts - struct SfxPrintOptDlg_Impl { sal_Bool mbHelpDisabled; @@ -103,98 +71,6 @@ struct SfxPrintOptDlg_Impl mbHelpDisabled ( sal_False ) {} }; -//-------------------------------------------------------------------- - -SfxFontSizeInfo::SfxFontSizeInfo( const SfxFont &rFont, - const OutputDevice &rDevice ) : - - pSizes(0), - nSizes(0), - bScalable(TRUE) - -{ - if ( 0 == rDevice.GetDevFontCount() ) - bScalable = FALSE; - else - { - OutputDevice &rDev = (OutputDevice&) rDevice; - Font aFont(rFont.GetName(), Size(0,12)); - aFont.SetFamily(rFont.GetFamily()); - aFont.SetPitch(rFont.GetPitch()); - aFont.SetCharSet(rFont.GetCharSet()); - - // verfuegbare Groessen in die Liste eintragen, Groesse in 10tel Punkt - int nSizeCount = rDev.GetDevFontSizeCount(aFont); - pSizes = NEW_OBJECTS(Size, nSizeCount); - const MapMode aOldMapMode = rDev.GetMapMode(); - MapMode aMap(aOldMapMode); - aMap.SetMapUnit(MAP_POINT); - const Fraction aTen(1, 10); - aMap.SetScaleX(aTen); - aMap.SetScaleY(aTen); - rDev.SetMapMode(aMap); - - // Es gibt Fonts mit Bitmaps und skalierbaren Groessen - // In diesem Fall wird der Fonts als skalierbar behandelt. - BOOL bFoundScalable = FALSE; - for ( int i = 0; i < nSizeCount; ++i ) - { - const Size aSize( rDev.GetDevFontSize(aFont, i) ); - if ( aSize.Height() != 0 ) - pSizes[nSizes++] = aSize; - else - bFoundScalable |= TRUE; - } - if( !bFoundScalable ) - bScalable = FALSE; - else - { - // statische Font-Sizes verwenden - delete [] pSizes; - nSizes = 0; - } - rDev.SetMapMode(aOldMapMode); - } - - if ( 0 == nSizes ) - { - nSizes = sizeof(pStaticSizes) / sizeof(USHORT); - pSizes = NEW_OBJECTS(Size, nSizes); - for ( USHORT nPos = 0; nPos <nSizes; ++nPos ) - pSizes[nPos] = Size( 0, pStaticSizes[nPos] ); - } -} - -//-------------------------------------------------------------------- - -SfxFontSizeInfo::~SfxFontSizeInfo() -{ - delete [] pSizes; -} - -//-------------------------------------------------------------------- - -BOOL SfxFontSizeInfo::HasSize(const Size &rSize) const -{ - if ( bScalable ) - return TRUE; - for ( USHORT i = 0; i < nSizes; ++i) - if ( pSizes[i] == rSize ) - return TRUE; - return FALSE; -} - -//-------------------------------------------------------------------- - -SfxFont::SfxFont( const FontFamily eFontFamily, const String& aFontName, - const FontPitch eFontPitch, const CharSet eFontCharSet ): - aName( aFontName ), - eFamily( eFontFamily ), - ePitch( eFontPitch ), - eCharSet( eFontCharSet ) -{ -} - // class SfxPrinter ------------------------------------------------------ SfxPrinter* SfxPrinter::Create( SvStream& rStream, SfxItemSet* pOptions ) @@ -335,194 +211,6 @@ void SfxPrinter::SetOptions( const SfxItemSet &rNewOptions ) //-------------------------------------------------------------------- -void SfxPrinter::EnableRange( USHORT nRange ) -{ - PrintDialogRange eRange = (PrintDialogRange)nRange; - - if ( eRange == PRINTDIALOG_ALL ) - pImpl->mbAll = TRUE; - else if ( eRange == PRINTDIALOG_SELECTION ) - pImpl->mbSelection = TRUE; - else if ( eRange == PRINTDIALOG_FROMTO ) - pImpl->mbFromTo = TRUE; - else if ( eRange == PRINTDIALOG_RANGE ) - pImpl->mbRange = TRUE; -} - -//-------------------------------------------------------------------- - -void SfxPrinter::DisableRange( USHORT nRange ) -{ - PrintDialogRange eRange = (PrintDialogRange)nRange; - - if ( eRange == PRINTDIALOG_ALL ) - pImpl->mbAll = FALSE; - else if ( eRange == PRINTDIALOG_SELECTION ) - pImpl->mbSelection = FALSE; - else if ( eRange == PRINTDIALOG_FROMTO ) - pImpl->mbFromTo = FALSE; - else if ( eRange == PRINTDIALOG_RANGE ) - pImpl->mbRange = FALSE; -} - -//-------------------------------------------------------------------- - -BOOL SfxPrinter::IsRangeEnabled( USHORT nRange ) const -{ - PrintDialogRange eRange = (PrintDialogRange)nRange; - BOOL bRet = FALSE; - - if ( eRange == PRINTDIALOG_ALL ) - bRet = pImpl->mbAll; - else if ( eRange == PRINTDIALOG_SELECTION ) - bRet = pImpl->mbSelection; - else if ( eRange == PRINTDIALOG_FROMTO ) - bRet = pImpl->mbFromTo; - else if ( eRange == PRINTDIALOG_RANGE ) - bRet = pImpl->mbRange; - - return bRet; -} - -//-------------------------------------------------------------------- - -SV_IMPL_PTRARR(SfxFontArr_Impl,SfxFont*) - -//-------------------------------------------------------------------- - -const SfxFont* SfxFindFont_Impl( const SfxFontArr_Impl& rArr, - const String& rName ) -{ - const USHORT nCount = rArr.Count(); - for ( USHORT i = 0; i < nCount; ++i ) - { - const SfxFont *pFont = rArr[i]; - if ( pFont->GetName() == rName ) - return pFont; - } - return NULL; -} - -//-------------------------------------------------------------------- - -void SfxPrinter::UpdateFonts_Impl() -{ - VirtualDevice *pVirDev = 0; - const OutputDevice *pOut = this; - - // falls kein Drucker gefunden werden konnte, ein - // temp. Device erzeugen fuer das Erfragen der Fonts - if( !IsValid() ) - pOut = pVirDev = new VirtualDevice; - - int nCount = pOut->GetDevFontCount(); - FONTS() = new SfxFontArr_Impl((BYTE)nCount); - - std::vector< Font > aNonRegularFonts; - for(int i = 0;i < nCount;++i) - { - Font aFont(pOut->GetDevFont(i)); - if ( (aFont.GetItalic() != ITALIC_NONE) || - (aFont.GetWeight() != WEIGHT_MEDIUM) ) - { - // First: Don't add non-regular fonts. The font name is not unique so we have - // to filter the device font list. - aNonRegularFonts.push_back( aFont ); - } - else if ( FONTS()->Count() == 0 || - (*FONTS())[FONTS()->Count()-1]->GetName() != aFont.GetName() ) - { - DBG_ASSERT(0 == SfxFindFont_Impl(*FONTS(), aFont.GetName()), "Doppelte Fonts vom SV-Device!"); - SfxFont* pTmp = new SfxFont( aFont.GetFamily(), aFont.GetName(), - aFont.GetPitch(), aFont.GetCharSet() ); - FONTS()->C40_INSERT(SfxFont, pTmp, FONTS()->Count()); - } - } - delete pVirDev; - - // Try to add all non-regular fonts. It could be that there was no regular font - // with the same name added. - std::vector< Font >::const_iterator pIter; - for ( pIter = aNonRegularFonts.begin(); pIter != aNonRegularFonts.end(); pIter++ ) - { - if ( SfxFindFont_Impl( *FONTS(), pIter->GetName() ) == 0 ) - { - SfxFont* pTmp = new SfxFont( pIter->GetFamily(), pIter->GetName(), - pIter->GetPitch(), pIter->GetCharSet() ); - FONTS()->C40_INSERT( SfxFont, pTmp, FONTS()->Count() ); - } - } -} - -//-------------------------------------------------------------------- - -USHORT SfxPrinter::GetFontCount() -{ - if ( !FONTS() ) - UpdateFonts_Impl(); - return FONTS()->Count(); -} - -//-------------------------------------------------------------------- - -const SfxFont* SfxPrinter::GetFont( USHORT nNo ) const -{ - DBG_ASSERT( FONTS(), "bitte erst GetFontCount() abfragen!" ); - return (*FONTS())[ nNo ]; -} - -//-------------------------------------------------------------------- - -const SfxFont* SfxPrinter::GetFontByName( const String &rFontName ) -{ - if ( !FONTS() ) - UpdateFonts_Impl(); - return SfxFindFont_Impl(*FONTS(), rFontName); -} - -//-------------------------------------------------------------------- - -BOOL SfxPrinter::InitJob( Window* pUIParent, BOOL bAskAboutTransparentObjects ) -{ - const SvtPrinterOptions aPrinterOpt; - const SvtPrintFileOptions aPrintFileOpt; - const SvtBasePrintOptions* pPrinterOpt = &aPrinterOpt; - const SvtBasePrintOptions* pPrintFileOpt = &aPrintFileOpt; - PrinterOptions aNewPrinterOptions; - BOOL bRet = TRUE; - - ( ( IsPrintFileEnabled() && GetPrintFile().Len() ) ? pPrintFileOpt : pPrinterOpt )->GetPrinterOptions( aNewPrinterOptions ); - - if( bAskAboutTransparentObjects && !aNewPrinterOptions.IsReduceTransparency() ) - { - if ( !Application::IsHeadlessModeEnabled() ) - { - SvtPrintWarningOptions aWarnOpt; - - if( aWarnOpt.IsTransparency() ) - { - TransparencyPrintWarningBox aWarnBox( pUIParent ); - const USHORT nRet = aWarnBox.Execute(); - - if( nRet == RET_CANCEL ) - bRet = FALSE; - else - { - aNewPrinterOptions.SetReduceTransparency( nRet != RET_NO ); - aWarnOpt.SetTransparency( !aWarnBox.IsNoWarningChecked() ); - } - } - } - } - - if( bRet ) - SetPrinterOptions( aNewPrinterOptions ); - - return bRet; -} - -//-------------------------------------------------------------------- - SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent, SfxViewShell *pViewShell, const SfxItemSet *pSet ) : diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index d18cc35f5e..1a43efb5ed 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -34,7 +34,6 @@ #include <svl/itempool.hxx> #include <vcl/msgbox.hxx> -#include <svtools/printdlg.hxx> #include <svtools/prnsetup.hxx> #include <svl/flagitem.hxx> #include <svl/stritem.hxx> @@ -352,30 +351,6 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt } } -// ----------------------------------------------------------------------- - -void DisableRanges( PrintDialog& rDlg, SfxPrinter* pPrinter ) - -/* [Beschreibung] - - Mit dieser Funktion werden die nicht verf"ugbaren Ranges - vom Printer zum PrintDialog geforwarded. -*/ - -{ - if ( !pPrinter ) - return; - - if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_ALL ) ) - rDlg.DisableRange( PRINTDIALOG_ALL ); - if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_SELECTION ) ) - rDlg.DisableRange( PRINTDIALOG_SELECTION ); - if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_FROMTO ) ) - rDlg.DisableRange( PRINTDIALOG_FROMTO ); - if ( !pPrinter->IsRangeEnabled( PRINTDIALOG_RANGE ) ) - rDlg.DisableRange( PRINTDIALOG_RANGE ); -} - //==================================================================== class SfxDialogExecutor_Impl @@ -392,7 +367,6 @@ class SfxDialogExecutor_Impl { private: SfxViewShell* _pViewSh; - PrintDialog* _pPrintParent; PrinterSetupDialog* _pSetupParent; SfxItemSet* _pOptions; sal_Bool _bModified; @@ -401,7 +375,6 @@ private: DECL_LINK( Execute, void * ); public: - SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent ); SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent ); ~SfxDialogExecutor_Impl() { delete _pOptions; } @@ -412,22 +385,9 @@ public: //-------------------------------------------------------------------- -SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrintDialog* pParent ) : - - _pViewSh ( pViewSh ), - _pPrintParent ( pParent ), - _pSetupParent ( NULL ), - _pOptions ( NULL ), - _bModified ( sal_False ), - _bHelpDisabled ( sal_False ) - -{ -} - SfxDialogExecutor_Impl::SfxDialogExecutor_Impl( SfxViewShell* pViewSh, PrinterSetupDialog* pParent ) : _pViewSh ( pViewSh ), - _pPrintParent ( NULL ), _pSetupParent ( pParent ), _pOptions ( NULL ), _bModified ( sal_False ), @@ -443,27 +403,13 @@ IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG ) // Options lokal merken if ( !_pOptions ) { - DBG_ASSERT( _pPrintParent || _pSetupParent, "no dialog parent" ); - if( _pPrintParent ) - _pOptions = ( (SfxPrinter*)_pPrintParent->GetPrinter() )->GetOptions().Clone(); - else if( _pSetupParent ) + DBG_ASSERT( _pSetupParent, "no dialog parent" ); + if( _pSetupParent ) _pOptions = ( (SfxPrinter*)_pSetupParent->GetPrinter() )->GetOptions().Clone(); } - if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() ) - { - SfxItemState eState = _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET ); - if ( eState != SFX_ITEM_UNKNOWN ) - { - PrintSheetRange eRange = _pPrintParent->GetCheckedSheetRange(); - BOOL bValue = ( PRINTSHEETS_ALL != eRange ); - _pOptions->Put( SfxBoolItem( SID_PRINT_SELECTEDSHEET, bValue ) ); - } - } - // Dialog ausf"uhren - SfxPrintOptionsDialog* pDlg = new SfxPrintOptionsDialog( _pPrintParent ? static_cast<Window*>(_pPrintParent) - : static_cast<Window*>(_pSetupParent), + SfxPrintOptionsDialog* pDlg = new SfxPrintOptionsDialog( static_cast<Window*>(_pSetupParent), _pViewSh, _pOptions ); if ( _bHelpDisabled ) pDlg->DisableHelp(); @@ -472,15 +418,6 @@ IMPL_LINK( SfxDialogExecutor_Impl, Execute, void *, EMPTYARG ) delete _pOptions; _pOptions = pDlg->GetOptions().Clone(); - if ( _pOptions && _pPrintParent && _pPrintParent->IsSheetRangeAvailable() ) - { - const SfxPoolItem* pItem; - if ( SFX_ITEM_SET == _pOptions->GetItemState( SID_PRINT_SELECTEDSHEET, FALSE , &pItem ) ) - { - _pPrintParent->CheckSheetRange( ( (const SfxBoolItem*)pItem )->GetValue() - ? PRINTSHEETS_SELECTED_SHEETS : PRINTSHEETS_ALL ); - } - } } delete pDlg; @@ -687,7 +624,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) USHORT nDialogRet = RET_CANCEL; // BOOL bCollate=FALSE; SfxPrinter* pPrinter = 0; - PrintDialog* pPrintDlg = 0; SfxDialogExecutor_Impl* pExecutor = 0; bool bSilent = false; BOOL bIsAPI = rReq.GetArgs() && rReq.GetArgs()->Count(); @@ -895,16 +831,12 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) // forget new printer, it was taken over (as pPrinter) or deleted pDlgPrinter = NULL; - /* Now lets reset the Dialog printer, since its freed */ - if (pPrintDlg) - pPrintDlg->SetPrinter (pPrinter); } else { // PrinterDialog is used to transfer information on printing, // so it will only be deleted here if dialog was cancelled DELETEZ( pDlgPrinter ); - DELETEZ( pPrintDlg ); rReq.Ignore(); if ( SID_PRINTDOC == nId ) rReq.SetReturnValue(SfxBoolItem(0,FALSE)); @@ -923,80 +855,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) //-------------------------------------------------------------------- -PrintDialog* SfxViewShell::CreatePrintDialog( Window* /*pParent*/ ) - -/* [Beschreibung] - - Diese Methode kann "uberladen werden, um einen speziellen PrintDialog - zu erzeugen. Dies ist z.B. notwendig wenn spezielle <StarView> Features - wie drucken von Seitenbereichen. -*/ - -{ - #if 0 - PrintDialog *pDlg = new PrintDialog( pParent, false ); - pDlg->SetFirstPage( 1 ); - pDlg->SetLastPage( 9999 ); - pDlg->EnableCollate(); - return pDlg; - #else - return NULL; - #endif -} - -//-------------------------------------------------------------------- - -void SfxViewShell::PreparePrint( PrintDialog * ) -{ -} - -//-------------------------------------------------------------------- - - -ErrCode SfxViewShell::DoPrint( SfxPrinter* /*pPrinter*/, - PrintDialog* /*pPrintDlg*/, - BOOL /*bSilent*/, BOOL /*bIsAPI*/ ) -{ - #if 0 - // Printer-Dialogbox waehrend des Ausdrucks mu\s schon vor - // StartJob erzeugt werden, da SV bei einem Quit-Event h"angt - SfxPrintProgress *pProgress = new SfxPrintProgress( this, !bSilent ); - SfxPrinter *pDocPrinter = GetPrinter(TRUE); - if ( !pPrinter ) - pPrinter = pDocPrinter; - else if ( pDocPrinter != pPrinter ) - { - pProgress->RestoreOnEndPrint( pDocPrinter->Clone() ); - SetPrinter( pPrinter, SFX_PRINTER_PRINTER ); - } - pProgress->SetWaitMode(FALSE); - - // Drucker starten - PreparePrint( pPrintDlg ); - SfxObjectShell *pObjShell = GetViewFrame()->GetObjectShell(); - if ( pPrinter->StartJob(pObjShell->GetTitle(0)) ) - { - // Drucken - Print( *pProgress, bIsAPI, pPrintDlg ); - pProgress->Stop(); - pProgress->DeleteOnEndPrint(); - pPrinter->EndJob(); - } - else - { - // Printer konnte nicht gestartet werden - delete pProgress; - } - - return pPrinter->GetError(); - #else - DBG_ERROR( "DoPrint called, dead code !" ); - return ERRCODE_IO_NOTSUPPORTED; - #endif -} - -//-------------------------------------------------------------------- - BOOL SfxViewShell::IsPrinterLocked() const { return pImp->m_nPrinterLocks > 0; @@ -1026,13 +884,6 @@ void SfxViewShell::LockPrinter( BOOL bLock) //-------------------------------------------------------------------- -USHORT SfxViewShell::Print( SfxProgress& /*rProgress*/, BOOL /*bIsAPI*/, PrintDialog* /*pDlg*/ ) -{ - return 0; -} - -//-------------------------------------------------------------------- - SfxPrinter* SfxViewShell::GetPrinter( BOOL /*bCreate*/ ) { return 0; |