From 7303928aa8e013c58c68e661155196b51f199b46 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 4 Nov 2010 18:49:17 +0100 Subject: vcl117: #i115056# remove now unused svtools PrintDialog --- sfx2/source/view/printer.cxx | 75 ++++---------------------------------------- 1 file changed, 6 insertions(+), 69 deletions(-) (limited to 'sfx2/source/view/printer.cxx') diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 46a96bafab9a..fb4b93ae8475 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -337,51 +336,22 @@ 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; + OSL_ENSURE( 0, "dead code !" ); } //-------------------------------------------------------------------- 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; + OSL_ENSURE( 0, "dead code !" ); } //-------------------------------------------------------------------- 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; + OSL_ENSURE( 0, "dead code !" ); + return TRUE; } //-------------------------------------------------------------------- @@ -484,41 +454,8 @@ const SfxFont* SfxPrinter::GetFontByName( const String &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; + OSL_ENSURE( 0, "dead code !" ); + return FALSE; } //-------------------------------------------------------------------- -- cgit From 5adb4c0572ebb341a8db83888181b13a08704c7d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 5 Nov 2010 11:17:34 +0100 Subject: fix warnings --- sfx2/source/view/printer.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sfx2/source/view/printer.cxx') diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index fb4b93ae8475..fb8f60241b8e 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -334,21 +334,21 @@ void SfxPrinter::SetOptions( const SfxItemSet &rNewOptions ) //-------------------------------------------------------------------- -void SfxPrinter::EnableRange( USHORT nRange ) +void SfxPrinter::EnableRange( USHORT ) { OSL_ENSURE( 0, "dead code !" ); } //-------------------------------------------------------------------- -void SfxPrinter::DisableRange( USHORT nRange ) +void SfxPrinter::DisableRange( USHORT ) { OSL_ENSURE( 0, "dead code !" ); } //-------------------------------------------------------------------- -BOOL SfxPrinter::IsRangeEnabled( USHORT nRange ) const +BOOL SfxPrinter::IsRangeEnabled( USHORT ) const { OSL_ENSURE( 0, "dead code !" ); return TRUE; @@ -452,7 +452,7 @@ const SfxFont* SfxPrinter::GetFontByName( const String &rFontName ) //-------------------------------------------------------------------- -BOOL SfxPrinter::InitJob( Window* pUIParent, BOOL bAskAboutTransparentObjects ) +BOOL SfxPrinter::InitJob( Window*, BOOL ) { OSL_ENSURE( 0, "dead code !" ); return FALSE; -- cgit From 1fc75ad6800275b23242e0b82e52dc2327cf16b3 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 8 Nov 2010 14:43:10 +0100 Subject: vcl117: #i115477# remove unused methods --- sfx2/source/view/printer.cxx | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'sfx2/source/view/printer.cxx') diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index fb8f60241b8e..243e3c508966 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -334,28 +334,6 @@ void SfxPrinter::SetOptions( const SfxItemSet &rNewOptions ) //-------------------------------------------------------------------- -void SfxPrinter::EnableRange( USHORT ) -{ - OSL_ENSURE( 0, "dead code !" ); -} - -//-------------------------------------------------------------------- - -void SfxPrinter::DisableRange( USHORT ) -{ - OSL_ENSURE( 0, "dead code !" ); -} - -//-------------------------------------------------------------------- - -BOOL SfxPrinter::IsRangeEnabled( USHORT ) const -{ - OSL_ENSURE( 0, "dead code !" ); - return TRUE; -} - -//-------------------------------------------------------------------- - SV_IMPL_PTRARR(SfxFontArr_Impl,SfxFont*) //-------------------------------------------------------------------- @@ -452,14 +430,6 @@ const SfxFont* SfxPrinter::GetFontByName( const String &rFontName ) //-------------------------------------------------------------------- -BOOL SfxPrinter::InitJob( Window*, BOOL ) -{ - OSL_ENSURE( 0, "dead code !" ); - return FALSE; -} - -//-------------------------------------------------------------------- - SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent, SfxViewShell *pViewShell, const SfxItemSet *pSet ) : -- cgit From d6c96ba8a0fd7ef324cd40fb2525ef15bfb23bdf Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 9 Nov 2010 15:20:35 +0100 Subject: vcl117: #i115477# clean up unused methods --- sfx2/source/view/printer.cxx | 221 +------------------------------------------ 1 file changed, 1 insertion(+), 220 deletions(-) (limited to 'sfx2/source/view/printer.cxx') diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 243e3c508966..e446b24a1d7a 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -46,54 +46,23 @@ #include "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; @@ -102,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 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); -} - -//-------------------------------------------------------------------- - SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent, SfxViewShell *pViewShell, const SfxItemSet *pSet ) : -- cgit