sw/inc/fldbas.hxx | 2 +- sw/source/uibase/fldui/fldmgr.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
New commits: commit 966085740e85a3f72084ebf89b2a016e9f094fee Author: Noel Grandin <[email protected]> AuthorDate: Thu Oct 9 10:30:46 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Thu Oct 9 12:28:20 2025 +0200 fix definition of SwFieldTypesEnum::LAST normally this is used as a special marker for when we use enum classes with o3tl::enumarray, but I did not convert this correctly in commit ebdf70cc68989d209965768edc8a3bdf27543c48 Author: Noel Grandin <[email protected]> Date: Fri Sep 20 15:18:01 2019 +0200 convert SwFieldTypesEnum to scoped enum Change-Id: I6818d7e0949697b0fce79fa4b9463486199da57b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192091 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx index 78025f4779c0..425cf1bc2b94 100644 --- a/sw/inc/fldbas.hxx +++ b/sw/inc/fldbas.hxx @@ -144,7 +144,7 @@ enum class SwFieldTypesEnum : sal_uInt16 { Dropdown, Custom, // Unused - necessary for alignment with aSwFields in fldmgr.cxx ParagraphSignature, - LAST, + LAST = ParagraphSignature, Unknown = USHRT_MAX // used by SwFieldMgr::GetCurTypeId }; enum class SwFileNameFormat { diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index d5773e0a5a35..143db366f7d5 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -668,7 +668,7 @@ void SwFieldMgr::GetSubTypes(SwFieldTypesEnum nTypeId, std::vector<OUString>& rT // ACCESS over TYP_... sal_uInt16 SwFieldMgr::GetFormatCount(SwFieldTypesEnum nTypeId, bool bHtmlMode) const { - assert(nTypeId < SwFieldTypesEnum::LAST && "forbidden TypeId"); + assert(nTypeId <= SwFieldTypesEnum::LAST && "forbidden TypeId"); { const sal_uInt16 nPos = GetPos(nTypeId); @@ -717,7 +717,7 @@ OUString SwFieldMgr::GetFormatStr(const SwField& rField) const // determine FormatString to a type OUString SwFieldMgr::GetFormatStr(SwFieldTypesEnum nTypeId, sal_uInt32 nFormatId) const { - assert(nTypeId < SwFieldTypesEnum::LAST && "forbidden TypeId"); + assert(nTypeId <= SwFieldTypesEnum::LAST && "forbidden TypeId"); const sal_uInt16 nPos = GetPos(nTypeId); if (nPos == USHRT_MAX)
