loplugin:unusedenumvalues

Change-Id: Icf17f936ce6d07d0e152252833c8645cf9b1163b
Reviewed-on: https://gerrit.libreoffice.org/28942
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2016-09-16 16:08:56 +02:00
parent 17d7ac5c1a
commit e592877844
32 changed files with 24 additions and 277 deletions

View File

@ -15,9 +15,11 @@ excludedSourceFiles = set([
"sw/inc/toxe.hxx",
"sw/inc/poolfmt.hxx",
"sw/inc/hintids.hxx",
"vcl/inc/unx/XIM.h",
])
excludedTypes = set([
"SwVarFormat", "RES_FIELDS", "SwFillOrder", "SwIoDetect", "SwDocumentSettingsPropertyHandles"
"SwVarFormat", "RES_FIELDS", "SwFillOrder", "SwIoDetect", "SwDocumentSettingsPropertyHandles",
"SalGenericDataType", "SwDateSubFormat", "XclFutureRecType", "ds_status", "MediaCommand",
])
# clang does not always use exactly the same numbers in the type-parameter vars it generates
@ -54,11 +56,10 @@ for k, definitions in sourceLocationToDefinitionMap.iteritems():
untouchedSet = set()
for d in definitionSet:
clazz = d[0] + " " + d[1]
if clazz in exclusionSet:
continue
if d in touchSet:
continue
srcLoc = definitionToSourceLocationMap[d];
srcLoc = definitionToSourceLocationMap[d]
srcLocWithoutLineNo = srcLoc.split(":")[0]
# ignore external source code
if (srcLoc.startswith("external/")):
continue
@ -77,8 +78,12 @@ for d in definitionSet:
or srcLoc.startswith("include/typelib/")
or srcLoc.startswith("include/uno/")):
continue
if srcLoc in excludedSourceFiles or d[0] in excludedTypes:
if srcLocWithoutLineNo in excludedSourceFiles or d[0] in excludedTypes:
continue
# structure definitions
if srcLoc.startswith("lotuswordpro/"):
continue
# used in templates to find the last member of an enum
if d[1] == "LAST" or d[1].endswith("_END"):
continue

View File

@ -71,17 +71,6 @@ namespace o3tl
template<> struct typed_flags<BmpDitherFlags> : is_typed_flags<BmpDitherFlags, 0x07> {};
}
enum class BmpVectorizeFlags
{
Inner = 0x0001,
Outer = 0x0002,
ReduceEdges = 0x0004,
};
namespace o3tl
{
template<> struct typed_flags<BmpVectorizeFlags> : is_typed_flags<BmpVectorizeFlags, 0x07> {};
}
#define BMP_COL_TRANS Color( 252, 3, 251 )
enum BmpConversion

View File

@ -126,9 +126,7 @@ enum class GraphicFileFormat
WMF = 0x00f6,
SGV = 0x00f7,
EMF = 0x00f8,
SVG = 0x00f9,
MOV = 0x00fa,
XXX = 0xffff
SVG = 0x00f9
};

View File

@ -78,10 +78,6 @@ enum class ControlType {
// all parts like slider, buttons
Scrollbar = 60,
Slider = 65,
// Border around a group of related
// items, perhaps also displaying
// a label of identification
Groupbox = 70,
// A separator line
Fixedline = 80,
// A toolbar control with buttons and a grip
@ -220,7 +216,6 @@ enum class ControlState {
FOCUSED = 0x0002,
PRESSED = 0x0004,
ROLLOVER = 0x0008,
HIDDEN = 0x0010,
DEFAULT = 0x0020,
SELECTED = 0x0040,
DOUBLEBUFFERING = 0x4000, ///< Set when the control is painted using double-buffering via VirtualDevice.
@ -228,7 +223,7 @@ enum class ControlState {
};
namespace o3tl
{
template<> struct typed_flags<ControlState> : is_typed_flags<ControlState, 0xc07f> {};
template<> struct typed_flags<ControlState> : is_typed_flags<ControlState, 0xc06f> {};
}
class ControlCacheKey

View File

@ -42,55 +42,7 @@ enum
PROPERTY_ID_FETCHSIZE,
PROPERTY_ID_ESCAPEPROCESSING,
PROPERTY_ID_USEBOOKMARKS,
// Column
PROPERTY_ID_NAME,
PROPERTY_ID_TYPE,
PROPERTY_ID_TYPENAME,
PROPERTY_ID_PRECISION,
PROPERTY_ID_SCALE,
PROPERTY_ID_ISNULLABLE,
PROPERTY_ID_ISAUTOINCREMENT,
PROPERTY_ID_ISROWVERSION,
PROPERTY_ID_DESCRIPTION,
PROPERTY_ID_DEFAULTVALUE,
PROPERTY_ID_REFERENCEDTABLE,
PROPERTY_ID_UPDATERULE,
PROPERTY_ID_DELETERULE,
PROPERTY_ID_CATALOG,
PROPERTY_ID_ISUNIQUE,
PROPERTY_ID_ISPRIMARYKEYINDEX,
PROPERTY_ID_ISCLUSTERED,
PROPERTY_ID_ISASCENDING,
PROPERTY_ID_SCHEMANAME,
PROPERTY_ID_CATALOGNAME,
PROPERTY_ID_COMMAND,
PROPERTY_ID_CHECKOPTION,
PROPERTY_ID_PASSWORD,
PROPERTY_ID_RELATEDCOLUMN,
PROPERTY_ID_FUNCTION,
PROPERTY_ID_TABLENAME,
PROPERTY_ID_REALNAME,
PROPERTY_ID_DBASEPRECISIONCHANGED,
PROPERTY_ID_ISCURRENCY,
PROPERTY_ID_ISBOOKMARKABLE,
PROPERTY_ID_INVALID_INDEX,
PROPERTY_ID_ERRORMSG_SEQUENCE,
PROPERTY_ID_HY010,
PROPERTY_ID_HY0000,
PROPERTY_ID_DELIMITER,
PROPERTY_ID_FORMATKEY,
PROPERTY_ID_LOCALE,
PROPERTY_ID_IM001,
PROPERTY_ID_AUTOINCREMENTCREATION,
PROPERTY_ID_PRIVILEGES,
PROPERTY_ID_LAST
PROPERTY_ID_ISBOOKMARKABLE
};
}/* mysqlc */
}/* connectivity */

View File

@ -56,8 +56,7 @@ enum FormularCommand
FC_SIN,
FC_SQRT,
FC_TAN,
FC_VAL,
FC_LAST
FC_VAL
};
struct FormularCommandNameTable
{

View File

@ -28,8 +28,7 @@ enum ConditionType
{
thread_type_set,
thread_type_reset,
thread_type_wait,
thread_type_check
thread_type_wait
};
/** thread for testing Condition.

View File

@ -23,12 +23,6 @@
// has to be adjusted!
#define FADE_EFFECT_COUNT 57
enum FadeSpeed
{
FADE_SPEED_SLOW,
FADE_SPEED_MEDIUM,
FADE_SPEED_FAST
};
// has to be adjusted!
#define FADE_SPEED_COUNT 3

View File

@ -20,13 +20,6 @@
#ifndef INCLUDED_SD_INC_RESLTN_HXX
#define INCLUDED_SD_INC_RESLTN_HXX
enum PublishingResolution
{
RESOLUTION_HIGH,
RESOLUTION_MEDIUM,
RESOLUTION_LOW
};
enum PublishingFormat
{
FORMAT_GIF,

View File

@ -26,7 +26,6 @@
enum SdXMLFilterMode
{
SDXMLMODE_Normal, ///< standard load and save of the complete document
SDXMLMODE_Preview, ///< only for import, only the first draw page and its master page is loaded
SDXMLMODE_Organizer ///< only for import, only the styles are loaded
};

View File

@ -210,9 +210,6 @@ enum PPTExTextAttr
ParaAttr_TextOfs,
ParaAttr_BulletOfs,
ParaAttr_DefaultTab,
ParaAttr_AsianLB_1,
ParaAttr_AsianLB_2,
ParaAttr_AsianLB_3,
ParaAttr_BiDi,
CharAttr_Bold,
CharAttr_Italic,

View File

@ -1,48 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SD_SOURCE_UI_INC_SIDEBARPANELID_HXX
#define INCLUDED_SD_SOURCE_UI_INC_SIDEBARPANELID_HXX
namespace rtl
{
class OUString;
}
namespace sd { namespace sidebar {
/** List of top level panels that can be shown in the task pane.
*/
enum PanelId
{
PID_UNKNOWN,
PID_MASTER_PAGES_ALL,
PID_MASTER_PAGES_RECENT,
PID_MASTER_PAGES_USED,
PID_LAYOUT,
PID_TABLE_DESIGN,
PID_ANIMATION_SCHEMES,
PID_CUSTOM_ANIMATION,
PID_SLIDE_TRANSITION
};
} } // namespace sd::sidebar
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -83,8 +83,7 @@ public:
{
NormalMode,
MultiSelectionMode,
DragAndDropMode,
ButtonMode
DragAndDropMode
};
void SwitchToNormalMode();
void SwitchToDragAndDropMode(const Point& rMousePosition);

View File

@ -40,26 +40,13 @@ using ::sd::slidesorter::view::Layouter;
namespace sd { namespace slidesorter {
namespace {
enum Properties
{
PropertyDocumentSlides,
PropertyHighlightCurrentSlide,
PropertyShowSelection,
PropertyCenterSelection,
PropertySuspendPreviewUpdatesDuringFullScreenPresentation,
PropertyOrientationVertical
};
}
//===== SlideSorterService ==========================================================
SlideSorterService::SlideSorterService (const Reference<XComponentContext>& rxContext)
SlideSorterService::SlideSorterService()
: SlideSorterServiceInterfaceBase(m_aMutex),
mpSlideSorter(),
mxParentWindow()
{
(void)rxContext;
}
SlideSorterService::~SlideSorterService()
@ -473,10 +460,10 @@ void SlideSorterService::ThrowIfDisposed()
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
com_sun_star_comp_Draw_SlideSorter_get_implementation(css::uno::XComponentContext* context,
com_sun_star_comp_Draw_SlideSorter_get_implementation(css::uno::XComponentContext* /*context*/,
css::uno::Sequence<css::uno::Any> const &)
{
return cppu::acquire(new sd::slidesorter::SlideSorterService(context));
return cppu::acquire(new sd::slidesorter::SlideSorterService);
}

View File

@ -50,8 +50,7 @@ class SlideSorterService
public SlideSorterServiceInterfaceBase
{
public:
explicit SlideSorterService (
const css::uno::Reference<css::uno::XComponentContext>& rxContext);
explicit SlideSorterService();
virtual ~SlideSorterService() override;
SlideSorterService(const SlideSorterService&) = delete;
SlideSorterService& operator=(const SlideSorterService&) = delete;

View File

@ -40,8 +40,6 @@ enum FactoryId
{
SdDrawingDocumentFactoryId,
SdPresentationDocumentFactoryId,
ModuleControllerFactoryId,
};
typedef std::unordered_map<OUString, FactoryId, OUStringHash> FactoryMap;

View File

@ -55,7 +55,6 @@
#include "PresentationViewShell.hxx"
#include "FormShellManager.hxx"
#include "ToolBarManager.hxx"
#include "SidebarPanelId.hxx"
#include "Window.hxx"
#include "framework/ConfigurationController.hxx"
#include "DocumentRenderer.hxx"

View File

@ -41,7 +41,6 @@
#include "FrameView.hxx"
#include "DrawViewShell.hxx"
#include "ViewShellHint.hxx"
#include "SidebarPanelId.hxx"
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>

View File

@ -133,7 +133,6 @@ struct SfxChildWin_Impl
enum class SfxChildIdentifier
{
STATBAR,
OBJECTBAR,
DOCKINGWINDOW,
SPLITWINDOW

View File

@ -179,9 +179,7 @@ namespace svgio
SVGTokenText,
SVGTokenBaselineShift,
SVGTokenFlowRoot,
SVGTokenLast
SVGTokenFlowRoot
};
SVGToken StrToSVGToken(const OUString& rStr, bool bCaseIndependent);

View File

@ -43,8 +43,7 @@ public:
TYPE3_FONT = 1<<6, ///< PSType3 Postscript font
TYPE42_FONT = 1<<7, ///< PSType42 wrapper for an SFNT_TTF
ANY_SFNT = SFNT_TTF | SFNT_CFF,
ANY_TYPE1 = TYPE1_PFA | TYPE1_PFB,
ANY_FONT = 0xFF
ANY_TYPE1 = TYPE1_PFA | TYPE1_PFB
};
bool LoadFont( FontType eInFontType,

View File

@ -328,15 +328,9 @@ UInt32 AquaSalGraphics::getState( ControlState nState )
const bool bDrawActive = mpFrame == nullptr || [mpFrame->getNSWindow() isKeyWindow];
if( !(nState & ControlState::ENABLED) || ! bDrawActive )
{
if( ! (nState & ControlState::HIDDEN) )
return kThemeStateInactive;
else
return kThemeStateUnavailableInactive;
return kThemeStateInactive;
}
if( nState & ControlState::HIDDEN )
return kThemeStateUnavailable;
if( nState & ControlState::PRESSED )
return kThemeStatePressed;

View File

@ -38,11 +38,7 @@ enum Orientation {
};
enum Tag {
ORIENTATION = 0x0112,
X_RESOLUTION = 0x011a,
Y_RESOLUTION = 0x011b,
EXIF_OFFSET = 0x8769,
INTEROP_OFFSET = 0xa005
ORIENTATION = 0x0112
};
class Exif

View File

@ -97,62 +97,13 @@ enum class EmfPlusRecordType
{
Header = 0x4001,
EndOfFile = 0x4002,
Comment = 0x4003,
GetDC = 0x4004,
MultiFormatStart = 0x4005,
MultiFormatSection = 0x4006,
MultiFormatEnd = 0x4007,
Object = 0x4008,
Clear = 0x4009,
FillRects = 0x400A,
DrawRects = 0x400B,
FillPolygon = 0x400C,
DrawLines = 0x400D,
FillEllipse = 0x400E,
DrawEllipse = 0x400F,
FillPie = 0x4010,
DrawPie = 0x4011,
DrawArc = 0x4012,
FillRegion = 0x4013,
FillPath = 0x4014,
DrawPath = 0x4015,
FillClosedCurve = 0x4016,
DrawClosedCurve = 0x4017,
DrawCurve = 0x4018,
DrawBeziers = 0x4019,
DrawImage = 0x401A,
DrawImagePoints = 0x401B,
Drawstring = 0x401C,
SetRenderingOrigin = 0x401D,
SetAntiAliasMode = 0x401E,
SetTextRenderingHint = 0x401F,
SetTextContrast = 0x4020,
SetInterpolationMode = 0x4021,
SetPixelOffsetMode = 0x4022,
SetCompositingMode = 0x4023,
SetCompositingQuality = 0x4024,
Save = 0x4025,
Restore = 0x4026,
BeginContainer = 0x4027,
BeginContainerNoParams = 0x4028,
EndContainer = 0x4029,
SetWorldTransform = 0x402A,
ResetWorldTransform = 0x402B,
MultiplyWorldTransform = 0x402C,
TranslateWorldTransform = 0x402D,
ScaleWorldTransform = 0x402E,
RotateWorldTransform = 0x402F,
SetPageTransform = 0x4030,
ResetClip = 0x4031,
SetClipRect = 0x4032,
SetClipPath = 0x4033,
SetClipRegion = 0x4034,
OffsetClip = 0x4035,
DrawDriverstring = 0x4036,
StrokeFillPath = 0x4037,
SerializableObject = 0x4038,
SetTSGraphics = 0x4039,
SetTSClip = 0x403A
};
void EMFWriter::ImplBeginCommentRecord( sal_Int32 nCommentType )

View File

@ -73,7 +73,6 @@ enum class BkMode
enum class WMFRasterOp {
NONE = 0,
Black = 1,
MaskNotPen = 3,
Not = 6,
XorPen = 7,
Nop = 11,

View File

@ -105,7 +105,6 @@ QStyle::SFlags vclStateValue2SFlags( ControlState nState,
( (nState & ControlState::PRESSED)? QStyle::Style_Down: QStyle::Style_Raised ) |
( (nState & ControlState::SELECTED)? QStyle::Style_Selected : QStyle::Style_Default ) |
( (nState & ControlState::ROLLOVER)? QStyle::Style_MouseOver: QStyle::Style_Default );
//TODO ( (nState & ControlState::HIDDEN)? QStyle::Style_: QStyle::Style_Default ) |
switch ( aValue.getTristateVal() )
{
@ -1281,7 +1280,6 @@ bool KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
// no ControlType::TabBody for KDE
( (nType == ControlType::Scrollbar) && (nPart == ControlPart::Entire || nPart == ControlPart::DrawBackgroundHorz || nPart == ControlPart::DrawBackgroundVert) ) ||
( (nType == ControlType::Scrollbar) && (nPart == ControlPart::HasThreeButtons) ) || // TODO small optimization is possible here: return this only if the style really has 3 buttons
// ControlType::Groupbox not supported
// ControlType::Fixedline not supported
( (nType == ControlType::Toolbar) && (nPart == ControlPart::Entire ||
nPart == ControlPart::DrawBackgroundHorz || nPart == ControlPart::DrawBackgroundVert ||

View File

@ -92,7 +92,6 @@ bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par
case ControlType::Frame:
case ControlType::Scrollbar:
case ControlType::WindowBackground:
case ControlType::Groupbox:
case ControlType::Fixedline:
return true;
@ -481,12 +480,6 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
draw( QStyle::CC_SpinBox, &option, m_image.get(),
vclStateValue2StateFlag(nControlState, value) );
}
else if (type == ControlType::Groupbox)
{
QStyleOptionGroupBox option;
draw( QStyle::CC_GroupBox, &option, m_image.get(),
vclStateValue2StateFlag(nControlState, value) );
}
else if (type == ControlType::Radiobutton)
{
m_image->fill( Qt::transparent );

View File

@ -64,12 +64,6 @@ class StyleSheetTable;
class GraphicZOrderHelper;
class GraphicNamingHelper;
// different context types require different sprm handling (e.g. names)
enum SprmType
{
SPRM_DEFAULT,
SPRM_LIST
};
class DomainMapper : public LoggedProperties, public LoggedTable,
public BinaryObj, public LoggedStream
{

View File

@ -124,12 +124,6 @@ enum SchXMLPlotAreaAttrTokenMap
XML_TOK_PA_LIGHTING_MODE
};
enum SchXMLAutoStyleAttrMap
{
XML_TOK_AS_FAMILY,
XML_TOK_AS_NAME
};
enum SchXMLCellAttrMap
{
XML_TOK_CELL_VAL_TYPE,

View File

@ -61,11 +61,6 @@ enum SdXMLStylesElemTokenMap
XML_TOK_STYLES_PRESENTATION_PAGE_LAYOUT
};
enum SdXMLAutoStylesElemTokenMap
{
XML_TOK_AUTOSTYLES_STYLE
};
enum SdXMLMasterPageElemTokenMap
{
XML_TOK_MASTERPAGE_STYLE,
@ -100,20 +95,6 @@ enum SdXMLPageMasterStyleAttrTokenMap
XML_TOK_PAGEMASTERSTYLE_PAGE_ORIENTATION
};
enum SdXMLDocStyleAttrTokenMap
{
XML_TOK_DOCSTYLE_NAME,
XML_TOK_DOCSTYLE_FAMILY,
XML_TOK_DOCSTYLE_PARENT_STYLE_NAME,
XML_TOK_DOCSTYLE_AUTOMATIC
};
enum SdXMLDocStyleElemTokenMap
{
XML_TOK_DOCSTYLE_PROPERTIES,
XML_TOK_DOCSTYLE_PRESENTATION_PLACEHOLDER
};
enum SdXMLDrawPageAttrTokenMap
{
XML_TOK_DRAWPAGE_NAME,

View File

@ -44,7 +44,6 @@ enum XMLFamilyType
XML_FAMILY_TYPE_FILL_IMAGE,
XML_FAMILY_TYPE_STROKE_DASH,
XML_FAMILY_TYPE_MARKER,
XML_FAMILY_TYPE_PRESENTATION_PAGE_LAYOUT,
XML_FAMILY_TYPE_END
};

View File

@ -85,7 +85,6 @@ static const XMLPropType aPropTypes[XML_FAMILY_TYPE_END][MAX_PROP_TYPES] =
ENTRY1( END ), // XML_FAMILY_TYPE_FILL_IMAGE,
ENTRY1( END ), // XML_FAMILY_TYPE_STROKE_DASH,
ENTRY1( END ), // XML_FAMILY_TYPE_MARKER,
ENTRY1( END ) // XML_FAMILY_TYPE_PRESENTATION_PAGE_LAYOUT,
};
static const XMLTokenEnum aPropTokens[XML_PROP_TYPE_END] =