[Libreoffice-commits] core.git: compilerplugins/clang include/vcl sw/source vcl/opengl vcl/qa vcl/source
Noel Grandin
noel.grandin at collabora.co.uk
Thu Feb 9 05:46:40 UTC 2017
compilerplugins/clang/unusedenumconstants.py | 3 +++
include/vcl/bitmap.hxx | 15 ++++++---------
include/vcl/commandevent.hxx | 1 -
include/vcl/gdimtf.hxx | 5 ++---
include/vcl/print.hxx | 6 +++---
sw/source/uibase/docvw/edtwin.cxx | 3 ---
vcl/opengl/scale.cxx | 3 +--
vcl/qa/cppunit/graphicfilter/filters-test.cxx | 2 +-
vcl/source/gdi/bitmap3.cxx | 14 +-------------
vcl/source/gdi/gdimtf.cxx | 14 +++++---------
vcl/source/gdi/print.cxx | 8 --------
11 files changed, 22 insertions(+), 52 deletions(-)
New commits:
commit afc755fa61cfd9645c4ed2507bdc3a06b721ed5c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Wed Feb 8 12:00:27 2017 +0200
loplugin:unusedenumconstants read-only constants in vcl (2)
Change-Id: Ia3da23e0ef2fa710403745bd11255ed001516da4
Reviewed-on: https://gerrit.libreoffice.org/34020
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index 9acbd49..340d0b9 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 9f99467..217a6f4 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 8d9496d..d93cd35 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 d8b8d16..fed5eb7 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 77e3034..24fd13b 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 0a5762c..37c1712 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 3ffb6a3..a6fa42c 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 b478bde..ab61533 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 93c4ad9..b59543a 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 e70f4d22..1bbeba4 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 74fff85..91fbd64 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;
More information about the Libreoffice-commits
mailing list