diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-18 12:14:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-19 08:35:42 +0200 |
commit | 0035573ee7798cdf54ef44a54306a0515eeb90a7 (patch) | |
tree | 29f89470e725120dbb6378a64ab0bf01970ecf89 /sc | |
parent | 694f3ed0825d75bf855a74b2294ba0ff370afbb6 (diff) |
convert SFXSTYLEBIT to scoped enum
drop SFXSTYLEBIT_HIERARCHY because it has no overlap with these values,
it's used an extra bit in
SfxCommonTemplateDialog_Impl::LoadFactoryStyleFilter
Change-Id: I8ee5ecb9b5f8d2087d8eedd1f5526260ec1e4018
Reviewed-on: https://gerrit.libreoffice.org/53089
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/scstyles.hrc | 22 | ||||
-rw-r--r-- | sc/inc/stlpool.hxx | 4 | ||||
-rw-r--r-- | sc/inc/stlsheet.hxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/attarray.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen8.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/dpoutput.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/patattr.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/stlpool.cxx | 16 | ||||
-rw-r--r-- | sc/source/core/data/stlsheet.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xistyle.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/ftools/ftools.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/stylesbuffer.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlfonte.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/undo/undostyl.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/styleuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 8 |
16 files changed, 39 insertions, 41 deletions
diff --git a/sc/inc/scstyles.hrc b/sc/inc/scstyles.hrc index 08919cfbc44f..fcc78b9258de 100644 --- a/sc/inc/scstyles.hrc +++ b/sc/inc/scstyles.hrc @@ -24,21 +24,21 @@ #define NC_(Context, String) (Context "\004" u8##String) -const std::pair<const char*, int> RID_CELLSTYLEFAMILY[] = +const std::pair<const char*, SfxStyleSearchBits> RID_CELLSTYLEFAMILY[] = { - { NC_("RID_CELLSTYLEFAMILY", "All Styles") , SFXSTYLEBIT_ALL_VISIBLE }, - { NC_("RID_CELLSTYLEFAMILY", "Hidden Styles") , SFXSTYLEBIT_HIDDEN }, - { NC_("RID_CELLSTYLEFAMILY", "Applied Styles") , SFXSTYLEBIT_USED }, - { NC_("RID_CELLSTYLEFAMILY", "Custom Styles") , SFXSTYLEBIT_USERDEF }, - { nullptr, 0 } + { NC_("RID_CELLSTYLEFAMILY", "All Styles") , SfxStyleSearchBits::AllVisible }, + { NC_("RID_CELLSTYLEFAMILY", "Hidden Styles") , SfxStyleSearchBits::Hidden }, + { NC_("RID_CELLSTYLEFAMILY", "Applied Styles") , SfxStyleSearchBits::Used }, + { NC_("RID_CELLSTYLEFAMILY", "Custom Styles") , SfxStyleSearchBits::UserDefined }, + { nullptr, SfxStyleSearchBits::Auto } }; -const std::pair<const char*, int> RID_PAGESTYLEFAMILY[] = +const std::pair<const char*, SfxStyleSearchBits> RID_PAGESTYLEFAMILY[] = { - { NC_("RID_PAGESTYLEFAMILY", "All Styles") , SFXSTYLEBIT_ALL }, - { NC_("RID_PAGESTYLEFAMILY", "Hidden Styles") , SFXSTYLEBIT_HIDDEN }, - { NC_("RID_PAGESTYLEFAMILY", "Custom Styles") , SFXSTYLEBIT_USERDEF }, - { nullptr, 0 } + { NC_("RID_PAGESTYLEFAMILY", "All Styles") , SfxStyleSearchBits::All }, + { NC_("RID_PAGESTYLEFAMILY", "Hidden Styles") , SfxStyleSearchBits::Hidden }, + { NC_("RID_PAGESTYLEFAMILY", "Custom Styles") , SfxStyleSearchBits::UserDefined }, + { nullptr, SfxStyleSearchBits::Auto } }; #endif diff --git a/sc/inc/stlpool.hxx b/sc/inc/stlpool.hxx index 1c5d40d5f542..b9c00aaa049c 100644 --- a/sc/inc/stlpool.hxx +++ b/sc/inc/stlpool.hxx @@ -54,7 +54,7 @@ public: ScStyleSheet* FindCaseIns( const OUString& rName, SfxStyleFamily eFam ); virtual SfxStyleSheetBase& Make( const OUString&, SfxStyleFamily eFam, - sal_uInt16 nMask = SFXSTYLEBIT_ALL) override; + SfxStyleSearchBits nMask = SfxStyleSearchBits::All) override; void setAllStandard(); @@ -65,7 +65,7 @@ protected: virtual SfxStyleSheetBase* Create( const OUString& rName, SfxStyleFamily eFamily, - sal_uInt16 nMask) override; + SfxStyleSearchBits nMask) override; virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& rStyle ) override; private: diff --git a/sc/inc/stlsheet.hxx b/sc/inc/stlsheet.hxx index cab2e9759702..a30efdc7a19d 100644 --- a/sc/inc/stlsheet.hxx +++ b/sc/inc/stlsheet.hxx @@ -24,8 +24,6 @@ #include "scdllapi.h" -#define SCSTYLEBIT_STANDARD 0x0001 - class ScStyleSheetPool; class ScStyleSheet final : public SfxStyleSheet @@ -61,7 +59,7 @@ private: ScStyleSheet( const OUString& rName, const ScStyleSheetPool& rPool, SfxStyleFamily eFamily, - sal_uInt16 nMask ); + SfxStyleSearchBits nMask ); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 83f101e53750..c66fa7e8aa5e 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1811,7 +1811,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBo pDocument->GetStyleSheetPool()-> Find( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SfxStyleFamily::Para, - SFXSTYLEBIT_AUTO | SCSTYLEBIT_STANDARD ) ) ); + SfxStyleSearchBits::Auto | SfxStyleSearchBits::ScStandard ) ) ); mvData[nPos].pPattern = static_cast<const ScPatternAttr*>( &pDocument->GetPool()->Put(*pNewPattern)); pNewPattern.reset(); diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index a379c04d108e..eca15e8b9c32 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -485,7 +485,7 @@ class IdleCalcTextWidthScope MapMode maOldMapMode; sal_uInt64 mnStartTime; ScStyleSheetPool* mpStylePool; - sal_uInt16 mnOldSearchMask; + SfxStyleSearchBits mnOldSearchMask; SfxStyleFamily meOldFamily; bool mbNeedMore; bool mbProgress; diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 5c584944e20f..ee3f6d227aae 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -297,7 +297,7 @@ void lcl_SetStyleById(ScDocument* pDoc, SCTAB nTab, // create new style (was in ScPivot::SetStyle) pStyle = static_cast<ScStyleSheet*>( &pStlPool->Make( aStyleName, SfxStyleFamily::Para, - SFXSTYLEBIT_USERDEF ) ); + SfxStyleSearchBits::UserDefined ) ); pStyle->SetParent( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); SfxItemSet& rSet = pStyle->GetItemSet(); if (strcmp(pStrId, STR_PIVOT_STYLENAME_RESULT) == 0 || strcmp(pStrId, STR_PIVOT_STYLENAME_TITLE) == 0){ diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index c3bbe97a772c..d8989b6245f7 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -958,7 +958,7 @@ static SfxStyleSheetBase* lcl_CopyStyleToPool const OUString aStrParent = pSrcStyle->GetParent(); const SfxItemSet& rSrcSet = pSrcStyle->GetItemSet(); - pDestStyle = &pDestPool->Make( aStrSrcStyle, eFamily, SFXSTYLEBIT_USERDEF ); + pDestStyle = &pDestPool->Make( aStrSrcStyle, eFamily, SfxStyleSearchBits::UserDefined ); SfxItemSet& rDestSet = pDestStyle->GetItemSet(); rDestSet.Put( rSrcSet ); @@ -1172,7 +1172,7 @@ void ScPatternAttr::UpdateStyleSheet(const ScDocument* pDoc) // Assumes that "Standard" is always the 1st entry! if (!pStyle) { - std::shared_ptr<SfxStyleSheetIterator> pIter = pDoc->GetStyleSheetPool()->CreateIterator( SfxStyleFamily::Para, SFXSTYLEBIT_ALL ); + std::shared_ptr<SfxStyleSheetIterator> pIter = pDoc->GetStyleSheetPool()->CreateIterator( SfxStyleFamily::Para, SfxStyleSearchBits::All ); pStyle = dynamic_cast< ScStyleSheet* >(pIter->First()); } diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 6075f553ef79..586ecbad9276 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -76,7 +76,7 @@ void ScStyleSheetPool::SetDocument( ScDocument* pDocument ) } SfxStyleSheetBase& ScStyleSheetPool::Make( const OUString& rName, - SfxStyleFamily eFam, sal_uInt16 mask) + SfxStyleFamily eFam, SfxStyleSearchBits mask) { // When updating styles from a template, Office 5.1 sometimes created // files with multiple default styles. @@ -101,7 +101,7 @@ SfxStyleSheetBase& ScStyleSheetPool::Make( const OUString& rName, SfxStyleSheetBase* ScStyleSheetPool::Create( const OUString& rName, SfxStyleFamily eFamily, - sal_uInt16 nMaskP ) + SfxStyleSearchBits nMaskP ) { ScStyleSheet* pSheet = new ScStyleSheet( rName, *this, eFamily, nMaskP ); if ( eFamily == SfxStyleFamily::Para && ScGlobal::GetRscString(STR_STYLENAME_STANDARD) != rName ) @@ -120,8 +120,8 @@ void ScStyleSheetPool::Remove( SfxStyleSheetBase* pStyle ) { if ( pStyle ) { - OSL_ENSURE( IS_SET( SFXSTYLEBIT_USERDEF, pStyle->GetMask() ), - "SFXSTYLEBIT_USERDEF not set!" ); + OSL_ENSURE( IS_SET( SfxStyleSearchBits::UserDefined, pStyle->GetMask() ), + "SfxStyleSearchBits::UserDefined not set!" ); static_cast<ScDocumentPool&>(rPool).StyleDeleted(static_cast<ScStyleSheet*>(pStyle)); SfxStyleSheetPool::Remove(pStyle); @@ -238,7 +238,7 @@ void ScStyleSheetPool::CreateStandardStyles() // 1. Standard - pSheet = static_cast<ScStyleSheet*>( &Make( aStrStandard, SfxStyleFamily::Para, SCSTYLEBIT_STANDARD ) ); + pSheet = static_cast<ScStyleSheet*>( &Make( aStrStandard, SfxStyleFamily::Para, SfxStyleSearchBits::ScStandard ) ); pSheet->SetHelpId( aHelpFile, HID_SC_SHEET_CELL_STD ); // if default fonts for the document's languages are different from the pool default, @@ -274,7 +274,7 @@ void ScStyleSheetPool::CreateStandardStyles() pSheet = static_cast<ScStyleSheet*>( &Make( aStrStandard, SfxStyleFamily::Page, - SCSTYLEBIT_STANDARD ) ); + SfxStyleSearchBits::ScStandard ) ); pSet = &pSheet->GetItemSet(); pSheet->SetHelpId( aHelpFile, HID_SC_SHEET_PAGE_STD ); @@ -315,7 +315,7 @@ void ScStyleSheetPool::CreateStandardStyles() pSheet = static_cast<ScStyleSheet*>( &Make( SCSTR( STR_STYLENAME_REPORT ), SfxStyleFamily::Page, - SCSTYLEBIT_STANDARD ) ); + SfxStyleSearchBits::ScStandard ) ); pSet = &pSheet->GetItemSet(); pSheet->SetHelpId( aHelpFile, HID_SC_SHEET_PAGE_REP ); @@ -439,7 +439,7 @@ void ScStyleSheetPool::setAllStandard() SfxStyleSheetBase* pSheet = First(); while (pSheet) { - pSheet->SetMask(SCSTYLEBIT_STANDARD); + pSheet->SetMask(SfxStyleSearchBits::ScStandard); pSheet = Next(); } } diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index 52888c5557c6..a7b12c444878 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -50,7 +50,7 @@ ScStyleSheet::ScStyleSheet( const OUString& rName, const ScStyleSheetPool& rPoolP, SfxStyleFamily eFamily, - sal_uInt16 nMaskP ) + SfxStyleSearchBits nMaskP ) : SfxStyleSheet ( rName, rPoolP, eFamily, nMaskP ) , eUsage( UNKNOWN ) @@ -96,7 +96,7 @@ bool ScStyleSheet::SetParent( const OUString& rParentName ) SfxStyleSheetBase* pStyle = m_pPool->Find( aEffName, nFamily ); if (!pStyle) { - std::shared_ptr<SfxStyleSheetIterator> pIter = m_pPool->CreateIterator( nFamily, SFXSTYLEBIT_ALL ); + std::shared_ptr<SfxStyleSheetIterator> pIter = m_pPool->CreateIterator( nFamily, SfxStyleSearchBits::All ); pStyle = pIter->First(); if (pStyle) aEffName = pStyle->GetName(); diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 75100c81b557..6e357267e12a 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -1525,7 +1525,7 @@ ScStyleSheet* XclImpStyle::CreateStyleSheet() mpStyleSheet = static_cast< ScStyleSheet* >( GetStyleSheetPool().Find( maFinalName, SfxStyleFamily::Para ) ); if( !mpStyleSheet ) { - mpStyleSheet = &static_cast< ScStyleSheet& >( GetStyleSheetPool().Make( maFinalName, SfxStyleFamily::Para, SFXSTYLEBIT_USERDEF ) ); + mpStyleSheet = &static_cast< ScStyleSheet& >( GetStyleSheetPool().Make( maFinalName, SfxStyleFamily::Para, SfxStyleSearchBits::UserDefined ) ); bCreatePattern = true; } } diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx index 196f293aa097..1a2da9949a0d 100644 --- a/sc/source/filter/ftools/ftools.cxx +++ b/sc/source/filter/ftools/ftools.cxx @@ -248,7 +248,7 @@ ScStyleSheet& lclMakeStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyle } // create new style sheet - return static_cast< ScStyleSheet& >( rPool.Make( aNewName, eFamily, SFXSTYLEBIT_USERDEF ) ); + return static_cast< ScStyleSheet& >( rPool.Make( aNewName, eFamily, SfxStyleSearchBits::UserDefined ) ); } } // namespace diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 910594768171..6f3314bec1b8 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -2485,7 +2485,7 @@ void CellStyle::createCellStyle() mpStyleSheet = static_cast< ScStyleSheet* >( rDoc.GetStyleSheetPool()->Find( maFinalName, SfxStyleFamily::Para ) ); if( !mpStyleSheet ) { - mpStyleSheet = &static_cast< ScStyleSheet& >( rDoc.GetStyleSheetPool()->Make( maFinalName, SfxStyleFamily::Para, SFXSTYLEBIT_USERDEF ) ); + mpStyleSheet = &static_cast< ScStyleSheet& >( rDoc.GetStyleSheetPool()->Make( maFinalName, SfxStyleFamily::Para, SfxStyleSearchBits::UserDefined ) ); bCreatePattern = true; } } diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx index dff130e33925..b8446e40606c 100644 --- a/sc/source/filter/xml/xmlfonte.cxx +++ b/sc/source/filter/xml/xmlfonte.cxx @@ -86,7 +86,7 @@ ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl(ScXMLExport& rExportP, const SfxItemPool* pEditPool(rExportP.GetDocument()->GetEditPool()); AddFontItems(aEditWhichIds, 3, pEditPool, false); - std::shared_ptr<SfxStyleSheetIterator> pItr = rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SfxStyleFamily::Page, 0xFFFF); + std::shared_ptr<SfxStyleSheetIterator> pItr = rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SfxStyleFamily::Page, SfxStyleSearchBits::All); if(pItr) { diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index 5a0e602dbca5..4235136fadb7 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -127,7 +127,7 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName, else if ( !bDelete ) { // create style (with new name) - pStyle = &pStlPool->Make( aNewName, eStyleFamily, SFXSTYLEBIT_USERDEF ); + pStyle = &pStlPool->Make( aNewName, eStyleFamily, SfxStyleSearchBits::UserDefined ); if ( eStyleFamily == SfxStyleFamily::Para ) rDoc.GetPool()->CellStyleCreated( aNewName, &rDoc ); diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 1dc1c7b7136c..8f262ddd9d9d 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -671,7 +671,7 @@ void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno:: if ( pStylePool->Find( aNameStr, eFamily ) ) // not available yet throw container::ElementExistException(); - (void)pStylePool->Make( aNameStr, eFamily, SFXSTYLEBIT_USERDEF ); + (void)pStylePool->Make( aNameStr, eFamily, SfxStyleSearchBits::UserDefined ); if ( eFamily == SfxStyleFamily::Para && !rDoc.IsImportingXML() ) rDoc.GetPool()->CellStyleCreated( aNameStr, &rDoc ); diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 94076643c7cf..0d8de3db99be 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -388,7 +388,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) } pStyleSheet = &(pStylePool->Make( aStyleName, eFamily, - SFXSTYLEBIT_USERDEF ) ); + SfxStyleSearchBits::UserDefined ) ); if ( pStyleSheet && pStyleSheet->HasParentSupport() ) pStyleSheet->SetParent(aRefName); @@ -598,7 +598,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) // ...and create new pStyleSheet = &pStylePool->Make( aStyleName, eFamily, - SFXSTYLEBIT_USERDEF ); + SfxStyleSearchBits::UserDefined ); // when a style is present, then this will become // the parent of the new style: @@ -743,7 +743,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) // ...and create new pStyleSheet = &pStylePool->Make( aStyleName, eFamily, - SFXSTYLEBIT_USERDEF ); + SfxStyleSearchBits::UserDefined ); // Adopt attribute pStyleSheet->GetItemSet().Put( aAttrSet ); @@ -870,7 +870,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) if ( pOutSet ) { - nRetMask = pStyleSheet->GetMask(); + nRetMask = sal_uInt16(pStyleSheet->GetMask()); // Attribute comparisons (earlier in ModifyStyleSheet) now here // with the old values (the style is already changed) |