diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-20 15:18:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-20 18:21:50 +0200 |
commit | ebdf70cc68989d209965768edc8a3bdf27543c48 (patch) | |
tree | d89afb49072248692cc355bf24402fa6d66898ad /sw/inc | |
parent | e15297a72e3483a6e5641253920e71f6e4570c28 (diff) |
convert SwFieldTypesEnum to scoped enum
clamp it to sal_uInt16 since we convert it that type when passing
it via SfxItemSet
Change-Id: I4b7bd4ba5e19015af357d5a81a629239451d71e4
Reviewed-on: https://gerrit.libreoffice.org/79289
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/docufld.hxx | 6 | ||||
-rw-r--r-- | sw/inc/fldbas.hxx | 101 |
2 files changed, 54 insertions, 53 deletions
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index e6afd73af156..cb6f0c2159c2 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -295,7 +295,7 @@ class SW_DLLPUBLIC SwHiddenTextField : public SwField OUString m_aContent; ///< Evaluated DB-text. OUString m_aCond; ///< Condition. - sal_uInt16 m_nSubType; + SwFieldTypesEnum m_nSubType; bool m_bCanToggle : 1; ///< Can field be toggled alone? bool m_bIsHidden : 1; ///< Is it not visible? @@ -310,13 +310,13 @@ public: const OUString& rCond, const OUString& rText, bool bHidden, - sal_uInt16 nSubType = TYP_HIDDENTXTFLD); + SwFieldTypesEnum nSubType = SwFieldTypesEnum::HiddenText); SwHiddenTextField( SwHiddenTextFieldType*, const OUString& rCond, const OUString& rTrue, const OUString& rFalse, - sal_uInt16 nSubType = TYP_HIDDENTXTFLD); + SwFieldTypesEnum nSubType = SwFieldTypesEnum::HiddenText); virtual OUString GetFieldName() const override; diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index aafce0c4c718..664f74b45242 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -84,54 +84,55 @@ enum class SwFieldIds : sal_uInt16 { }; /// List of FieldTypes at UI. -enum SwFieldTypesEnum { - TYP_BEGIN, - TYP_DATEFLD = TYP_BEGIN, // 0 - TYP_TIMEFLD, - TYP_FILENAMEFLD, - TYP_DBNAMEFLD, - TYP_CHAPTERFLD, - TYP_PAGENUMBERFLD, - TYP_DOCSTATFLD, - TYP_AUTHORFLD, - TYP_SETFLD, - TYP_GETFLD, - TYP_FORMELFLD, // 10 - TYP_HIDDENTXTFLD, - TYP_SETREFFLD, - TYP_GETREFFLD, - TYP_DDEFLD, - TYP_MACROFLD, - TYP_INPUTFLD, - TYP_HIDDENPARAFLD, - TYP_DOCINFOFLD, - TYP_DBFLD, - TYP_USERFLD, // 20 - TYP_POSTITFLD, - TYP_TEMPLNAMEFLD, - TYP_SEQFLD, - TYP_DBNEXTSETFLD, - TYP_DBNUMSETFLD, - TYP_DBSETNUMBERFLD, - TYP_CONDTXTFLD, - TYP_NEXTPAGEFLD, - TYP_PREVPAGEFLD, - TYP_EXTUSERFLD, // 30 - TYP_FIXDATEFLD, - TYP_FIXTIMEFLD, - TYP_SETINPFLD, - TYP_USRINPFLD, - TYP_SETREFPAGEFLD, - TYP_GETREFPAGEFLD, - TYP_INTERNETFLD, - TYP_JUMPEDITFLD, - TYP_SCRIPTFLD, - TYP_AUTHORITY, // 40 - TYP_COMBINED_CHARS, - TYP_DROPDOWN, - TYP_CUSTOM, // Unused - necessary for alignment with aSwFields in fldmgr.cxx - TYP_PARAGRAPHSIGFLD, - TYP_END +enum class SwFieldTypesEnum : sal_uInt16 { + Begin, + Date = Begin, // 0 + Time, + Filename, + DatabaseName, + Chapter, + PageNumber, + DocumentStatistics, + Author, + Set, + Get, + Formel, // 10 + HiddenText, + SetRef, + GetRef, + DDE, + Macro, + Input, + HiddenParagraph, + DocumentInfo, + Database, + User, // 20 + Postit, + TemplateName, + Sequence, + DatabaseNextSet, + DatabaseNumberSet, + DatabaseSetNumber, + ConditionalText, + NextPage, + PreviousPage, + ExtendedUser, // 30 + FixedDate, + FixedTime, + SetInput, + UserInput, + SetRefPage, + GetRefPage, + Internet, + JumpEdit, + Script, + Authority, // 40 + CombinedChars, + Dropdown, + Custom, // Unused - necessary for alignment with aSwFields in fldmgr.cxx + ParagraphSignature, + LAST, + Unknown = USHRT_MAX // used by SwFieldMgr::GetCurTypeId }; enum SwAttrFieldType { ATTR_NONE, @@ -254,7 +255,7 @@ public: m_wXFieldMaster = xFieldMaster; } - static OUString GetTypeStr( sal_uInt16 nTypeId ); + static OUString GetTypeStr( SwFieldTypesEnum nTypeId ); /// Only in derived classes. virtual OUString GetName() const; @@ -340,7 +341,7 @@ public: #endif // TYP_ID - sal_uInt16 GetTypeId() const; + SwFieldTypesEnum GetTypeId() const; virtual sal_uInt16 GetSubType() const; virtual void SetSubType(sal_uInt16); |