loplugin:unusedenumconstants read-only constants in vcl (2)

Change-Id: Ia3da23e0ef2fa710403745bd11255ed001516da4
Reviewed-on: https://gerrit.libreoffice.org/34020
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2017-02-08 12:00:27 +02:00
parent 026345eeb2
commit afc755fa61
11 changed files with 22 additions and 52 deletions

View File

@@ -103,6 +103,7 @@ for d in definitionSet:
"vcl/source/filter/wmf/winmtf.hxx",
"vcl/source/filter/sgvmain.hxx",
"vcl/source/filter/jpeg/transupp.h",
"include/vcl/bitmapex.hxx", # TransparentType
# unit test code
"cppu/source/uno/check.cxx",
# general weird nonsense going on
@@ -121,6 +122,7 @@ for d in definitionSet:
"vcl/inc/salwtype.hxx",
"include/vcl/svapp.hxx",
"include/vcl/salbtype.hxx",
"include/vcl/commandevent.hxx", # CommandEvent, MediaCommand, ShowDialogId
# must match some other enum
"include/editeng/bulletitem.hxx",
"include/editeng/svxenum.hxx",
@@ -130,6 +132,7 @@ for d in definitionSet:
"include/svl/nfkeytab.hx",
"include/svl/zforlist.hxx",
"include/svtools/svtabbx.hxx",
"include/vcl/print.hxx", # NupOrderType, from UI combobox
# represents constants from an external API
"opencl/inc/opencl_device_selection.h",
"vcl/inc/sft.hxx",

View File

@@ -44,18 +44,15 @@ namespace o3tl
enum class BmpScaleFlag
{
NONE = 0,
// Try to preferably use these.
Default = 1,
Fast = 2,
BestQuality = 3,
Fast,
BestQuality,
// Specific algorithms, use only if you really need to.
Interpolate = 4,
Super = 5,
Lanczos = 6,
BiCubic = 7,
BiLinear = 8,
Box = 9,
Interpolate,
Lanczos,
BiCubic,
BiLinear
};

View File

@@ -318,7 +318,6 @@ enum class CommandEventId
CursorPos = 11,
PasteSelection = 12,
ModKeyChange = 13,
HangulHanjaConversion = 14,
InputLanguageChange = 15,
ShowDialog = 16,
Media = 17,

View File

@@ -45,9 +45,8 @@ class Gradient;
enum class MtfConversion
{
NONE = 0,
N1BitThreshold = 1,
N8BitGreys = 2
N1BitThreshold,
N8BitGreys
};

View File

@@ -52,10 +52,10 @@ namespace vcl {
enum class PrinterSupport
{
SetOrientation, SetPaperBin,
SetOrientation,
SetPaperSize, SetPaper,
Copy, CollateCopy,
SetupDialog, Fax, Pdf
CollateCopy,
SetupDialog
};

View File

@@ -5524,9 +5524,6 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
}
}
break;
case CommandEventId::HangulHanjaConversion :
GetView().GetViewFrame()->GetDispatcher()->Execute(SID_HANGUL_HANJA_CONVERSION);
break;
case CommandEventId::InputLanguageChange :
// i#42732 - update state of fontname if input language changes
g_bInputLanguageSwitched = true;

View File

@@ -350,7 +350,7 @@ bool OpenGLSalBitmap::ImplScale( const double& rScaleX, const double& rScaleY, B
{
return ImplScaleFilter( xContext, rScaleX, rScaleY, GL_LINEAR );
}
else if( nScaleFlag == BmpScaleFlag::Super || nScaleFlag == BmpScaleFlag::Default )
else if( nScaleFlag == BmpScaleFlag::Default )
{
const Lanczos3Kernel aKernel;
@@ -381,7 +381,6 @@ bool OpenGLSalBitmap::Scale( const double& rScaleX, const double& rScaleY, BmpSc
if( nScaleFlag == BmpScaleFlag::Fast ||
nScaleFlag == BmpScaleFlag::BiLinear ||
nScaleFlag == BmpScaleFlag::Super ||
nScaleFlag == BmpScaleFlag::Lanczos ||
nScaleFlag == BmpScaleFlag::Default ||
nScaleFlag == BmpScaleFlag::BestQuality )

View File

@@ -62,7 +62,7 @@ bool VclFiltersTest::load(const OUString &,
void VclFiltersTest::testScaling()
{
for (BmpScaleFlag i = BmpScaleFlag::Default; i <= BmpScaleFlag::Box; i = (BmpScaleFlag)((int)i + 1))
for (BmpScaleFlag i = BmpScaleFlag::Default; i <= BmpScaleFlag::BiLinear; i = (BmpScaleFlag)((int)i + 1))
{
Bitmap aBitmap( Size( 413, 409 ), 24 );
BitmapEx aBitmapEx( aBitmap );

View File

@@ -922,18 +922,13 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag n
//just use the fast scale rather than attempting to count unique colors in
//the other converters and pass all the info down through
//Bitmap::ImplMakeMono
if (nStartCount == 1 && nScaleFlag != BmpScaleFlag::NONE)
if (nStartCount == 1)
nScaleFlag = BmpScaleFlag::Fast;
bool bRetval(false);
switch(nScaleFlag)
{
case BmpScaleFlag::NONE :
{
bRetval = false;
break;
}
case BmpScaleFlag::Fast :
{
bRetval = ImplScaleFast( rScaleX, rScaleY );
@@ -944,7 +939,6 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag n
bRetval = ImplScaleInterpolate( rScaleX, rScaleY );
break;
}
case BmpScaleFlag::Super:
case BmpScaleFlag::Default:
{
if (GetSizePixel().Width() < 2 || GetSizePixel().Height() < 2)
@@ -978,12 +972,6 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag n
bRetval = aScaleConvolution.filter(*this);
break;
}
case BmpScaleFlag::Box :
{
vcl::BitmapScaleConvolution aScaleConvolution(rScaleX, rScaleY, vcl::ConvolutionKernelType::Box);
bRetval = aScaleConvolution.filter(*this);
break;
}
}
OSL_ENSURE(!bRetval || nStartCount == GetBitCount(), "Bitmap::Scale has changed the ColorDepth, this should *not* happen (!)");

View File

@@ -2190,17 +2190,13 @@ void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
void GDIMetaFile::Convert( MtfConversion eConversion )
{
// nothing to do? => return quickly
if( eConversion != MtfConversion::NONE )
{
ImplColConvertParam aColParam;
ImplBmpConvertParam aBmpParam;
ImplColConvertParam aColParam;
ImplBmpConvertParam aBmpParam;
aColParam.eConversion = eConversion;
aBmpParam.eConversion = ( MtfConversion::N1BitThreshold == eConversion ) ? BMP_CONVERSION_1BIT_THRESHOLD : BMP_CONVERSION_8BIT_GREYS;
aColParam.eConversion = eConversion;
aBmpParam.eConversion = ( MtfConversion::N1BitThreshold == eConversion ) ? BMP_CONVERSION_1BIT_THRESHOLD : BMP_CONVERSION_8BIT_GREYS;
ImplExchangeColors( ImplColConvertFnc, &aColParam, ImplBmpConvertFnc, &aBmpParam );
}
ImplExchangeColors( ImplColConvertFnc, &aColParam, ImplBmpConvertFnc, &aBmpParam );
}
void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount )

View File

@@ -1022,22 +1022,14 @@ bool Printer::HasSupport( PrinterSupport eFeature ) const
{
case PrinterSupport::SetOrientation:
return GetCapabilities( PrinterCapType::SetOrientation ) != 0;
case PrinterSupport::SetPaperBin:
return GetCapabilities( PrinterCapType::SetPaperBin ) != 0;
case PrinterSupport::SetPaperSize:
return GetCapabilities( PrinterCapType::SetPaperSize ) != 0;
case PrinterSupport::SetPaper:
return GetCapabilities( PrinterCapType::SetPaper ) != 0;
case PrinterSupport::Copy:
return (GetCapabilities( PrinterCapType::Copies ) != 0);
case PrinterSupport::CollateCopy:
return (GetCapabilities( PrinterCapType::CollateCopies ) != 0);
case PrinterSupport::SetupDialog:
return GetCapabilities( PrinterCapType::SupportDialog ) != 0;
case PrinterSupport::Fax:
return GetCapabilities( PrinterCapType::Fax ) != 0;
case PrinterSupport::Pdf:
return GetCapabilities( PrinterCapType::PDF ) != 0;
}
return true;