sw/inc/tox.hxx | 8 ++++---- sw/source/core/doc/doctxm.cxx | 4 ++-- sw/source/core/tox/tox.cxx | 2 +- sw/source/core/unocore/unoidx.cxx | 16 ++++++++-------- sw/source/filter/ww8/ww8par5.cxx | 4 ++-- sw/source/ui/index/cntex.cxx | 6 +++--- sw/source/uibase/inc/toxmgr.hxx | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-)
New commits: commit 5e17145dee68561cd55d4a698beda354a796b49a Author: Noel Grandin <[email protected]> AuthorDate: Mon Jul 7 11:30:15 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Jul 7 13:03:47 2025 +0200 convert SwCaptionDisplay to scoped enum Change-Id: I4799d87d87f73414251425b78d242ef5faa59ae8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187471 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index 44b28bf7c766..8892e331a2e1 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -400,11 +400,11 @@ namespace o3tl { } //which part of the caption is to be displayed -enum SwCaptionDisplay +enum class SwCaptionDisplay { - CAPTION_COMPLETE, - CAPTION_NUMBER, - CAPTION_TEXT + Complete, + Number, + Text }; enum class SwTOOElements : sal_uInt16 diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 5c094cad11ef..cc519c0fa9a3 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -1498,12 +1498,12 @@ void SwTOXBaseSection::UpdateSequence(const SwTextNode* pOwnChapterNode, + OUString::number( rSeqField.GetSeqNumber() ); std::unique_ptr<SwTOXPara> pNew(new SwTOXPara( rTextNode, SwTOXElement::Sequence, 1, sName )); // set indexes if the number or the reference text are to be displayed - if( GetCaptionDisplay() == CAPTION_TEXT ) + if( GetCaptionDisplay() == SwCaptionDisplay::Text ) { pNew->SetStartIndex( SwGetExpField::GetReferenceTextPos( *pFormatField, rDoc )); } - else if(GetCaptionDisplay() == CAPTION_NUMBER) + else if(GetCaptionDisplay() == SwCaptionDisplay::Number) { pNew->SetEndIndex(pTextField->GetStart() + 1); } diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 771931c53fa5..3a85782811e8 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -550,7 +550,7 @@ SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm, , m_eLanguage(::GetAppLanguage()) , m_nCreateType(nCreaType) , m_nOLEOptions(SwTOOElements::NONE) - , m_eCaptionDisplay(CAPTION_COMPLETE) + , m_eCaptionDisplay(SwCaptionDisplay::Complete) , m_bProtected( true ) , m_bFromChapter(false) , m_bFromObjectNames(false) diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 42ce686a567e..946421dffeed 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -696,22 +696,22 @@ SwXDocumentIndex::setPropertyValue( case WID_LABEL_DISPLAY_TYPE: { const sal_Int16 nVal = lcl_AnyToType<sal_Int16>(rValue); - sal_uInt16 nSet = CAPTION_COMPLETE; + SwCaptionDisplay nSet = SwCaptionDisplay::Complete; switch (nVal) { case text::ReferenceFieldPart::TEXT: - nSet = CAPTION_COMPLETE; + nSet = SwCaptionDisplay::Complete; break; case text::ReferenceFieldPart::CATEGORY_AND_NUMBER: - nSet = CAPTION_NUMBER; + nSet = SwCaptionDisplay::Number; break; case text::ReferenceFieldPart::ONLY_CAPTION: - nSet = CAPTION_TEXT; + nSet = SwCaptionDisplay::Text; break; default: throw lang::IllegalArgumentException(); } - rTOXBase.SetCaptionDisplay(static_cast<SwCaptionDisplay>(nSet)); + rTOXBase.SetCaptionDisplay(nSet); } break; case WID_USE_LEVEL_FROM_SOURCE: @@ -1028,13 +1028,13 @@ SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) sal_Int16 nSet = text::ReferenceFieldPart::TEXT; switch (pTOXBase->GetCaptionDisplay()) { - case CAPTION_COMPLETE: + case SwCaptionDisplay::Complete: nSet = text::ReferenceFieldPart::TEXT; break; - case CAPTION_NUMBER: + case SwCaptionDisplay::Number: nSet = text::ReferenceFieldPart::CATEGORY_AND_NUMBER; break; - case CAPTION_TEXT: + case SwCaptionDisplay::Text: nSet = text::ReferenceFieldPart::ONLY_CAPTION; break; } diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 8e55622ed41e..1d7ea27a60a9 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -3190,8 +3190,8 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) case 'c': lcl_toxMatchACSwitch(m_rDoc, *pBase, aReadParam, ('c' == nRet) - ? CAPTION_COMPLETE - : CAPTION_TEXT ); + ? SwCaptionDisplay::Complete + : SwCaptionDisplay::Text ); break; case 'o': { diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index 95c879049666..1af093d20b16 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -234,9 +234,9 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( sal_Int16 nSet = text::ChapterFormat::NAME_NUMBER; switch (rDesc.GetCaptionDisplay()) { - case CAPTION_COMPLETE: nSet = text::ChapterFormat::NAME_NUMBER;break; - case CAPTION_NUMBER : nSet = text::ChapterFormat::NUMBER; break; - case CAPTION_TEXT : nSet = text::ChapterFormat::NAME; break; + case SwCaptionDisplay::Complete: nSet = text::ChapterFormat::NAME_NUMBER;break; + case SwCaptionDisplay::Number : nSet = text::ChapterFormat::NUMBER; break; + case SwCaptionDisplay::Text : nSet = text::ChapterFormat::NAME; break; } lcl_SetProp(xInfo, xIdxProps, UNO_NAME_LABEL_DISPLAY_TYPE, nSet); diff --git a/sw/source/uibase/inc/toxmgr.hxx b/sw/source/uibase/inc/toxmgr.hxx index 055cdad535e2..18fc8c2f4224 100644 --- a/sw/source/uibase/inc/toxmgr.hxx +++ b/sw/source/uibase/inc/toxmgr.hxx @@ -76,7 +76,7 @@ public: m_nIndexOptions(SwTOIOptions::SameEntry|SwTOIOptions::FF|SwTOIOptions::CaseSensitive), m_nOLEOptions(SwTOOElements::NONE), m_eLanguage(::GetAppLanguage()), - m_eCaptionDisplay(CAPTION_COMPLETE), + m_eCaptionDisplay(SwCaptionDisplay::Complete), m_nLevel(MAXLEVEL), m_bFromObjectNames(false), m_bFromChapter(false),
