Convert printer enums to scoped enums

Change-Id: Ic0f9d57181809b3fef3abbad462456fc2d5ced55
Reviewed-on: https://gerrit.libreoffice.org/25719
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin
2016-05-31 14:18:10 +02:00
committed by Noel Grandin
parent b860b73f2b
commit 76cacf1a60
5 changed files with 26 additions and 26 deletions

View File

@@ -85,25 +85,25 @@ public:
};
enum PrinterTransparencyMode
enum class PrinterTransparencyMode
{
PRINTER_TRANSPARENCY_AUTO = 0,
PRINTER_TRANSPARENCY_NONE = 1
Auto = 0,
NONE = 1
};
enum PrinterGradientMode
enum class PrinterGradientMode
{
PRINTER_GRADIENT_STRIPES = 0,
PRINTER_GRADIENT_COLOR = 1
Stripes = 0,
Color = 1
};
enum PrinterBitmapMode
enum class PrinterBitmapMode
{
PRINTER_BITMAP_OPTIMAL = 0,
PRINTER_BITMAP_NORMAL = 1,
PRINTER_BITMAP_RESOLUTION = 2
Optimal = 0,
Normal = 1,
Resolution = 2
};

View File

@@ -197,14 +197,14 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCu
{
m_pReduceTransparencyCB->Check( pCurrentOptions->IsReduceTransparency() );
if( pCurrentOptions->GetReducedTransparencyMode() == PRINTER_TRANSPARENCY_AUTO )
if( pCurrentOptions->GetReducedTransparencyMode() == PrinterTransparencyMode::Auto )
m_pReduceTransparencyAutoRB->Check();
else
m_pReduceTransparencyNoneRB->Check( );
m_pReduceGradientsCB->Check( pCurrentOptions->IsReduceGradients() );
if( pCurrentOptions->GetReducedGradientMode() == PRINTER_GRADIENT_STRIPES )
if( pCurrentOptions->GetReducedGradientMode() == PrinterGradientMode::Stripes )
m_pReduceGradientsStripesRB->Check();
else
m_pReduceGradientsColorRB->Check();
@@ -213,9 +213,9 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCu
m_pReduceBitmapsCB->Check( pCurrentOptions->IsReduceBitmaps() );
if( pCurrentOptions->GetReducedBitmapMode() == PRINTER_BITMAP_OPTIMAL )
if( pCurrentOptions->GetReducedBitmapMode() == PrinterBitmapMode::Optimal )
m_pReduceBitmapsOptimalRB->Check();
else if( pCurrentOptions->GetReducedBitmapMode() == PRINTER_BITMAP_NORMAL )
else if( pCurrentOptions->GetReducedBitmapMode() == PrinterBitmapMode::Normal )
m_pReduceBitmapsNormalRB->Check();
else
m_pReduceBitmapsResolutionRB->Check();
@@ -250,13 +250,13 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCu
void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOptions )
{
pCurrentOptions->SetReduceTransparency( m_pReduceTransparencyCB->IsChecked() );
pCurrentOptions->SetReducedTransparencyMode( m_pReduceTransparencyAutoRB->IsChecked() ? PRINTER_TRANSPARENCY_AUTO : PRINTER_TRANSPARENCY_NONE );
pCurrentOptions->SetReducedTransparencyMode( m_pReduceTransparencyAutoRB->IsChecked() ? PrinterTransparencyMode::Auto : PrinterTransparencyMode::NONE );
pCurrentOptions->SetReduceGradients( m_pReduceGradientsCB->IsChecked() );
pCurrentOptions->SetReducedGradientMode( m_pReduceGradientsStripesRB->IsChecked() ? PRINTER_GRADIENT_STRIPES : PRINTER_GRADIENT_COLOR );
pCurrentOptions->SetReducedGradientMode( m_pReduceGradientsStripesRB->IsChecked() ? PrinterGradientMode::Stripes : PrinterGradientMode::Color );
pCurrentOptions->SetReducedGradientStepCount( (sal_uInt16) m_pReduceGradientsStepCountNF->GetValue() );
pCurrentOptions->SetReduceBitmaps( m_pReduceBitmapsCB->IsChecked() );
pCurrentOptions->SetReducedBitmapMode( m_pReduceBitmapsOptimalRB->IsChecked() ? PRINTER_BITMAP_OPTIMAL :
( m_pReduceBitmapsNormalRB->IsChecked() ? PRINTER_BITMAP_NORMAL : PRINTER_BITMAP_RESOLUTION ) );
pCurrentOptions->SetReducedBitmapMode( m_pReduceBitmapsOptimalRB->IsChecked() ? PrinterBitmapMode::Optimal :
( m_pReduceBitmapsNormalRB->IsChecked() ? PrinterBitmapMode::Normal : PrinterBitmapMode::Resolution ) );
pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ std::min<sal_uInt16>( m_pReduceBitmapsResolutionLB->GetSelectEntryPos(),
SAL_N_ELEMENTS(aDPIArray) - 1 ) ] );
pCurrentOptions->SetReducedBitmapIncludesTransparency( m_pReduceBitmapsTransparencyCB->IsChecked() );

View File

@@ -88,12 +88,12 @@ void ImplUpdateJobSetupPaper( JobSetup& rJobSetup )
// PrinterOptions
PrinterOptions::PrinterOptions() :
mbReduceTransparency( false ),
meReducedTransparencyMode( PRINTER_TRANSPARENCY_AUTO ),
meReducedTransparencyMode( PrinterTransparencyMode::Auto ),
mbReduceGradients( false ),
meReducedGradientsMode( PRINTER_GRADIENT_STRIPES ),
meReducedGradientsMode( PrinterGradientMode::Stripes ),
mnReducedGradientStepCount( 64 ),
mbReduceBitmaps( false ),
meReducedBitmapMode( PRINTER_BITMAP_NORMAL ),
meReducedBitmapMode( PrinterBitmapMode::Normal ),
mnReducedBitmapResolution( 200 ),
mbReducedBitmapsIncludeTransparency( true ),
mbConvertToGreyscales( false ),

View File

@@ -1346,7 +1346,7 @@ void Printer::DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const
if( rPrinterOptions.IsReduceGradients() )
{
if( PRINTER_GRADIENT_STRIPES == rPrinterOptions.GetReducedGradientMode() )
if( PrinterGradientMode::Stripes == rPrinterOptions.GetReducedGradientMode() )
{
if( !rGradient.GetSteps() || ( rGradient.GetSteps() > rPrinterOptions.GetReducedGradientStepCount() ) )
{

View File

@@ -1215,12 +1215,12 @@ DrawModeFlags PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMe
if( rPrinterOptions.IsReduceBitmaps() )
{
// calculate maximum resolution for bitmap graphics
if( PRINTER_BITMAP_OPTIMAL == rPrinterOptions.GetReducedBitmapMode() )
if( PrinterBitmapMode::Optimal == rPrinterOptions.GetReducedBitmapMode() )
{
nMaxBmpDPIX = std::min( sal_Int32(OPTIMAL_BMP_RESOLUTION), nMaxBmpDPIX );
nMaxBmpDPIY = std::min( sal_Int32(OPTIMAL_BMP_RESOLUTION), nMaxBmpDPIY );
}
else if( PRINTER_BITMAP_NORMAL == rPrinterOptions.GetReducedBitmapMode() )
else if( PrinterBitmapMode::Normal == rPrinterOptions.GetReducedBitmapMode() )
{
nMaxBmpDPIX = std::min( sal_Int32(NORMAL_BMP_RESOLUTION), nMaxBmpDPIX );
nMaxBmpDPIY = std::min( sal_Int32(NORMAL_BMP_RESOLUTION), nMaxBmpDPIY );
@@ -1241,7 +1241,7 @@ DrawModeFlags PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMe
}
// disable transparency output
if( rPrinterOptions.IsReduceTransparency() && ( PRINTER_TRANSPARENCY_NONE == rPrinterOptions.GetReducedTransparencyMode() ) )
if( rPrinterOptions.IsReduceTransparency() && ( PrinterTransparencyMode::NONE == rPrinterOptions.GetReducedTransparencyMode() ) )
{
mpImplData->mxPrinter->SetDrawMode( mpImplData->mxPrinter->GetDrawMode() | DrawModeFlags::NoTransparency );
}
@@ -1256,7 +1256,7 @@ DrawModeFlags PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMe
}
mpImplData->mxPrinter->RemoveTransparenciesFromMetaFile( i_rIn, o_rOut, nMaxBmpDPIX, nMaxBmpDPIY,
rPrinterOptions.IsReduceTransparency(),
rPrinterOptions.GetReducedTransparencyMode() == PRINTER_TRANSPARENCY_AUTO,
rPrinterOptions.GetReducedTransparencyMode() == PrinterTransparencyMode::Auto,
rPrinterOptions.IsReduceBitmaps() && rPrinterOptions.IsReducedBitmapIncludesTransparency(),
aBg
);