loplugin:unusedenumvalues in sw

Change-Id: Ia5faa65cd7824183cead2634edab96b5d23a6c02
Reviewed-on: https://gerrit.libreoffice.org/28072
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin
2016-08-12 12:08:50 +02:00
committed by Noel Grandin
parent e0a3269183
commit 95be297746
13 changed files with 28 additions and 94 deletions

View File

@@ -78,6 +78,7 @@ public:
}
bool shouldVisitTemplateInstantiations () const { return true; }
bool shouldVisitImplicitCode() const { return true; }
bool VisitEnumDecl( const EnumDecl* );
bool VisitDeclRefExpr( const DeclRefExpr* );

View File

@@ -7,9 +7,17 @@ import io
definitionSet = set()
definitionToSourceLocationMap = dict()
touchSet = set()
# things we need to exclude for reasons like :
# - it's a weird template thingy that confuses the plugin
exclusionSet = set([
# exclude some stuff, mostly because they are some kind of definition of external file formats
excludedSourceFiles = set([
"include/svx/msdffdef.hxx",
"sw/source/filter/ww8/fields.hxx",
"sw/source/filter/inc/wwstyles.hxx",
"sw/inc/toxe.hxx",
"sw/inc/poolfmt.hxx",
"sw/inc/hintids.hxx",
])
excludedTypes = set([
"SwVarFormat", "RES_FIELDS", "SwFillOrder", "SwIoDetect", "SwDocumentSettingsPropertyHandles"
])
# clang does not always use exactly the same numbers in the type-parameter vars it generates
@@ -69,14 +77,13 @@ for d in definitionSet:
or srcLoc.startswith("include/typelib/")
or srcLoc.startswith("include/uno/")):
continue
# definitions of external file formats
if (srcLoc.startswith("include/svx/msdffdef.hxx"):
if srcLoc in excludedSourceFiles or d[0] in excludedTypes:
continue
# used in templates to find the last member of an enum
if (d1.endswith("LAST"):
if d[1] == "LAST" or d[1].endswith("_END"):
continue
# used to aid in alignment of enum values
if (d1.endswith("FORCE_EQUAL_SIZE"):
if d[1].endswith("FORCE_EQUAL_SIZE"):
continue
untouchedSet.add((clazz, srcLoc))

View File

@@ -42,7 +42,6 @@ enum SwCalcOper
CALC_DIV='/', CALC_PRINT=';', CALC_ASSIGN='=',
CALC_LP='(', CALC_RP=')', CALC_PHD='%',
CALC_POW='^',
CALC_LISTOP = cListDelim,
CALC_NOT=256, CALC_AND=257, CALC_OR=258,
CALC_XOR=259, CALC_EQ=260, CALC_NEQ=261,
CALC_LEQ=262, CALC_GEQ=263, CALC_LES=264,

View File

@@ -84,14 +84,6 @@ namespace nsSwDocInfoSubType
const SwDocInfoSubType DI_SUB_MASK = 0xff00;
}
enum RegInfoFormat ///< Only for loading of old documents!!!
{
RF_AUTHOR,
RF_TIME,
RF_DATE,
RF_ALL
};
enum SwPageNumSubType
{
PG_RANDOM,

View File

@@ -26,54 +26,6 @@ class DateTime;
class Date;
namespace tools { class Time; }
enum SwDateFormat
{
DF_BEGIN,
// new formats
DFF_SSYS = DF_BEGIN,
DFF_LSYS ,
DFF_DMY ,
DFF_DMYY ,
DFF_DMMY ,
DFF_DMMYY,
DFF_DMMMY ,
DFF_DMMMYY,
DFF_DDMMY ,
DFF_DDMMMY ,
DFF_DDMMMYY ,
DFF_DDDMMMY ,
DFF_DDDMMMYY ,
DFF_MY ,
DFF_MD ,
DFF_YMD ,
DFF_YYMD ,
DF_END ,
// Compatibility
DF_SSYS = DFF_SSYS,
DF_LSYS = DFF_LSYS,
DF_SHORT = DFF_DMY,
DF_SCENT = DFF_DMYY,
DF_LMON = DFF_DMMYY,
DF_LMONTH = DFF_DMMMYY,
DF_LDAYMON = DFF_DDMMMYY,
DF_LDAYMONTH= DFF_DDDMMMYY
};
enum SwTimeFormat
{
TF_BEGIN,
TF_SYSTEM=TF_BEGIN,
TF_SSMM_24,
TF_SSMM_12,
TF_END
};
enum SwTimeSubFormat
{
TIME_FIX,
TIME_VAR
};
enum SwDateSubFormat
{
DATE_FIX,

View File

@@ -112,8 +112,7 @@ public:
{
HORI_L2R,
HORI_R2L,
VERT_R2L,
VERT_L2R ///< Not supported yet.
VERT_R2L
};
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const;

View File

@@ -41,14 +41,13 @@ class InsCaptionOpt;
enum class MailTextFormats
{
NONE = 0x00,
ASCII = 0x01,
HTML = 0x02,
RTF = 0x04,
OFFICE = 0x08
HTML = 0x01,
RTF = 0x02,
OFFICE = 0x04
};
namespace o3tl
{
template<> struct typed_flags<MailTextFormats> : is_typed_flags<MailTextFormats, 0x0f> {};
template<> struct typed_flags<MailTextFormats> : is_typed_flags<MailTextFormats, 0x07> {};
}

View File

@@ -186,17 +186,16 @@ enum class SetAttrMode
/// when using this need to pay attention to ignore start/end flags of hint
NOHINTADJUST = 0x0008, // No merging of ranges.
NOFORMATATTR = 0x0010, // Do not change into format attribute.
DONTCHGNUMRULE = 0x0020, // Do not change NumRule.
APICALL = 0x0040, // Called from API (all UI related
APICALL = 0x0020, // Called from API (all UI related
// functionality will be disabled).
/// Force hint expand (only matters for hints with CH_TXTATR).
FORCEHINTEXPAND = 0x0080,
FORCEHINTEXPAND = 0x0040,
/// The inserted item is a copy -- intended for use in ndtxt.cxx.
IS_COPY = 0x0100
IS_COPY = 0x0080
};
namespace o3tl
{
template<> struct typed_flags<SetAttrMode> : is_typed_flags<SetAttrMode, 0x1ff> {};
template<> struct typed_flags<SetAttrMode> : is_typed_flags<SetAttrMode, 0x0ff> {};
}
#define SW_ISPRINTABLE( c ) ( c >= ' ' && 127 != c )
@@ -273,7 +272,6 @@ enum PrepareHint
// Direction is communicated via pVoid:
// MoveFwd: pVoid == 0
// MoveBwd: pVoid == pOldPage
PREP_SWAP, // Swap graphic; for graphics in visible area.
PREP_REGISTER, // Invalidate frames with registers.
PREP_FTN_GONE, // A Follow loses its footnote, possibly its first line can move up.
PREP_MOVEFTN, // A footnote changes its page. Its contents receives at first a

View File

@@ -115,8 +115,7 @@ enum ShellModes
SHELL_MODE_MEDIA,
SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
SHELL_MODE_FONTWORK,
SHELL_MODE_POSTIT,
SHELL_MODE_NAVIGATION
SHELL_MODE_POSTIT
};
// apply a template

View File

@@ -36,13 +36,6 @@ namespace vcl { class Font; }
class SwSortedObjs;
class SwAnchoredObject;
enum SwPageChg
{
CHG_NEWPAGE,
CHG_CUTPAGE,
CHG_CHGPAGE
};
/// A page of the document layout.
class SwPageFrame: public SwFootnoteBossFrame
{

View File

@@ -24,7 +24,6 @@
enum CSS1Token
{
CSS1_NULL,
CSS1_UNKNOWN,
CSS1_IDENT,
CSS1_STRING,
@@ -60,8 +59,7 @@ enum CSS1Token
enum CSS1ParserState
{
CSS1_PAR_ACCEPTED = 0,
CSS1_PAR_WORKING,
CSS1_PAR_ERROR
CSS1_PAR_WORKING
};
enum CSS1SelectorType

View File

@@ -165,9 +165,7 @@ public:
BOOK_TO_VAR_REF,
BOOK_AND_REF,
TAGS_IN_TEXT,
ALLOW_FLD_CR,
NO_FLD_CR,
DONT_HARD_PROTECT
ALLOW_FLD_CR
};
SwFltControlStack(SwDoc* pDo, sal_uLong nFieldFl);

View File

@@ -593,8 +593,7 @@ private:
{
BOOKMARK_INDEX,
BOOKMARK_NEXT,
BOOKMARK_PREV,
BOOKMARK_LAST_LAST_ENTRY
BOOKMARK_PREV
};
SAL_DLLPRIVATE bool MoveBookMark(BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark=nullptr);