diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-29 11:05:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-29 11:03:17 +0000 |
commit | df6e163850361535afc411777e306994c64408f5 (patch) | |
tree | e903cef5018f8d9b3646e53fc204eb679e8b2fb1 | |
parent | a5cc8993dceb61c63caf26ae995d9d62905291e5 (diff) |
convert SwTOXElement to o3tl::typed_flags
Change-Id: Ib0538602d0d363488a25b357f85e76293cd19319
Reviewed-on: https://gerrit.libreoffice.org/31351
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/inc/tox.hxx | 58 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 36 | ||||
-rw-r--r-- | sw/source/core/tox/tox.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/tox/txmsrt.cxx | 38 | ||||
-rw-r--r-- | sw/source/core/unocore/unoidx.cxx | 63 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 18 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 28 | ||||
-rw-r--r-- | sw/source/ui/index/cntex.cxx | 26 | ||||
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 38 | ||||
-rw-r--r-- | sw/source/uibase/inc/toxmgr.hxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/index/toxmgr.cxx | 5 |
12 files changed, 173 insertions, 151 deletions
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index eb6a28f1dfce..0c6f6be1f9b5 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -29,6 +29,7 @@ #include <swtypes.hxx> #include <toxe.hxx> #include <calbck.hxx> +#include <o3tl/typed_flags_set.hxx> #include <vector> @@ -326,23 +327,26 @@ public: }; // Content to create indexes of -typedef sal_uInt16 SwTOXElement; -namespace nsSwTOXElement -{ - const SwTOXElement TOX_MARK = 1; - const SwTOXElement TOX_OUTLINELEVEL = 2; - const SwTOXElement TOX_TEMPLATE = 4; - const SwTOXElement TOX_OLE = 8; - const SwTOXElement TOX_TABLE = 16; - const SwTOXElement TOX_GRAPHIC = 32; - const SwTOXElement TOX_FRAME = 64; - const SwTOXElement TOX_SEQUENCE = 128; - const SwTOXElement TOX_TABLEADER = 256; - const SwTOXElement TOX_TAB_IN_TOC = 512; - const SwTOXElement TOX_BOOKMARK = 1024; - const SwTOXElement TOX_NEWLINE = 2048; - const SwTOXElement TOX_PARAGRAPH_OUTLINE_LEVEL = 4096; - const SwTOXElement TOX_INDEX_ENTRY_TYPE = 8192; +enum class SwTOXElement : sal_uInt16 +{ + NONE = 0x0000, + Mark = 0x0001, + OutlineLevel = 0x0002, + Template = 0x0004, + Ole = 0x0008, + Table = 0x0010, + Graphic = 0x0020, + Frame = 0x0040, + Sequence = 0x0080, + TableLeader = 0x0100, + TableInToc = 0x0200, + Bookmark = 0x0400, + Newline = 0x0800, + ParagraphOutlineLevel = 0x1000, + IndexEntryType = 0x2000, +}; +namespace o3tl { + template<> struct typed_flags<SwTOXElement> : is_typed_flags<SwTOXElement, 0x3fff> {}; } typedef sal_uInt16 SwTOIOptions; @@ -399,7 +403,7 @@ class SW_DLLPUBLIC SwTOXBase : public SwClient sal_uInt16 nOptions; // options of alphabetical index } m_aData; - sal_uInt16 m_nCreateType; // sources to create the index from + SwTOXElement m_nCreateType; // sources to create the index from sal_uInt16 m_nOLEOptions; // OLE sources SwCaptionDisplay m_eCaptionDisplay; bool m_bProtected : 1; // index protected ? @@ -416,7 +420,7 @@ protected: public: SwTOXBase( const SwTOXType* pTyp, const SwForm& rForm, - sal_uInt16 nCreaType, const OUString& rTitle ); + SwTOXElement nCreaType, const OUString& rTitle ); SwTOXBase( const SwTOXBase& rCopy, SwDoc* pDoc = nullptr ); virtual ~SwTOXBase() override; @@ -428,7 +432,7 @@ public: const SwTOXType* GetTOXType() const; - sal_uInt16 GetCreateType() const; // creation types + SwTOXElement GetCreateType() const; // creation types const OUString& GetTOXName() const {return m_aName;} void SetTOXName(const OUString& rSet) {m_aName = rSet;} @@ -444,10 +448,10 @@ public: OUString GetTypeName() const; // Name const SwForm& GetTOXForm() const; // description of the lines - void SetCreate(sal_uInt16); + void SetCreate(SwTOXElement); void SetTitle(const OUString& rTitle); void SetTOXForm(const SwForm& rForm); - void SetBookmarkName(const OUString& bName); + void SetBookmarkName(const OUString& bName); TOXTypes GetType() const; @@ -460,15 +464,15 @@ public: // content index only inline void SetLevel(sal_uInt16); // consider outline level - inline sal_uInt16 GetLevel() const; + inline sal_uInt16 GetLevel() const; // alphabetical index only - inline sal_uInt16 GetOptions() const; // alphabetical index options + inline sal_uInt16 GetOptions() const; // alphabetical index options inline void SetOptions(sal_uInt16 nOpt); // index of objects sal_uInt16 GetOLEOptions() const {return m_nOLEOptions;} - void SetOLEOptions(sal_uInt16 nOpt) {m_nOLEOptions = nOpt;} + void SetOLEOptions(sal_uInt16 nOpt) {m_nOLEOptions = nOpt;} // index of objects @@ -666,7 +670,7 @@ inline TOXTypes SwTOXType::GetType() const inline const SwTOXType* SwTOXBase::GetTOXType() const { return static_cast<const SwTOXType*>(GetRegisteredIn()); } -inline sal_uInt16 SwTOXBase::GetCreateType() const +inline SwTOXElement SwTOXBase::GetCreateType() const { return m_nCreateType; } inline const OUString& SwTOXBase::GetTitle() const @@ -684,7 +688,7 @@ inline OUString SwTOXBase::GetTypeName() const inline const SwForm& SwTOXBase::GetTOXForm() const { return m_aForm; } -inline void SwTOXBase::SetCreate(sal_uInt16 nCreate) +inline void SwTOXBase::SetCreate(SwTOXElement nCreate) { m_nCreateType = nCreate; } inline void SwTOXBase::SetTOXForm(const SwForm& rForm) diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index fa5f9dfc19b1..779e823b2235 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -152,7 +152,7 @@ DECLARE_OOXMLEXPORT_TEST(testFieldFlagO,"TOC_field_f.docx") DECLARE_OOXMLEXPORT_TEST(testTOCFlag_f, "toc_doc.docx") { // Export logic for all TOC field flags was enclosed inside - // if( nsSwTOXElement::TOX_MARK & pTOX->GetCreateType() ) in ww8atr.cxx which gets true for \f, + // if( SwTOXElement::Mark & pTOX->GetCreateType() ) in ww8atr.cxx which gets true for \f, // this was the reason if there is \f flag present in original doc then only other flags like // \o \h \n used to come after RoundTrip. // This test case is to verify even if there is no \f flag in original doc, \h flag is getting diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 87d1c60dcde4..18bc1695f44b 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -456,7 +456,7 @@ const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, bool bCreate ) { SwForm aForm(eTyp); const SwTOXType* pType = GetTOXType(eTyp, 0); - (*prBase) = new SwTOXBase(pType, aForm, 0, pType->GetTypeName()); + (*prBase) = new SwTOXBase(pType, aForm, SwTOXElement::NONE, pType->GetTypeName()); } return (*prBase); } @@ -891,34 +891,34 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, // This would be a good time to update the Numbering pDoc->UpdateNumRule(); - if( GetCreateType() & nsSwTOXElement::TOX_MARK ) + if( GetCreateType() & SwTOXElement::Mark ) UpdateMarks( aIntl, pOwnChapterNode ); - if( GetCreateType() & nsSwTOXElement::TOX_OUTLINELEVEL ) + if( GetCreateType() & SwTOXElement::OutlineLevel ) UpdateOutline( pOwnChapterNode ); - if( GetCreateType() & nsSwTOXElement::TOX_TEMPLATE ) + if( GetCreateType() & SwTOXElement::Template ) UpdateTemplate( pOwnChapterNode ); - if( GetCreateType() & nsSwTOXElement::TOX_OLE || + if( GetCreateType() & SwTOXElement::Ole || TOX_OBJECTS == SwTOXBase::GetType()) - UpdateContent( nsSwTOXElement::TOX_OLE, pOwnChapterNode ); + UpdateContent( SwTOXElement::Ole, pOwnChapterNode ); - if( GetCreateType() & nsSwTOXElement::TOX_TABLE || + if( GetCreateType() & SwTOXElement::Table || (TOX_TABLES == SwTOXBase::GetType() && IsFromObjectNames()) ) UpdateTable( pOwnChapterNode ); - if( GetCreateType() & nsSwTOXElement::TOX_GRAPHIC || + if( GetCreateType() & SwTOXElement::Graphic || (TOX_ILLUSTRATIONS == SwTOXBase::GetType() && IsFromObjectNames())) - UpdateContent( nsSwTOXElement::TOX_GRAPHIC, pOwnChapterNode ); + UpdateContent( SwTOXElement::Graphic, pOwnChapterNode ); if( !GetSequenceName().isEmpty() && !IsFromObjectNames() && (TOX_TABLES == SwTOXBase::GetType() || TOX_ILLUSTRATIONS == SwTOXBase::GetType() ) ) UpdateSequence( pOwnChapterNode ); - if( GetCreateType() & nsSwTOXElement::TOX_FRAME ) - UpdateContent( nsSwTOXElement::TOX_FRAME, pOwnChapterNode ); + if( GetCreateType() & SwTOXElement::Frame ) + UpdateContent( SwTOXElement::Frame, pOwnChapterNode ); if(TOX_AUTHORITIES == SwTOXBase::GetType()) UpdateAuthorities( aIntl ); @@ -1203,7 +1203,7 @@ void SwTOXBaseSection::UpdateOutline( const SwTextNode* pOwnChapterNode ) ( !IsFromChapter() || ::lcl_FindChapterNode( *pTextNd ) == pOwnChapterNode )) { - SwTOXPara * pNew = new SwTOXPara( *pTextNd, nsSwTOXElement::TOX_OUTLINELEVEL ); + SwTOXPara * pNew = new SwTOXPara( *pTextNd, SwTOXElement::OutlineLevel ); InsertSorted( pNew ); } } @@ -1227,7 +1227,7 @@ void SwTOXBaseSection::UpdateTemplate( const SwTextNode* pOwnChapterNode ) //TODO: no outline Collections in content indexes if OutlineLevels are already included if( !pColl || ( TOX_CONTENT == SwTOXBase::GetType() && - GetCreateType() & nsSwTOXElement::TOX_OUTLINELEVEL && + GetCreateType() & SwTOXElement::OutlineLevel && pColl->IsAssignedToListLevelOfOutlineStyle()) ) continue; @@ -1242,7 +1242,7 @@ void SwTOXBaseSection::UpdateTemplate( const SwTextNode* pOwnChapterNode ) ( !IsFromChapter() || pOwnChapterNode == ::lcl_FindChapterNode( *pTextNd ) ) ) { - SwTOXPara * pNew = new SwTOXPara( *pTextNd, nsSwTOXElement::TOX_TEMPLATE, i + 1 ); + SwTOXPara * pNew = new SwTOXPara( *pTextNd, SwTOXElement::Template, i + 1 ); InsertSorted(pNew); } } @@ -1277,7 +1277,7 @@ void SwTOXBaseSection::UpdateSequence( const SwTextNode* pOwnChapterNode ) const OUString sName = GetSequenceName() + OUStringLiteral1(cSequenceMarkSeparator) + OUString::number( rSeqField.GetSeqNumber() ); - SwTOXPara * pNew = new SwTOXPara( rTextNode, nsSwTOXElement::TOX_SEQUENCE, 1, sName ); + 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 ) { @@ -1394,7 +1394,7 @@ void SwTOXBaseSection::UpdateContent( SwTOXElement eMyType, SwContentNode* pCNd = nullptr; switch( eMyType ) { - case nsSwTOXElement::TOX_FRAME: + case SwTOXElement::Frame: if( !pNd->IsNoTextNode() ) { pCNd = pNd->GetContentNode(); @@ -1405,11 +1405,11 @@ void SwTOXBaseSection::UpdateContent( SwTOXElement eMyType, } } break; - case nsSwTOXElement::TOX_GRAPHIC: + case SwTOXElement::Graphic: if( pNd->IsGrfNode() ) pCNd = static_cast<SwContentNode*>(pNd); break; - case nsSwTOXElement::TOX_OLE: + case SwTOXElement::Ole: if( pNd->IsOLENode() ) { bool bInclude = true; diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index a0fd74689201..5bb30647c5df 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -423,7 +423,7 @@ OUString SwForm::GetFormText() {return OUString("<X>");} OUString SwForm::GetFormAuth() {return OUString("<A>");} SwTOXBase::SwTOXBase(const SwTOXType* pTyp, const SwForm& rForm, - sal_uInt16 nCreaType, const OUString& rTitle ) + SwTOXElement nCreaType, const OUString& rTitle ) : SwClient(const_cast<SwModify*>(static_cast<SwModify const *>(pTyp))) , m_aForm(rForm) , m_aTitle(rTitle) diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 65393a506fa6..32d8f70ccc02 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -496,9 +496,9 @@ TextAndReading SwTOXPara::GetText_Impl() const const SwContentNode* pNd = aTOXSources[0].pNd; switch( eType ) { - case nsSwTOXElement::TOX_SEQUENCE: - case nsSwTOXElement::TOX_TEMPLATE: - case nsSwTOXElement::TOX_OUTLINELEVEL: + case SwTOXElement::Sequence: + case SwTOXElement::Template: + case SwTOXElement::OutlineLevel: { return TextAndReading(static_cast<const SwTextNode*>(pNd)->GetExpandText( nStartIndex, @@ -508,9 +508,9 @@ TextAndReading SwTOXPara::GetText_Impl() const } break; - case nsSwTOXElement::TOX_OLE: - case nsSwTOXElement::TOX_GRAPHIC: - case nsSwTOXElement::TOX_FRAME: + case SwTOXElement::Ole: + case SwTOXElement::Graphic: + case SwTOXElement::Frame: { // Find the FlyFormat; the object/graphic name is there SwFrameFormat* pFly = pNd->GetFlyFormat(); @@ -518,9 +518,9 @@ TextAndReading SwTOXPara::GetText_Impl() const return TextAndReading(pFly->GetName(), OUString()); OSL_ENSURE( false, "Graphic/object without name" ); - sal_uInt16 nId = nsSwTOXElement::TOX_OLE == eType + sal_uInt16 nId = SwTOXElement::Ole == eType ? STR_OBJECT_DEFNAME - : nsSwTOXElement::TOX_GRAPHIC == eType + : SwTOXElement::Graphic == eType ? STR_GRAPHIC_DEFNAME : STR_FRAME_DEFNAME; return TextAndReading(SW_RESSTR( nId ), OUString()); @@ -533,7 +533,7 @@ TextAndReading SwTOXPara::GetText_Impl() const void SwTOXPara::FillText( SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) const { - if( nsSwTOXElement::TOX_TEMPLATE == eType || nsSwTOXElement::TOX_SEQUENCE == eType || nsSwTOXElement::TOX_OUTLINELEVEL == eType) + if( SwTOXElement::Template == eType || SwTOXElement::Sequence == eType || SwTOXElement::OutlineLevel == eType) { const SwTextNode* pSrc = static_cast<const SwTextNode*>(aTOXSources[0].pNd); pSrc->GetExpandText( rNd, &rInsPos, nStartIndex, @@ -551,7 +551,7 @@ sal_uInt16 SwTOXPara::GetLevel() const sal_uInt16 nRet = m_nLevel; const SwContentNode* pNd = aTOXSources[0].pNd; - if( nsSwTOXElement::TOX_OUTLINELEVEL == eType && pNd->GetTextNode() ) + if( SwTOXElement::OutlineLevel == eType && pNd->GetTextNode() ) { const int nTmp = static_cast<const SwTextNode*>(pNd)->GetAttrOutlineLevel(); if(nTmp != 0 ) @@ -566,8 +566,8 @@ OUString SwTOXPara::GetURL() const const SwContentNode* pNd = aTOXSources[0].pNd; switch( eType ) { - case nsSwTOXElement::TOX_TEMPLATE: - case nsSwTOXElement::TOX_OUTLINELEVEL: + case SwTOXElement::Template: + case SwTOXElement::OutlineLevel: { const SwTextNode * pTextNd = pNd->GetTextNode(); @@ -579,9 +579,9 @@ OUString SwTOXPara::GetURL() const } break; - case nsSwTOXElement::TOX_OLE: - case nsSwTOXElement::TOX_GRAPHIC: - case nsSwTOXElement::TOX_FRAME: + case SwTOXElement::Ole: + case SwTOXElement::Graphic: + case SwTOXElement::Frame: { // Find the FlyFormat; the object/graphic name is there SwFrameFormat* pFly = pNd->GetFlyFormat(); @@ -591,9 +591,9 @@ OUString SwTOXPara::GetURL() const const sal_Char* pStr; switch( eType ) { - case nsSwTOXElement::TOX_OLE: pStr = "ole"; break; - case nsSwTOXElement::TOX_GRAPHIC: pStr = "graphic"; break; - case nsSwTOXElement::TOX_FRAME: pStr = "frame"; break; + case SwTOXElement::Ole: pStr = "ole"; break; + case SwTOXElement::Graphic: pStr = "graphic"; break; + case SwTOXElement::Frame: pStr = "frame"; break; default: pStr = nullptr; } if( pStr ) @@ -601,7 +601,7 @@ OUString SwTOXPara::GetURL() const } } break; - case nsSwTOXElement::TOX_SEQUENCE: + case SwTOXElement::Sequence: { aText = "#" + m_sSequenceName + OUStringLiteral1(cMarkSeparator) + "sequence"; diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 453f0eb617ed..c842f969feaa 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -109,6 +109,16 @@ throw (lang::IllegalArgumentException) } static void +lcl_AnyToBitMask(uno::Any const& rValue, + SwTOXElement & rBitMask, const SwTOXElement nBit) +throw (lang::IllegalArgumentException) +{ + rBitMask = lcl_AnyToBool(rValue) + ? (rBitMask | nBit) + : (rBitMask & ~nBit); +} + +static void lcl_BitMaskToAny(uno::Any & o_rValue, const sal_uInt16 nBitMask, const sal_uInt16 nBit) { @@ -117,6 +127,13 @@ lcl_BitMaskToAny(uno::Any & o_rValue, } static void +lcl_BitMaskToAny(uno::Any & o_rValue, + const SwTOXElement nBitMask, const SwTOXElement nBit) +{ + o_rValue <<= bool(nBitMask & nBit); +} + +static void lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName) { const sal_uInt16 nUserCount = pDoc->GetTOXTypeCount( TOX_USER ); @@ -290,7 +307,7 @@ SwDocIndexDescriptorProperties_Impl::SwDocIndexDescriptorProperties_Impl( { SwForm aForm(pType->GetType()); m_pTOXBase.reset(new SwTOXBase(pType, aForm, - nsSwTOXElement::TOX_MARK, pType->GetTypeName())); + SwTOXElement::Mark, pType->GetTypeName())); if(pType->GetType() == TOX_CONTENT || pType->GetType() == TOX_USER) { m_pTOXBase->SetLevel(MAXLEVEL); @@ -576,7 +593,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, SwSectionFormat *const pSectionFormat(m_pImpl->GetSectionFormat()); SwTOXBase & rTOXBase( m_pImpl->GetTOXSectionOrThrow() ); - sal_uInt16 nCreate = rTOXBase.GetCreateType(); + SwTOXElement nCreate = rTOXBase.GetCreateType(); sal_uInt16 nOLEOptions = rTOXBase.GetOLEOptions(); const TOXTypes eTxBaseType = rTOXBase.GetTOXType()->GetType(); sal_uInt16 nTOIOptions = (eTxBaseType == TOX_INDEX) @@ -657,36 +674,36 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, case WID_TOC_BOOKMARK: { rTOXBase.SetBookmarkName(lcl_AnyToString(rValue)); - nCreate = nsSwTOXElement::TOX_BOOKMARK; + nCreate = SwTOXElement::Bookmark; rTOXBase.SetCreate(nCreate); } break; case WID_INDEX_ENTRY_TYPE: { rTOXBase.SetEntryTypeName(lcl_AnyToString(rValue)); - nCreate = nsSwTOXElement::TOX_INDEX_ENTRY_TYPE; + nCreate = SwTOXElement::IndexEntryType; rTOXBase.SetCreate(nCreate); } break; case WID_CREATE_FROM_MARKS: - lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_MARK); + lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::Mark); break; case WID_CREATE_FROM_OUTLINE: - lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_OUTLINELEVEL); + lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::OutlineLevel); break; case WID_TOC_PARAGRAPH_OUTLINE_LEVEL: - lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_PARAGRAPH_OUTLINE_LEVEL); + lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::ParagraphOutlineLevel); break; case WID_TAB_IN_TOC: - lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_TAB_IN_TOC); + lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::TableInToc); break; case WID_TOC_NEWLINE: - lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_NEWLINE); + lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::Newline); break; // case WID_PARAGRAPH_STYLE_NAMES :OSL_FAIL("not implemented") // break; case WID_HIDE_TABLEADER_PAGENUMBERS: - lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_TABLEADER); + lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::TableLeader); break ; case WID_CREATE_FROM_CHAPTER: rTOXBase.SetFromChapter(lcl_AnyToBool(rValue)); @@ -775,16 +792,16 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, } break; case WID_CREATE_FROM_TABLES: - lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_TABLE); + lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::Table); break; case WID_CREATE_FROM_TEXT_FRAMES: - lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_FRAME); + lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::Frame); break; case WID_CREATE_FROM_GRAPHIC_OBJECTS: - lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_GRAPHIC); + lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::Graphic); break; case WID_CREATE_FROM_EMBEDDED_OBJECTS: - lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_OLE); + lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::Ole); break; case WID_CREATE_FROM_STAR_MATH: lcl_AnyToBitMask(rValue, nOLEOptions, nsSwTOOElements::TOO_MATH); @@ -826,7 +843,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, } break; case WID_CREATE_FROM_PARAGRAPH_STYLES: - lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_TEMPLATE); + lcl_AnyToBitMask(rValue, nCreate, SwTOXElement::Template); break; case WID_PARA_LEV1: @@ -914,7 +931,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, } if(pTOXBase) { - const sal_uInt16 nCreate = pTOXBase->GetCreateType(); + const SwTOXElement nCreate = pTOXBase->GetCreateType(); const sal_uInt16 nOLEOptions = pTOXBase->GetOLEOptions(); const sal_uInt16 nTOIOptions = (pTOXBase->GetTOXType()->GetType() == TOX_INDEX) @@ -983,11 +1000,11 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, aRet <<= pTOXBase->GetEntryTypeName(); break; case WID_CREATE_FROM_MARKS: - lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_MARK); + lcl_BitMaskToAny(aRet, nCreate, SwTOXElement::Mark); break; case WID_CREATE_FROM_OUTLINE: lcl_BitMaskToAny(aRet, nCreate, - nsSwTOXElement::TOX_OUTLINELEVEL); + SwTOXElement::OutlineLevel); break; case WID_CREATE_FROM_CHAPTER: { @@ -1108,16 +1125,16 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, } break; case WID_CREATE_FROM_TABLES: - lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_TABLE); + lcl_BitMaskToAny(aRet, nCreate, SwTOXElement::Table); break; case WID_CREATE_FROM_TEXT_FRAMES: - lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_FRAME); + lcl_BitMaskToAny(aRet, nCreate, SwTOXElement::Frame); break; case WID_CREATE_FROM_GRAPHIC_OBJECTS: - lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_GRAPHIC); + lcl_BitMaskToAny(aRet, nCreate, SwTOXElement::Graphic); break; case WID_CREATE_FROM_EMBEDDED_OBJECTS: - lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_OLE); + lcl_BitMaskToAny(aRet, nCreate, SwTOXElement::Ole); break; case WID_CREATE_FROM_STAR_MATH: lcl_BitMaskToAny(aRet, nOLEOptions, nsSwTOOElements::TOO_MATH); @@ -1136,7 +1153,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, lcl_BitMaskToAny(aRet, nOLEOptions, nsSwTOOElements::TOO_OTHER); break; case WID_CREATE_FROM_PARAGRAPH_STYLES: - lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_TEMPLATE); + lcl_BitMaskToAny(aRet, nCreate, SwTOXElement::Template); break; case WID_PARA_HEAD: { diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 400f7f50b2e4..6b900ee42055 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -1964,7 +1964,7 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) if (nsSwTOIOptions::TOI_ALPHA_DELIMITTER & pTOX->GetOptions()) sStr += "\\h \"A\" "; - if(nsSwTOXElement::TOX_INDEX_ENTRY_TYPE & pTOX->GetCreateType()) + if(SwTOXElement::IndexEntryType & pTOX->GetCreateType()) { sStr += "\\f "; OUString sName = pTOX->GetEntryTypeName(); @@ -2040,21 +2040,21 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) if( !nTOXLvl ) ++nTOXLvl; - if(nsSwTOXElement::TOX_TABLEADER & pTOX->GetCreateType()) + if(SwTOXElement::TableLeader & pTOX->GetCreateType()) { sStr +="\\z " ; GetExport( ).m_bHideTabLeaderAndPageNumbers = true ; } - if(nsSwTOXElement::TOX_TAB_IN_TOC & pTOX->GetCreateType()) + if(SwTOXElement::TableInToc & pTOX->GetCreateType()) { sStr +="\\w " ; GetExport( ).m_bTabInTOC = true ; } - if(nsSwTOXElement::TOX_NEWLINE & pTOX->GetCreateType()) + if(SwTOXElement::Newline & pTOX->GetCreateType()) { sStr +="\\x " ; } - if( nsSwTOXElement::TOX_MARK & pTOX->GetCreateType() ) + if( SwTOXElement::Mark & pTOX->GetCreateType() ) { sStr += "\\f "; @@ -2065,7 +2065,7 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) sStr += sEntryEnd; } } - if(nsSwTOXElement::TOX_BOOKMARK & pTOX->GetCreateType()) + if(SwTOXElement::Bookmark & pTOX->GetCreateType()) { sStr += "\\b "; OUString bName = pTOX->GetBookmarkName(); @@ -2073,7 +2073,7 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) sStr += sEntryEnd; } - if( nsSwTOXElement::TOX_OUTLINELEVEL & pTOX->GetCreateType() ) + if( SwTOXElement::OutlineLevel & pTOX->GetCreateType() ) { // Take the TOC value of the max level to evaluate to as // the starting point for the \o flag, but reduce it to the @@ -2149,12 +2149,12 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) } } - if( nsSwTOXElement::TOX_PARAGRAPH_OUTLINE_LEVEL & pTOX->GetCreateType() ) + if( SwTOXElement::ParagraphOutlineLevel & pTOX->GetCreateType() ) { sStr +="\\u " ; } - if( nsSwTOXElement::TOX_TEMPLATE & pTOX->GetCreateType() ) + if( SwTOXElement::Template & pTOX->GetCreateType() ) { // #i99641# - Consider additional styles regardless of TOX-outlinelevel for( n = 0; n < MAXLEVEL; ++n ) diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 3bb5a56a5545..2f761c52ec1d 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2783,7 +2783,7 @@ static void EnsureMaxLevelForTemplates(SwTOXBase& rBase) //all styles above that level, while word just cuts off the "standard" //outline styles, we have no option but to expand to the highest level //Word included. - if ((rBase.GetLevel() != MAXLEVEL) && (nsSwTOXElement::TOX_TEMPLATE & rBase.GetCreateType())) + if ((rBase.GetLevel() != MAXLEVEL) && (SwTOXElement::Template & rBase.GetCreateType())) { for (sal_uInt16 nI = MAXLEVEL; nI > 0; --nI) { @@ -2931,7 +2931,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) break; } - sal_uInt16 nCreateOf = (eTox == TOX_CONTENT) ? nsSwTOXElement::TOX_OUTLINELEVEL : nsSwTOXElement::TOX_MARK; + SwTOXElement nCreateOf = (eTox == TOX_CONTENT) ? SwTOXElement::OutlineLevel : SwTOXElement::Mark; sal_uInt16 nIndexCols = 1; @@ -2944,7 +2944,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) { sal_uInt16 eOptions = nsSwTOIOptions::TOI_SAME_ENTRY | nsSwTOIOptions::TOI_CASE_SENSITIVE; - // TOX_OUTLINELEVEL setzen wir genau dann, wenn + // SwTOXElement::OutlineLevel setzen wir genau dann, wenn // die Parameter \o in 1 bis 9 liegen // oder der Parameter \f existiert // oder GARKEINE Switches Parameter angegeben sind. @@ -3041,11 +3041,11 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) { bool bIsHyperlink = false; bool bShowPage = true; - // TOX_OUTLINELEVEL setzen wir genau dann, wenn + // SwTOXElement::OutlineLevel setzen wir genau dann, wenn // die Parameter \o in 1 bis 9 liegen // oder der Parameter \f existiert // oder GARKEINE Switches Parameter angegeben sind. - sal_uInt16 eCreateFrom = 0; + SwTOXElement eCreateFrom = SwTOXElement::NONE; sal_Int32 nMaxLevel = 0; WW8ReadFieldParams aReadParam( rStr ); for (;;) @@ -3072,11 +3072,11 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) nVal = lcl_GetMaxValidWordTOCLevel(aOrigForm); if( nMaxLevel < nVal ) nMaxLevel = nVal; - eCreateFrom |= nsSwTOXElement::TOX_OUTLINELEVEL; + eCreateFrom |= SwTOXElement::OutlineLevel; } break; case 'f': - eCreateFrom |= nsSwTOXElement::TOX_MARK; + eCreateFrom |= SwTOXElement::Mark; break; case 'l': { @@ -3085,14 +3085,14 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) { if( nMaxLevel < nVal ) nMaxLevel = nVal; - eCreateFrom |= nsSwTOXElement::TOX_MARK; + eCreateFrom |= SwTOXElement::Mark; } } break; case 't': // paragraphs using special styles shall // provide the TOX's content lcl_toxMatchTSwitch(*this, *pBase, aReadParam); - eCreateFrom |= nsSwTOXElement::TOX_TEMPLATE; + eCreateFrom |= SwTOXElement::Template; break; case 'p': { @@ -3254,8 +3254,8 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) { //If we would be created from outlines, either explicitly or by default //then see if we need extra styles added to the outlines - sal_uInt16 eEffectivelyFrom = eCreateFrom ? eCreateFrom : nsSwTOXElement::TOX_OUTLINELEVEL; - if (eEffectivelyFrom & nsSwTOXElement::TOX_OUTLINELEVEL) + SwTOXElement eEffectivelyFrom = eCreateFrom != SwTOXElement::NONE ? eCreateFrom : SwTOXElement::OutlineLevel; + if (eEffectivelyFrom & SwTOXElement::OutlineLevel) { // #i19683# Insert a text token " " between the number and entry token. // In an ideal world we could handle the tab stop between the number and @@ -3297,15 +3297,15 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) } } - if (eCreateFrom) + if (eCreateFrom != SwTOXElement::NONE) pBase->SetCreate(eCreateFrom); EnsureMaxLevelForTemplates(*pBase); } break; case TOX_ILLUSTRATIONS: { - if( !eCreateFrom ) - eCreateFrom = nsSwTOXElement::TOX_SEQUENCE; + if( eCreateFrom == SwTOXElement::NONE ) + eCreateFrom = SwTOXElement::Sequence; pBase->SetCreate( eCreateFrom ); /* diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index 8ad638ee0210..4794db831d84 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -203,10 +203,10 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( lcl_SetProp(xInfo, xIdxProps, UNO_NAME_TITLE, *rDesc.GetTitle()); //stylenames - sal_uInt16 nContentOptions = rDesc.GetContentOptions(); + SwTOXElement nContentOptions = rDesc.GetContentOptions(); if(xInfo->hasPropertyByName(UNO_NAME_LEVEL_PARAGRAPH_STYLES)) { - bool bOn = 0!=(nContentOptions&nsSwTOXElement::TOX_TEMPLATE ); + bool bOn( nContentOptions&SwTOXElement::Template ); uno::Any aStyleNames(xIdxProps->getPropertyValue(UNO_NAME_LEVEL_PARAGRAPH_STYLES)); uno::Reference< container::XIndexReplace > xAcc; aStyleNames >>= xAcc; @@ -227,17 +227,17 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( } } lcl_SetProp(xInfo, xIdxProps, UNO_NAME_LEVEL, (sal_Int16)rDesc.GetLevel()); - lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_MARKS, 0!=(nContentOptions&nsSwTOXElement::TOX_MARK )); - lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_OUTLINE, 0!=(nContentOptions&nsSwTOXElement::TOX_OUTLINELEVEL)); - lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_EMBEDDED_OBJECTS,0!=(nContentOptions&nsSwTOXElement::TOX_OLE )); - lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_TABLES , 0!=(nContentOptions&nsSwTOXElement::TOX_TABLE )); - lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_GRAPHIC_OBJECTS, 0!=(nContentOptions&nsSwTOXElement::TOX_GRAPHIC )); - lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_TEXT_FRAMES, 0!=(nContentOptions&nsSwTOXElement::TOX_FRAME )); - lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_LABELS, 0!=(nContentOptions&nsSwTOXElement::TOX_SEQUENCE )); - lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_HIDE_TAB_LEADER_AND_PAGE_NUMBERS, 0!=(nContentOptions&nsSwTOXElement::TOX_TABLEADER )); - lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_TAB_IN_TOC, 0!=(nContentOptions&nsSwTOXElement::TOX_TAB_IN_TOC )); - lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_TOC_NEWLINE, 0!=(nContentOptions&nsSwTOXElement::TOX_NEWLINE)); - lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_TOC_PARAGRAPH_OUTLINE_LEVEL, 0!=(nContentOptions&nsSwTOXElement::TOX_PARAGRAPH_OUTLINE_LEVEL)); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_MARKS, bool(nContentOptions & SwTOXElement::Mark )); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_OUTLINE, bool(nContentOptions & SwTOXElement::OutlineLevel)); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_EMBEDDED_OBJECTS,bool(nContentOptions & SwTOXElement::Ole )); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_TABLES , bool(nContentOptions & SwTOXElement::Table )); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_GRAPHIC_OBJECTS, bool(nContentOptions & SwTOXElement::Graphic )); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_TEXT_FRAMES, bool(nContentOptions & SwTOXElement::Frame )); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_LABELS, bool(nContentOptions & SwTOXElement::Sequence )); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_HIDE_TAB_LEADER_AND_PAGE_NUMBERS, bool(nContentOptions & SwTOXElement::TableLeader )); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_TAB_IN_TOC, bool(nContentOptions & SwTOXElement::TableInToc )); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_TOC_NEWLINE, bool(nContentOptions & SwTOXElement::Newline)); + lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_TOC_PARAGRAPH_OUTLINE_LEVEL, bool(nContentOptions & SwTOXElement::ParagraphOutlineLevel)); lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_CREATE_FROM_CHAPTER, rDesc.IsFromChapter()); lcl_SetBOOLProp(xInfo, xIdxProps, UNO_NAME_IS_PROTECTED, rDesc.IsReadonly()); diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 450b5c21299e..a8c3ef357f95 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1049,7 +1049,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription() if(aCurType.eType != TOX_INDEX) m_pLevelNF->SetValue(rDesc.GetLevel()); //content, user - sal_uInt16 nCreateType = rDesc.GetContentOptions(); + SwTOXElement nCreateType = rDesc.GetContentOptions(); //user + content bool bHasStyleNames = false; @@ -1060,22 +1060,22 @@ void SwTOXSelectTabPage::ApplyTOXDescription() bHasStyleNames = true; break; } - m_pAddStylesCB->Check(bHasStyleNames && (nCreateType & nsSwTOXElement::TOX_TEMPLATE)); + m_pAddStylesCB->Check(bHasStyleNames && (nCreateType & SwTOXElement::Template)); - m_pFromOLECB-> Check( 0 != (nCreateType & nsSwTOXElement::TOX_OLE) ); - m_pFromTablesCB-> Check( 0 != (nCreateType & nsSwTOXElement::TOX_TABLE) ); - m_pFromGraphicsCB->Check( 0 != (nCreateType & nsSwTOXElement::TOX_GRAPHIC) ); - m_pFromFramesCB-> Check( 0 != (nCreateType & nsSwTOXElement::TOX_FRAME) ); + m_pFromOLECB-> Check( bool(nCreateType & SwTOXElement::Ole) ); + m_pFromTablesCB-> Check( bool(nCreateType & SwTOXElement::Table) ); + m_pFromGraphicsCB->Check( bool(nCreateType & SwTOXElement::Graphic) ); + m_pFromFramesCB-> Check( bool(nCreateType & SwTOXElement::Frame) ); m_pLevelFromChapterCB->Check(rDesc.IsLevelFromChapter()); //all but illustration and table - m_pTOXMarksCB->Check( 0 != (nCreateType & nsSwTOXElement::TOX_MARK) ); + m_pTOXMarksCB->Check( bool(nCreateType & SwTOXElement::Mark) ); //content if(TOX_CONTENT == aCurType.eType) { - m_pFromHeadingsCB->Check( 0 != (nCreateType & nsSwTOXElement::TOX_OUTLINELEVEL) ); + m_pFromHeadingsCB->Check( bool(nCreateType & SwTOXElement::OutlineLevel) ); m_pAddStylesCB->SetText(sAddStyleContent); m_pAddStylesPB->Enable(m_pAddStylesCB->IsChecked()); } @@ -1149,34 +1149,34 @@ void SwTOXSelectTabPage::FillTOXDescription() SwTOXDescription& rDesc = pTOXDlg->GetTOXDescription(aCurType); rDesc.SetTitle(m_pTitleED->GetText()); rDesc.SetFromChapter(1 == m_pAreaLB->GetSelectEntryPos()); - sal_uInt16 nContentOptions = 0; + SwTOXElement nContentOptions = SwTOXElement::NONE; if(m_pTOXMarksCB->IsVisible() && m_pTOXMarksCB->IsChecked()) - nContentOptions |= nsSwTOXElement::TOX_MARK; + nContentOptions |= SwTOXElement::Mark; sal_uInt16 nIndexOptions = rDesc.GetIndexOptions()&nsSwTOIOptions::TOI_ALPHA_DELIMITTER; switch(rDesc.GetTOXType()) { case TOX_CONTENT: if(m_pFromHeadingsCB->IsChecked()) - nContentOptions |= nsSwTOXElement::TOX_OUTLINELEVEL; + nContentOptions |= SwTOXElement::OutlineLevel; break; case TOX_USER: { rDesc.SetTOUName(m_pTypeLB->GetSelectEntry()); if(m_pFromOLECB->IsChecked()) - nContentOptions |= nsSwTOXElement::TOX_OLE; + nContentOptions |= SwTOXElement::Ole; if(m_pFromTablesCB->IsChecked()) - nContentOptions |= nsSwTOXElement::TOX_TABLE; + nContentOptions |= SwTOXElement::Table; if(m_pFromFramesCB->IsChecked()) - nContentOptions |= nsSwTOXElement::TOX_FRAME; + nContentOptions |= SwTOXElement::Frame; if(m_pFromGraphicsCB->IsChecked()) - nContentOptions |= nsSwTOXElement::TOX_GRAPHIC; + nContentOptions |= SwTOXElement::Graphic; } break; case TOX_INDEX: { - nContentOptions = nsSwTOXElement::TOX_MARK; + nContentOptions = SwTOXElement::Mark; if(m_pCollectSameCB->IsChecked()) nIndexOptions |= nsSwTOIOptions::TOI_SAME_ENTRY; @@ -1233,11 +1233,11 @@ void SwTOXSelectTabPage::FillTOXDescription() rDesc.SetLevelFromChapter( m_pLevelFromChapterCB->IsVisible() && m_pLevelFromChapterCB->IsChecked()); if(m_pTOXMarksCB->IsChecked() && m_pTOXMarksCB->IsVisible()) - nContentOptions |= nsSwTOXElement::TOX_MARK; + nContentOptions |= SwTOXElement::Mark; if(m_pFromHeadingsCB->IsChecked() && m_pFromHeadingsCB->IsVisible()) - nContentOptions |= nsSwTOXElement::TOX_OUTLINELEVEL; + nContentOptions |= SwTOXElement::OutlineLevel; if(m_pAddStylesCB->IsChecked() && m_pAddStylesCB->IsVisible()) - nContentOptions |= nsSwTOXElement::TOX_TEMPLATE; + nContentOptions |= SwTOXElement::Template; rDesc.SetContentOptions(nContentOptions); rDesc.SetIndexOptions(nIndexOptions); diff --git a/sw/source/uibase/inc/toxmgr.hxx b/sw/source/uibase/inc/toxmgr.hxx index 93a30e1d5135..b73d39547c2a 100644 --- a/sw/source/uibase/inc/toxmgr.hxx +++ b/sw/source/uibase/inc/toxmgr.hxx @@ -39,7 +39,7 @@ class SW_DLLPUBLIC SwTOXDescription OUString* m_pTitle; OUString* m_pTOUName; SwForm* m_pForm; - sal_uInt16 m_nContent; + SwTOXElement m_nContent; sal_uInt16 m_nIndexOptions; sal_uInt16 m_nOLEOptions; LanguageType m_eLanguage; @@ -71,7 +71,7 @@ public: m_pTitle(nullptr), m_pTOUName(nullptr), m_pForm(nullptr), - m_nContent(nsSwTOXElement::TOX_MARK | nsSwTOXElement::TOX_OUTLINELEVEL), + m_nContent(SwTOXElement::Mark | SwTOXElement::OutlineLevel), m_nIndexOptions(nsSwTOIOptions::TOI_SAME_ENTRY|nsSwTOIOptions::TOI_FF|nsSwTOIOptions::TOI_CASE_SENSITIVE), m_nOLEOptions(0), m_eLanguage((LanguageType)::GetAppLanguage()), @@ -110,11 +110,11 @@ public: void SetForm(const SwForm& rSet) {delete m_pForm; m_pForm = new SwForm(rSet);} const SwForm* GetForm() const {return m_pForm;} - void SetContentOptions(sal_uInt16 nSet) { m_nContent = nSet;} - sal_uInt16 GetContentOptions() const { return m_nContent;} + void SetContentOptions(SwTOXElement nSet) { m_nContent = nSet;} + SwTOXElement GetContentOptions() const { return m_nContent;} void SetIndexOptions(sal_uInt16 nSet) { m_nIndexOptions = nSet;} - sal_uInt16 GetIndexOptions() const { return m_nIndexOptions;} + sal_uInt16 GetIndexOptions() const { return m_nIndexOptions;} const OUString& GetMainEntryCharStyle() const {return m_sMainEntryCharStyle;} void SetMainEntryCharStyle(const OUString& rSet) {m_sMainEntryCharStyle = rSet;} diff --git a/sw/source/uibase/index/toxmgr.cxx b/sw/source/uibase/index/toxmgr.cxx index b82d86da089a..067c0690af18 100644 --- a/sw/source/uibase/index/toxmgr.cxx +++ b/sw/source/uibase/index/toxmgr.cxx @@ -291,7 +291,7 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc, { const SwTOXType* pType = pSh->GetTOXType(eCurTOXType, 0); SwForm aForm(eCurTOXType); - pNewTOX = new SwTOXBase(pType, aForm, nsSwTOXElement::TOX_MARK, pType->GetTypeName()); + pNewTOX = new SwTOXBase(pType, aForm, SwTOXElement::Mark, pType->GetTypeName()); } pNewTOX->SetOptions(rDesc.GetIndexOptions()); pNewTOX->SetMainEntryCharStyle(rDesc.GetMainEntryCharStyle()); @@ -376,7 +376,8 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc, SwForm aForm(eCurTOXType); pNewTOX = new SwTOXBase( pType, aForm, - TOX_AUTHORITIES == eCurTOXType ? nsSwTOXElement::TOX_MARK : 0, pType->GetTypeName()); + TOX_AUTHORITIES == eCurTOXType ? SwTOXElement::Mark : SwTOXElement::NONE, + pType->GetTypeName()); } else { |