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:
committed by
Noel Grandin
parent
e0a3269183
commit
95be297746
@@ -78,6 +78,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool shouldVisitTemplateInstantiations () const { return true; }
|
bool shouldVisitTemplateInstantiations () const { return true; }
|
||||||
|
bool shouldVisitImplicitCode() const { return true; }
|
||||||
|
|
||||||
bool VisitEnumDecl( const EnumDecl* );
|
bool VisitEnumDecl( const EnumDecl* );
|
||||||
bool VisitDeclRefExpr( const DeclRefExpr* );
|
bool VisitDeclRefExpr( const DeclRefExpr* );
|
||||||
|
@@ -7,9 +7,17 @@ import io
|
|||||||
definitionSet = set()
|
definitionSet = set()
|
||||||
definitionToSourceLocationMap = dict()
|
definitionToSourceLocationMap = dict()
|
||||||
touchSet = set()
|
touchSet = set()
|
||||||
# things we need to exclude for reasons like :
|
# exclude some stuff, mostly because they are some kind of definition of external file formats
|
||||||
# - it's a weird template thingy that confuses the plugin
|
excludedSourceFiles = set([
|
||||||
exclusionSet = 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
|
# 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/typelib/")
|
||||||
or srcLoc.startswith("include/uno/")):
|
or srcLoc.startswith("include/uno/")):
|
||||||
continue
|
continue
|
||||||
# definitions of external file formats
|
if srcLoc in excludedSourceFiles or d[0] in excludedTypes:
|
||||||
if (srcLoc.startswith("include/svx/msdffdef.hxx"):
|
|
||||||
continue
|
continue
|
||||||
# used in templates to find the last member of an enum
|
# 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
|
continue
|
||||||
# used to aid in alignment of enum values
|
# used to aid in alignment of enum values
|
||||||
if (d1.endswith("FORCE_EQUAL_SIZE"):
|
if d[1].endswith("FORCE_EQUAL_SIZE"):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
untouchedSet.add((clazz, srcLoc))
|
untouchedSet.add((clazz, srcLoc))
|
||||||
|
@@ -42,7 +42,6 @@ enum SwCalcOper
|
|||||||
CALC_DIV='/', CALC_PRINT=';', CALC_ASSIGN='=',
|
CALC_DIV='/', CALC_PRINT=';', CALC_ASSIGN='=',
|
||||||
CALC_LP='(', CALC_RP=')', CALC_PHD='%',
|
CALC_LP='(', CALC_RP=')', CALC_PHD='%',
|
||||||
CALC_POW='^',
|
CALC_POW='^',
|
||||||
CALC_LISTOP = cListDelim,
|
|
||||||
CALC_NOT=256, CALC_AND=257, CALC_OR=258,
|
CALC_NOT=256, CALC_AND=257, CALC_OR=258,
|
||||||
CALC_XOR=259, CALC_EQ=260, CALC_NEQ=261,
|
CALC_XOR=259, CALC_EQ=260, CALC_NEQ=261,
|
||||||
CALC_LEQ=262, CALC_GEQ=263, CALC_LES=264,
|
CALC_LEQ=262, CALC_GEQ=263, CALC_LES=264,
|
||||||
|
@@ -84,14 +84,6 @@ namespace nsSwDocInfoSubType
|
|||||||
const SwDocInfoSubType DI_SUB_MASK = 0xff00;
|
const SwDocInfoSubType DI_SUB_MASK = 0xff00;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum RegInfoFormat ///< Only for loading of old documents!!!
|
|
||||||
{
|
|
||||||
RF_AUTHOR,
|
|
||||||
RF_TIME,
|
|
||||||
RF_DATE,
|
|
||||||
RF_ALL
|
|
||||||
};
|
|
||||||
|
|
||||||
enum SwPageNumSubType
|
enum SwPageNumSubType
|
||||||
{
|
{
|
||||||
PG_RANDOM,
|
PG_RANDOM,
|
||||||
|
@@ -26,54 +26,6 @@ class DateTime;
|
|||||||
class Date;
|
class Date;
|
||||||
namespace tools { class Time; }
|
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
|
enum SwDateSubFormat
|
||||||
{
|
{
|
||||||
DATE_FIX,
|
DATE_FIX,
|
||||||
|
@@ -112,8 +112,7 @@ public:
|
|||||||
{
|
{
|
||||||
HORI_L2R,
|
HORI_L2R,
|
||||||
HORI_R2L,
|
HORI_R2L,
|
||||||
VERT_R2L,
|
VERT_R2L
|
||||||
VERT_L2R ///< Not supported yet.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const;
|
virtual SwFrameFormat::tLayoutDir GetLayoutDir() const;
|
||||||
|
@@ -41,14 +41,13 @@ class InsCaptionOpt;
|
|||||||
enum class MailTextFormats
|
enum class MailTextFormats
|
||||||
{
|
{
|
||||||
NONE = 0x00,
|
NONE = 0x00,
|
||||||
ASCII = 0x01,
|
HTML = 0x01,
|
||||||
HTML = 0x02,
|
RTF = 0x02,
|
||||||
RTF = 0x04,
|
OFFICE = 0x04
|
||||||
OFFICE = 0x08
|
|
||||||
};
|
};
|
||||||
namespace o3tl
|
namespace o3tl
|
||||||
{
|
{
|
||||||
template<> struct typed_flags<MailTextFormats> : is_typed_flags<MailTextFormats, 0x0f> {};
|
template<> struct typed_flags<MailTextFormats> : is_typed_flags<MailTextFormats, 0x07> {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -186,17 +186,16 @@ enum class SetAttrMode
|
|||||||
/// when using this need to pay attention to ignore start/end flags of hint
|
/// when using this need to pay attention to ignore start/end flags of hint
|
||||||
NOHINTADJUST = 0x0008, // No merging of ranges.
|
NOHINTADJUST = 0x0008, // No merging of ranges.
|
||||||
NOFORMATATTR = 0x0010, // Do not change into format attribute.
|
NOFORMATATTR = 0x0010, // Do not change into format attribute.
|
||||||
DONTCHGNUMRULE = 0x0020, // Do not change NumRule.
|
APICALL = 0x0020, // Called from API (all UI related
|
||||||
APICALL = 0x0040, // Called from API (all UI related
|
|
||||||
// functionality will be disabled).
|
// functionality will be disabled).
|
||||||
/// Force hint expand (only matters for hints with CH_TXTATR).
|
/// 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.
|
/// The inserted item is a copy -- intended for use in ndtxt.cxx.
|
||||||
IS_COPY = 0x0100
|
IS_COPY = 0x0080
|
||||||
};
|
};
|
||||||
namespace o3tl
|
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 )
|
#define SW_ISPRINTABLE( c ) ( c >= ' ' && 127 != c )
|
||||||
@@ -273,7 +272,6 @@ enum PrepareHint
|
|||||||
// Direction is communicated via pVoid:
|
// Direction is communicated via pVoid:
|
||||||
// MoveFwd: pVoid == 0
|
// MoveFwd: pVoid == 0
|
||||||
// MoveBwd: pVoid == pOldPage
|
// MoveBwd: pVoid == pOldPage
|
||||||
PREP_SWAP, // Swap graphic; for graphics in visible area.
|
|
||||||
PREP_REGISTER, // Invalidate frames with registers.
|
PREP_REGISTER, // Invalidate frames with registers.
|
||||||
PREP_FTN_GONE, // A Follow loses its footnote, possibly its first line can move up.
|
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
|
PREP_MOVEFTN, // A footnote changes its page. Its contents receives at first a
|
||||||
|
@@ -115,8 +115,7 @@ enum ShellModes
|
|||||||
SHELL_MODE_MEDIA,
|
SHELL_MODE_MEDIA,
|
||||||
SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
|
SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
|
||||||
SHELL_MODE_FONTWORK,
|
SHELL_MODE_FONTWORK,
|
||||||
SHELL_MODE_POSTIT,
|
SHELL_MODE_POSTIT
|
||||||
SHELL_MODE_NAVIGATION
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// apply a template
|
// apply a template
|
||||||
|
@@ -36,13 +36,6 @@ namespace vcl { class Font; }
|
|||||||
class SwSortedObjs;
|
class SwSortedObjs;
|
||||||
class SwAnchoredObject;
|
class SwAnchoredObject;
|
||||||
|
|
||||||
enum SwPageChg
|
|
||||||
{
|
|
||||||
CHG_NEWPAGE,
|
|
||||||
CHG_CUTPAGE,
|
|
||||||
CHG_CHGPAGE
|
|
||||||
};
|
|
||||||
|
|
||||||
/// A page of the document layout.
|
/// A page of the document layout.
|
||||||
class SwPageFrame: public SwFootnoteBossFrame
|
class SwPageFrame: public SwFootnoteBossFrame
|
||||||
{
|
{
|
||||||
|
@@ -24,7 +24,6 @@
|
|||||||
enum CSS1Token
|
enum CSS1Token
|
||||||
{
|
{
|
||||||
CSS1_NULL,
|
CSS1_NULL,
|
||||||
CSS1_UNKNOWN,
|
|
||||||
|
|
||||||
CSS1_IDENT,
|
CSS1_IDENT,
|
||||||
CSS1_STRING,
|
CSS1_STRING,
|
||||||
@@ -60,8 +59,7 @@ enum CSS1Token
|
|||||||
enum CSS1ParserState
|
enum CSS1ParserState
|
||||||
{
|
{
|
||||||
CSS1_PAR_ACCEPTED = 0,
|
CSS1_PAR_ACCEPTED = 0,
|
||||||
CSS1_PAR_WORKING,
|
CSS1_PAR_WORKING
|
||||||
CSS1_PAR_ERROR
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CSS1SelectorType
|
enum CSS1SelectorType
|
||||||
|
@@ -165,9 +165,7 @@ public:
|
|||||||
BOOK_TO_VAR_REF,
|
BOOK_TO_VAR_REF,
|
||||||
BOOK_AND_REF,
|
BOOK_AND_REF,
|
||||||
TAGS_IN_TEXT,
|
TAGS_IN_TEXT,
|
||||||
ALLOW_FLD_CR,
|
ALLOW_FLD_CR
|
||||||
NO_FLD_CR,
|
|
||||||
DONT_HARD_PROTECT
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SwFltControlStack(SwDoc* pDo, sal_uLong nFieldFl);
|
SwFltControlStack(SwDoc* pDo, sal_uLong nFieldFl);
|
||||||
|
@@ -593,8 +593,7 @@ private:
|
|||||||
{
|
{
|
||||||
BOOKMARK_INDEX,
|
BOOKMARK_INDEX,
|
||||||
BOOKMARK_NEXT,
|
BOOKMARK_NEXT,
|
||||||
BOOKMARK_PREV,
|
BOOKMARK_PREV
|
||||||
BOOKMARK_LAST_LAST_ENTRY
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SAL_DLLPRIVATE bool MoveBookMark(BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark=nullptr);
|
SAL_DLLPRIVATE bool MoveBookMark(BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark=nullptr);
|
||||||
|
Reference in New Issue
Block a user