sw/source/uibase/fldui/fldmgr.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commits: commit d80c5fc42735e2f649ddfade696cda84c5a343d5 Author: Noel Grandin <[email protected]> AuthorDate: Thu Oct 9 10:49:13 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Thu Oct 9 13:14:05 2025 +0200 OSL_ENSURE -> assert in SwFieldMgr I am doing some work in this area, and I'd like to catch bugs early Change-Id: I8086e937f5152d9ebf6d6bc343d4be6866317ac2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192093 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index 143db366f7d5..a3fd5092447e 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -518,13 +518,13 @@ SwFieldGroup SwFieldMgr::GetGroup(SwFieldTypesEnum nTypeId, sal_uInt16 nSubType) // ACCESS over TYP_... SwFieldTypesEnum SwFieldMgr::GetTypeId(sal_uInt16 nPos) { - OSL_ENSURE(nPos < ::GetPackCount(), "forbidden Pos"); + assert(nPos < ::GetPackCount() && "forbidden Pos"); return aSwFields[ nPos ].nTypeId; } const OUString & SwFieldMgr::GetTypeStr(sal_uInt16 nPos) { - OSL_ENSURE(nPos < ::GetPackCount(), "forbidden TypeId"); + assert(nPos < ::GetPackCount() && "forbidden TypeId"); SwFieldTypesEnum nFieldWh = aSwFields[ nPos ].nTypeId; @@ -1543,11 +1543,11 @@ bool SwFieldMgr::InsertField( return true; default: - { OSL_ENSURE(false, "wrong field type"); + { assert(false && "wrong field type"); return false; } } - OSL_ENSURE(pField, "field not available"); + assert(pField && "field not available"); //the auto language flag has to be set prior to the language! pField->SetAutomaticLanguage(rData.m_bIsAutomaticLanguage); @@ -1624,7 +1624,7 @@ void SwFieldMgr::UpdateCurField(sal_uInt32 nFormat, std::unique_ptr<SwField> pTmpField) { // change format - OSL_ENSURE(m_pCurField, "no field at CursorPos"); + assert(m_pCurField && "no field at CursorPos"); if (!pTmpField) pTmpField = m_pCurField->CopyField();
