diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-08 12:00:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-09 05:46:03 +0000 |
commit | afc755fa61cfd9645c4ed2507bdc3a06b721ed5c (patch) | |
tree | 927b4fa1f1deaf22362c13e43d16fd716f29e630 | |
parent | 026345eeb2aa9fca02bc055f28ebd34abd7ad680 (diff) |
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>
-rwxr-xr-x | compilerplugins/clang/unusedenumconstants.py | 3 | ||||
-rw-r--r-- | include/vcl/bitmap.hxx | 15 | ||||
-rw-r--r-- | include/vcl/commandevent.hxx | 1 | ||||
-rw-r--r-- | include/vcl/gdimtf.hxx | 5 | ||||
-rw-r--r-- | include/vcl/print.hxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 3 | ||||
-rw-r--r-- | vcl/opengl/scale.cxx | 3 | ||||
-rw-r--r-- | vcl/qa/cppunit/graphicfilter/filters-test.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 14 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 14 | ||||
-rw-r--r-- | vcl/source/gdi/print.cxx | 8 |
11 files changed, 22 insertions, 52 deletions
diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py index 9acbd49dd116..340d0b931c1b 100755 --- a/compilerplugins/clang/unusedenumconstants.py +++ b/compilerplugins/clang/unusedenumconstants.py @@ -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", diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 9f99467dbd5d..217a6f4f20a4 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -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 }; diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx index 8d9496de97cb..d93cd3523d77 100644 --- a/include/vcl/commandevent.hxx +++ b/include/vcl/commandevent.hxx @@ -318,7 +318,6 @@ enum class CommandEventId CursorPos = 11, PasteSelection = 12, ModKeyChange = 13, - HangulHanjaConversion = 14, InputLanguageChange = 15, ShowDialog = 16, Media = 17, diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx index d8b8d16e0e60..fed5eb7534fd 100644 --- a/include/vcl/gdimtf.hxx +++ b/include/vcl/gdimtf.hxx @@ -45,9 +45,8 @@ class Gradient; enum class MtfConversion { - NONE = 0, - N1BitThreshold = 1, - N8BitGreys = 2 + N1BitThreshold, + N8BitGreys }; diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index 77e3034bb1c9..24fd13bafa61 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -52,10 +52,10 @@ namespace vcl { enum class PrinterSupport { - SetOrientation, SetPaperBin, + SetOrientation, SetPaperSize, SetPaper, - Copy, CollateCopy, - SetupDialog, Fax, Pdf + CollateCopy, + SetupDialog }; diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 0a5762cd83f8..37c171297c4c 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -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; diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx index 3ffb6a34dd45..a6fa42ca543e 100644 --- a/vcl/opengl/scale.cxx +++ b/vcl/opengl/scale.cxx @@ -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 ) diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx index b478bde6427a..ab615330005e 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx @@ -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 ); diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 93c4ad94312b..b59543a20e17 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -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 (!)"); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index e70f4d22769c..1bbeba443760 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -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 ) diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 74fff853ede8..91fbd64ca29d 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -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; |