diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-04 11:31:33 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-05-09 10:17:13 +0200 |
commit | bcb41235deaf4b7ca90522bda3ba21a686819e6e (patch) | |
tree | 29f397deeb5c776b290b782847a4f9ec8487adb2 | |
parent | b55b7a057f19521ad88fc6a274fcf071b798eb3e (diff) |
convert SfxStyleFamily to scoped enum
and update the RSC compiler to accept such
In the process fix some confusion in SD where it was confusing
SfxStyleFamily and the index of the relevant family
(which other parts of the code in SVL use)
Change-Id: I1efc9f85fbed8ab76eafe8f6e1ada411753ae5f9
136 files changed, 792 insertions, 768 deletions
diff --git a/cui/source/tabpages/bbdlg.cxx b/cui/source/tabpages/bbdlg.cxx index 8f3336db60fb..23422c352118 100644 --- a/cui/source/tabpages/bbdlg.cxx +++ b/cui/source/tabpages/bbdlg.cxx @@ -69,7 +69,7 @@ void SvxBorderBackgroundDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPa // The selection attribute lists (XPropertyList derivates, e.g. XColorList for // the color table) need to be added as items (e.g. SvxColorTableItem) to make // these pages find the needed attributes for fill style suggestions. - // These are added in SwDocStyleSheet::GetItemSet() for the SFX_STYLE_FAMILY_PARA on + // These are added in SwDocStyleSheet::GetItemSet() for the SfxStyleFamily::Para on // demand, but could also be directly added from the DrawModel. else if (nPageId == m_nAreaPageId) { diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index a85ec88437d0..9e8f531bf973 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -1924,7 +1924,7 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage( vcl::Window* pParent, const SfxI if ( pSh ) { SfxStyleSheetBasePool* pPool = pSh->GetStyleSheetPool(); - pPool->SetSearchMask( SFX_STYLE_FAMILY_PAGE ); + pPool->SetSearchMask( SfxStyleFamily::Page ); SfxStyleSheetBase* pStyle = pPool->First(); OUString aStdName; diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index 64a7e2f1e28b..ef6ab7a51412 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -432,7 +432,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox ) fprintf( fp, "\n================== Stylesheets =============================================" ); fprintf( fp, "\n================================================================================" ); fprintf( fp, "\n#Template: %" SAL_PRIuUINT32 "\n", sal_uInt32(nStyles) ); - SfxStyleSheetIterator aIter( pEE->pImpEditEngine->GetStyleSheetPool(), SFX_STYLE_FAMILY_ALL ); + SfxStyleSheetIterator aIter( pEE->pImpEditEngine->GetStyleSheetPool(), SfxStyleFamily::All ); SfxStyleSheetBase* pStyle = aIter.First(); while ( pStyle ) { diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index fe784e0d097d..7190147e28e1 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -112,7 +112,7 @@ const XParaPortion& XParaPortionList::operator [](size_t i) const } ContentInfo::ContentInfo( SfxItemPool& rPool ) : - eFamily(SFX_STYLE_FAMILY_PARA), + eFamily(SfxStyleFamily::Para), aParaAttribs(rPool, EE_PARA_START, EE_CHAR_END) { } @@ -1182,7 +1182,7 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const // StyleName and Family... write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStream, rC.GetStyle(), eEncoding); - rOStream.WriteUInt16( rC.GetFamily() ); + rOStream.WriteUInt16( (sal_uInt16)rC.GetFamily() ); // Paragraph attributes ... rC.GetParaAttribs().Store( rOStream ); diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index fdaeefa8450a..faea53b4acea 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -209,8 +209,8 @@ EditUndoConnectParas::EditUndoConnectParas( EditUndo(EDITUNDO_CONNECTPARAS, pEE), aLeftParaAttribs(rLeftParaAttribs), aRightParaAttribs(rRightParaAttribs), - eLeftStyleFamily(SFX_STYLE_FAMILY_ALL), - eRightStyleFamily(SFX_STYLE_FAMILY_ALL), + eLeftStyleFamily(SfxStyleFamily::All), + eRightStyleFamily(SfxStyleFamily::All), bBackward(bBkwrd) { nNode = nN; diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index fa8b36b0efe2..3f81d4d64350 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -370,7 +370,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) auto const& pS = it->second; mpEditEngine->SetStyleSheet( EditSelection(aStartPaM, aEndPaM), - static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find(pS->sName, SFX_STYLE_FAMILY_ALL))); + static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find(pS->sName, SfxStyleFamily::All))); nOutlLevel = pS->nOutlineNo; } } @@ -443,7 +443,7 @@ SvxRTFStyleType* EditRTFParser::FindStyleSheet( const OUString& rName ) SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle ) { // Check if a template exists, then it will not be changed! - SfxStyleSheet* pStyle = static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find( pRTFStyle->sName, SFX_STYLE_FAMILY_ALL )); + SfxStyleSheet* pStyle = static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find( pRTFStyle->sName, SfxStyleFamily::All )); if ( pStyle ) return pStyle; @@ -460,7 +460,7 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle ) } } - pStyle = static_cast<SfxStyleSheet*>( &mpEditEngine->GetStyleSheetPool()->Make( aName, SFX_STYLE_FAMILY_PARA ) ); + pStyle = static_cast<SfxStyleSheet*>( &mpEditEngine->GetStyleSheetPool()->Make( aName, SfxStyleFamily::Para ) ); // 1) convert and take over Items ... ConvertAndPutItems( pStyle->GetItemSet(), pRTFStyle->aAttrSet ); @@ -468,7 +468,7 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle ) // 2) As long as Parent is not in the pool, also create this ... if ( !aParent.isEmpty() && ( aParent != aName ) ) { - SfxStyleSheet* pS = static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find( aParent, SFX_STYLE_FAMILY_ALL )); + SfxStyleSheet* pS = static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find( aParent, SfxStyleFamily::All )); if ( !pS ) { // If not found anywhere, create from RTF ... diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 4cb5d776fdc1..fc7744a956f0 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -458,7 +458,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) if ( GetStyleSheetPool() ) { SfxStyleSheetIteratorPtr aSSSIterator = std::make_shared<SfxStyleSheetIterator>(GetStyleSheetPool(), - SFX_STYLE_FAMILY_ALL); + SfxStyleFamily::All); // fill aStyleSheetToIdMap sal_uInt32 nId = 1; for ( SfxStyleSheetBase* pStyle = aSSSIterator->First(); pStyle; diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index 0d10336de6cd..a20d2cb86551 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -82,8 +82,8 @@ void ImpEditEngine::SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle ) InsertUndo( new EditUndoSetStyleSheet(pEditEngine, aEditDoc.GetPos( pNode ), - aPrevStyleName, pCurStyle ? pCurStyle->GetFamily() : SFX_STYLE_FAMILY_PARA, - aNewStyleName, pStyle ? pStyle->GetFamily() : SFX_STYLE_FAMILY_PARA, + aPrevStyleName, pCurStyle ? pCurStyle->GetFamily() : SfxStyleFamily::Para, + aNewStyleName, pStyle ? pStyle->GetFamily() : SfxStyleFamily::Para, pNode->GetContentAttribs().GetItems() ) ); } if ( pCurStyle ) diff --git a/include/rsc/rscsfx.hxx b/include/rsc/rscsfx.hxx index 837187aece06..b4dd3c7abb16 100644 --- a/include/rsc/rscsfx.hxx +++ b/include/rsc/rscsfx.hxx @@ -28,13 +28,17 @@ // Public (RSC_NOTYPE + 0x300) bis (RSC_NOTYPE + 0x3FF) //========== S F X ======================================= -enum SfxStyleFamily { SFX_STYLE_FAMILY_CHAR = 1, - SFX_STYLE_FAMILY_PARA = 2, - SFX_STYLE_FAMILY_FRAME = 4, - SFX_STYLE_FAMILY_PAGE = 8, - SFX_STYLE_FAMILY_PSEUDO = 16, - SFX_STYLE_FAMILY_ALL = 0x7fff - }; +// This is used as a flags enum in sw/, but only there, +// so I don't pull in o3tl::typed_flags here +enum class SfxStyleFamily { + None = 0x00, + Char = 0x01, + Para = 0x02, + Frame = 0x04, + Page = 0x08, + Pseudo = 0x10, + All = 0x7fff +}; // SfxTemplate diff --git a/include/sfx2/styfitem.hxx b/include/sfx2/styfitem.hxx index 64d092690c35..1fd10168c693 100644 --- a/include/sfx2/styfitem.hxx +++ b/include/sfx2/styfitem.hxx @@ -42,7 +42,7 @@ class SfxStyleFamilyItem: public Resource Bitmap aBitmap; OUString aText; OUString aHelpText; - sal_uInt16 nFamily; + SfxStyleFamily nFamily; SfxStyleFilter aFilterList; public: @@ -50,7 +50,7 @@ public: ~SfxStyleFamilyItem(); const OUString& GetText() const { return aText; } - SfxStyleFamily GetFamily() const { return (SfxStyleFamily)nFamily; } + SfxStyleFamily GetFamily() const { return nFamily; } const SfxStyleFilter& GetFilterList() const { return aFilterList; } const Image& GetImage() const { return aImage; } diff --git a/include/svl/style.hxx b/include/svl/style.hxx index 8083cb36bdbd..a36c3757e096 100644 --- a/include/svl/style.hxx +++ b/include/svl/style.hxx @@ -278,7 +278,7 @@ public: protected: SfxStyleSheet() // do not use! needed by MSVC at compile time to satisfy ImplInheritanceHelper2 - : SfxStyleSheetBase(OUString("dummy"), nullptr, SFX_STYLE_FAMILY_ALL, 0) + : SfxStyleSheetBase(OUString("dummy"), nullptr, SfxStyleFamily::All, 0) { assert(false); } diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index 4f76a146fe1d..ea4cdd029923 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -44,6 +44,7 @@ enum class MenuItemBits : sal_Int16; enum class ToolBoxItemType; enum class ButtonType; enum class WindowAlign; +enum class SfxStyleFamily; struct WriteRcContext { @@ -151,6 +152,7 @@ class RscTypCont inline void SETCONST( RscConst *p1, const char * p2, ToolBoxItemType p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); } inline void SETCONST( RscConst *p1, const char * p2, ButtonType p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); } inline void SETCONST( RscConst *p1, const char * p2, WindowAlign p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); } + inline void SETCONST( RscConst *p1, const char * p2, SfxStyleFamily p3 ) { SETCONST(p1, p2, static_cast<sal_uInt16>(p3)); } void InitLangType(); RscEnum * InitFieldUnitsType(); RscEnum * InitColor(); diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index e11f08aa4339..2060798e9cfd 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -1312,11 +1312,11 @@ RscTop * RscTypCont::InitClassSfxStyleFamilyItem( RscTop * pSuper, pSfxStyleFamily = new RscEnum( pHS->getID( "StyleFamily" ), RSC_NOTYPE ); - SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_PARA", SFX_STYLE_FAMILY_PARA ); - SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_CHAR", SFX_STYLE_FAMILY_CHAR ); - SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_FRAME",SFX_STYLE_FAMILY_FRAME); - SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_PAGE", SFX_STYLE_FAMILY_PAGE ); - SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_PSEUDO", SFX_STYLE_FAMILY_PSEUDO ); + SETCONST( pSfxStyleFamily, "SfxStyleFamily::Para", SfxStyleFamily::Para ); + SETCONST( pSfxStyleFamily, "SfxStyleFamily::Char", SfxStyleFamily::Char ); + SETCONST( pSfxStyleFamily, "SfxStyleFamily::Frame",SfxStyleFamily::Frame); + SETCONST( pSfxStyleFamily, "SfxStyleFamily::Page", SfxStyleFamily::Page ); + SETCONST( pSfxStyleFamily, "SfxStyleFamily::Pseudo", SfxStyleFamily::Pseudo ); aBaseLst.push_back( pSfxStyleFamily ); nId = aNmTb.Put( "StyleFamily", VARNAME ); diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx index f5f7c0cb7871..5edea4cee401 100644 --- a/rsc/source/parser/rsclex.cxx +++ b/rsc/source/parser/rsclex.cxx @@ -221,7 +221,7 @@ int MakeToken( YYSTYPE * pTokenVal ) Atom nHashId; OStringBuffer aBuf( 256 ); - while( isalnum (c) || (c == '_') || (c == '-') ) + while( isalnum (c) || (c == '_') || (c == '-') || (c == ':')) { aBuf.append( sal_Char(c) ); c = pFI->GetFastChar(); diff --git a/sc/inc/stylehelper.hxx b/sc/inc/stylehelper.hxx index 1d0939acdbdf..81252653c7a4 100644 --- a/sc/inc/stylehelper.hxx +++ b/sc/inc/stylehelper.hxx @@ -22,11 +22,13 @@ #include <rtl/ustring.hxx> +enum class SfxStyleFamily; + class ScStyleNameConversion { public: - static OUString DisplayToProgrammaticName( const OUString& rDispName, sal_uInt16 nType ); - static OUString ProgrammaticToDisplayName( const OUString& rProgName, sal_uInt16 nType ); + static OUString DisplayToProgrammaticName( const OUString& rDispName, SfxStyleFamily nType ); + static OUString ProgrammaticToDisplayName( const OUString& rProgName, SfxStyleFamily nType ); }; #endif diff --git a/sc/inc/styleuno.hxx b/sc/inc/styleuno.hxx index d1a8fd9e8224..33bb7193aed1 100644 --- a/sc/inc/styleuno.hxx +++ b/sc/inc/styleuno.hxx @@ -55,7 +55,7 @@ class ScStyleFamiliesObj : public ::cppu::WeakImplHelper< private: ScDocShell* pDocShell; - ScStyleFamilyObj* GetObjectByType_Impl(sal_uInt16 Type) const; + ScStyleFamilyObj* GetObjectByType_Impl(SfxStyleFamily nType) const; ScStyleFamilyObj* GetObjectByIndex_Impl(sal_uInt32 nIndex) const; ScStyleFamilyObj* GetObjectByName_Impl(const OUString& aName) const; diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index ca61b3972d88..d7c1f3027004 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1734,7 +1734,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBo pNewPattern->SetStyleSheet( static_cast<ScStyleSheet*>( pDocument->GetStyleSheetPool()-> Find( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), - SFX_STYLE_FAMILY_PARA, + SfxStyleFamily::Para, SFXSTYLEBIT_AUTO | SCSTYLEBIT_STANDARD ) ) ); pData[nPos].pPattern = static_cast<const ScPatternAttr*>( &pDocument->GetPool()->Put(*pNewPattern)); diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 780d361a97d2..11fba58d7d81 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -757,7 +757,7 @@ const SfxPoolItem* ScDocument::GetEffItem( if (!aStyle.isEmpty()) { SfxStyleSheetBase* pStyleSheet = xPoolHelper->GetStylePool()->Find( - aStyle, SFX_STYLE_FAMILY_PARA ); + aStyle, SfxStyleFamily::Para ); if ( pStyleSheet && pStyleSheet->GetItemSet().GetItemState( nWhich, true, &pItem ) == SfxItemState::SET ) return pItem; @@ -802,7 +802,7 @@ const SfxItemSet* ScDocument::GetCondResult( if (!aStyle.isEmpty()) { SfxStyleSheetBase* pStyleSheet = - xPoolHelper->GetStylePool()->Find(aStyle, SFX_STYLE_FAMILY_PARA); + xPoolHelper->GetStylePool()->Find(aStyle, SfxStyleFamily::Para); if (pStyleSheet) return &pStyleSheet->GetItemSet(); diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 40cac04e4cd8..a84c2d09a01e 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -221,7 +221,7 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet, switch ( rStyleSheet.GetFamily() ) { - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: { const sal_uInt16 nOldScale = getScaleValue(rStyleSheet, ATTR_PAGE_SCALE); const sal_uInt16 nOldScaleToPages = getScaleValue(rStyleSheet, ATTR_PAGE_SCALETOPAGES); @@ -241,7 +241,7 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet, } break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: { bool bNumFormatChanged; if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged, @@ -367,7 +367,7 @@ sal_uInt8 ScDocument::GetEditTextDirection(SCTAB nTab) const EEHorizontalTextDirection eRet = EE_HTEXTDIR_DEFAULT; OUString aStyleName = GetPageStyle( nTab ); - SfxStyleSheetBase* pStyle = xPoolHelper->GetStylePool()->Find( aStyleName, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyle = xPoolHelper->GetStylePool()->Find( aStyleName, SfxStyleFamily::Page ); if ( pStyle ) { SfxItemSet& rStyleSet = pStyle->GetItemSet(); @@ -482,7 +482,7 @@ public: // the calls. mrDoc.EnableIdle(false); - mpStylePool->SetSearchMask(SFX_STYLE_FAMILY_PAGE); + mpStylePool->SetSearchMask(SfxStyleFamily::Page); } ~IdleCalcTextWidthScope() @@ -553,7 +553,7 @@ bool ScDocument::IdleCalcTextWidth() // true = try next again aScope.setTab(0); ScTable* pTab = maTabs[aScope.Tab()]; - ScStyleSheet* pStyle = static_cast<ScStyleSheet*>(aScope.getStylePool()->Find(pTab->aPageStyle, SFX_STYLE_FAMILY_PAGE)); + ScStyleSheet* pStyle = static_cast<ScStyleSheet*>(aScope.getStylePool()->Find(pTab->aPageStyle, SfxStyleFamily::Page)); OSL_ENSURE( pStyle, "Missing StyleSheet :-/" ); if (!pStyle || getScaleValue(*pStyle, ATTR_PAGE_SCALETOPAGES) == 0) @@ -641,7 +641,7 @@ bool ScDocument::IdleCalcTextWidth() // true = try next again { pTab = maTabs[aScope.Tab()]; pStyle = static_cast<ScStyleSheet*>(aScope.getStylePool()->Find( - pTab->aPageStyle, SFX_STYLE_FAMILY_PAGE)); + pTab->aPageStyle, SfxStyleFamily::Page)); if ( pStyle ) { diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 75d2336c60ab..4d0ea1e39a65 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -4853,7 +4853,7 @@ bool ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle ) const if ( bStyleSheetUsageInvalid || rStyle.GetUsage() == ScStyleSheet::UNKNOWN ) { SfxStyleSheetIterator aIter( xPoolHelper->GetStylePool(), - SFX_STYLE_FAMILY_PARA ); + SfxStyleFamily::Para ); for ( const SfxStyleSheetBase* pStyle = aIter.First(); pStyle; pStyle = aIter.Next() ) { @@ -6196,7 +6196,7 @@ bool ScDocument::NeedPageResetAfterTab( SCTAB nTab ) const OUString aNew = maTabs[nTab+1]->GetPageStyle(); if ( aNew != maTabs[nTab]->GetPageStyle() ) { - SfxStyleSheetBase* pStyle = xPoolHelper->GetStylePool()->Find( aNew, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyle = xPoolHelper->GetStylePool()->Find( aNew, SfxStyleFamily::Page ); if ( pStyle ) { const SfxItemSet& rSet = pStyle->GetItemSet(); diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 75e9dd36d672..4da81389a1ef 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -286,12 +286,12 @@ void lcl_SetStyleById( ScDocument* pDoc, SCTAB nTab, OUString aStyleName = ScGlobal::GetRscString( nStrId ); ScStyleSheetPool* pStlPool = pDoc->GetStyleSheetPool(); - ScStyleSheet* pStyle = static_cast<ScStyleSheet*>( pStlPool->Find( aStyleName, SFX_STYLE_FAMILY_PARA ) ); + ScStyleSheet* pStyle = static_cast<ScStyleSheet*>( pStlPool->Find( aStyleName, SfxStyleFamily::Para ) ); if (!pStyle) { // create new style (was in ScPivot::SetStyle) - pStyle = static_cast<ScStyleSheet*>( &pStlPool->Make( aStyleName, SFX_STYLE_FAMILY_PARA, + pStyle = static_cast<ScStyleSheet*>( &pStlPool->Make( aStyleName, SfxStyleFamily::Para, SFXSTYLEBIT_USERDEF ) ); pStyle->SetParent( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); SfxItemSet& rSet = pStyle->GetItemSet(); diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index ffeb066e63c2..17c6d2263588 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -328,7 +328,7 @@ bool handleConditionalFormat(ScConditionalFormatList* pCondFormList, const std:: if (!aData.aStyleName.isEmpty()) { SfxStyleSheetBase* pStyleSheet = - pStlPool->Find( aData.aStyleName, SFX_STYLE_FAMILY_PARA ); + pStlPool->Find( aData.aStyleName, SfxStyleFamily::Para ); if ( pStyleSheet ) { //TODO: cache Style-Sets !!! diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index fccfb43c8ca4..ba4476a8702f 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -181,7 +181,7 @@ SvStream& ScPatternAttr::Store(SvStream& rStream, sal_uInt16 /* nItemVersion */) rStream.WriteUniOrByteString( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), rStream.GetStreamCharSet() ); - rStream.WriteInt16( SFX_STYLE_FAMILY_PARA ); // due to old data format + rStream.WriteInt16( (sal_uInt16) SfxStyleFamily::Para ); // due to old data format GetItemSet().Store( rStream ); @@ -1245,14 +1245,14 @@ void ScPatternAttr::UpdateStyleSheet(ScDocument* pDoc) { if (pName) { - pStyle = static_cast<ScStyleSheet*>(pDoc->GetStyleSheetPool()->Find(*pName, SFX_STYLE_FAMILY_PARA)); + pStyle = static_cast<ScStyleSheet*>(pDoc->GetStyleSheetPool()->Find(*pName, SfxStyleFamily::Para)); // use Standard if Style is not found, // to avoid empty display in Toolbox-Controller // Assumes that "Standard" is always the 1st entry! if (!pStyle) { - SfxStyleSheetIteratorPtr pIter = pDoc->GetStyleSheetPool()->CreateIterator( SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_ALL ); + SfxStyleSheetIteratorPtr pIter = pDoc->GetStyleSheetPool()->CreateIterator( SfxStyleFamily::Para, SFXSTYLEBIT_ALL ); pStyle = dynamic_cast< ScStyleSheet* >(pIter->First()); } diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 2e859f6926d0..c9acb13effe8 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -102,7 +102,7 @@ SfxStyleSheetBase* ScStyleSheetPool::Create( const OUString& rName, sal_uInt16 nMaskP ) { ScStyleSheet* pSheet = new ScStyleSheet( rName, *this, eFamily, nMaskP ); - if ( eFamily == SFX_STYLE_FAMILY_PARA && ScGlobal::GetRscString(STR_STYLENAME_STANDARD) != rName ) + if ( eFamily == SfxStyleFamily::Para && ScGlobal::GetRscString(STR_STYLENAME_STANDARD) != rName ) pSheet->SetParent( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); return pSheet; @@ -142,7 +142,7 @@ void ScStyleSheetPool::CopyStyleFrom( ScStyleSheetPool* pSrcPool, rDestSet.PutExtended( rSourceSet, SfxItemState::DONTCARE, SfxItemState::DEFAULT ); const SfxPoolItem* pItem; - if ( eFamily == SFX_STYLE_FAMILY_PAGE ) + if ( eFamily == SfxStyleFamily::Page ) { // Set-Items @@ -188,13 +188,13 @@ void ScStyleSheetPool::CopyStdStylesFrom( ScStyleSheetPool* pSrcPool ) { // Copy Default styles - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PARA ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_RESULT), SFX_STYLE_FAMILY_PARA ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_RESULT1), SFX_STYLE_FAMILY_PARA ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_HEADLINE), SFX_STYLE_FAMILY_PARA ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_HEADLINE1), SFX_STYLE_FAMILY_PARA ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PAGE ); - CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_REPORT), SFX_STYLE_FAMILY_PAGE ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD), SfxStyleFamily::Para ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_RESULT), SfxStyleFamily::Para ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_RESULT1), SfxStyleFamily::Para ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_HEADLINE), SfxStyleFamily::Para ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_HEADLINE1), SfxStyleFamily::Para ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_STANDARD), SfxStyleFamily::Page ); + CopyStyleFrom( pSrcPool, SCSTR(STR_STYLENAME_REPORT), SfxStyleFamily::Page ); } static void lcl_CheckFont( SfxItemSet& rSet, LanguageType eLang, DefaultFontType nFontType, sal_uInt16 nItemId ) @@ -241,7 +241,7 @@ void ScStyleSheetPool::CreateStandardStyles() // 1. Standard - pSheet = static_cast<ScStyleSheet*>( &Make( aStrStandard, SFX_STYLE_FAMILY_PARA, SCSTYLEBIT_STANDARD ) ); + pSheet = static_cast<ScStyleSheet*>( &Make( aStrStandard, SfxStyleFamily::Para, SCSTYLEBIT_STANDARD ) ); pSheet->SetHelpId( aHelpFile, HID_SC_SHEET_CELL_STD ); // if default fonts for the document's languages are different from the pool default, @@ -273,7 +273,7 @@ void ScStyleSheetPool::CreateStandardStyles() // 2. Result pSheet = static_cast<ScStyleSheet*>( &Make( SCSTR( STR_STYLENAME_RESULT ), - SFX_STYLE_FAMILY_PARA, + SfxStyleFamily::Para, SCSTYLEBIT_STANDARD ) ); pSheet->SetParent( aStrStandard ); pSheet->SetHelpId( aHelpFile, HID_SC_SHEET_CELL_ERG ); @@ -285,7 +285,7 @@ void ScStyleSheetPool::CreateStandardStyles() // 3. Result1 pSheet = static_cast<ScStyleSheet*>( &Make( SCSTR( STR_STYLENAME_RESULT1 ), - SFX_STYLE_FAMILY_PARA, + SfxStyleFamily::Para, SCSTYLEBIT_STANDARD ) ); pSheet->SetParent( SCSTR( STR_STYLENAME_RESULT ) ); @@ -294,7 +294,7 @@ void ScStyleSheetPool::CreateStandardStyles() // 4. headline pSheet = static_cast<ScStyleSheet*>( &Make( SCSTR( STR_STYLENAME_HEADLINE ), - SFX_STYLE_FAMILY_PARA, + SfxStyleFamily::Para, SCSTYLEBIT_STANDARD ) ); pSheet->SetParent( aStrStandard ); @@ -308,7 +308,7 @@ void ScStyleSheetPool::CreateStandardStyles() // 5. Ueberschrift1 pSheet = static_cast<ScStyleSheet*>( &Make( SCSTR( STR_STYLENAME_HEADLINE1 ), - SFX_STYLE_FAMILY_PARA, + SfxStyleFamily::Para, SCSTYLEBIT_STANDARD ) ); pSheet->SetParent( SCSTR( STR_STYLENAME_HEADLINE ) ); @@ -321,7 +321,7 @@ void ScStyleSheetPool::CreateStandardStyles() // 1. Standard pSheet = static_cast<ScStyleSheet*>( &Make( aStrStandard, - SFX_STYLE_FAMILY_PAGE, + SfxStyleFamily::Page, SCSTYLEBIT_STANDARD ) ); pSet = &pSheet->GetItemSet(); @@ -362,7 +362,7 @@ void ScStyleSheetPool::CreateStandardStyles() // 2. Report pSheet = static_cast<ScStyleSheet*>( &Make( SCSTR( STR_STYLENAME_REPORT ), - SFX_STYLE_FAMILY_PAGE, + SfxStyleFamily::Page, SCSTYLEBIT_STANDARD ) ); pSet = &pSheet->GetItemSet(); pSheet->SetHelpId( aHelpFile, HID_SC_SHEET_PAGE_REP ); diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index 0c3a7e1381ad..77078ead7652 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -76,8 +76,8 @@ bool ScStyleSheet::HasParentSupport () const switch ( GetFamily() ) { - case SFX_STYLE_FAMILY_PARA: bHasParentSupport = true; break; - case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = false; break; + case SfxStyleFamily::Para: bHasParentSupport = true; break; + case SfxStyleFamily::Page: bHasParentSupport = false; break; default: { // added to avoid warnings @@ -131,7 +131,7 @@ SfxItemSet& ScStyleSheet::GetItemSet() { switch ( GetFamily() ) { - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: { // Page templates should not be derivable, // therefore suitable values are set at this point. @@ -218,7 +218,7 @@ SfxItemSet& ScStyleSheet::GetItemSet() } break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: default: pSet = new SfxItemSet( GetPool().GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END ); break; @@ -250,7 +250,7 @@ SfxItemSet& ScStyleSheet::GetItemSet() bool ScStyleSheet::IsUsed() const { - if ( GetFamily() == SFX_STYLE_FAMILY_PARA ) + if ( GetFamily() == SfxStyleFamily::Para ) { // Always query the document to let it decide if a rescan is necessary, // and store the state. diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index c677ce19c2b2..f5da41e63509 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -624,11 +624,11 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO if(!aStyleName.isEmpty()) { - if(pDocument->GetStyleSheetPool()->Find(aStyleName, SFX_STYLE_FAMILY_PARA)) + if(pDocument->GetStyleSheetPool()->Find(aStyleName, SfxStyleFamily::Para)) continue; pDocument->GetStyleSheetPool()->CopyStyleFrom( - pTable->pDocument->GetStyleSheetPool(), aStyleName, SFX_STYLE_FAMILY_PARA ); + pTable->pDocument->GetStyleSheetPool(), aStyleName, SfxStyleFamily::Para ); } } } @@ -2077,7 +2077,7 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC if (!aStyleName.isEmpty()) { SfxStyleSheetBase* pStyleSheet = - pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); + pStylePool->Find( aStyleName, SfxStyleFamily::Para ); if ( pStyleSheet ) { FillMaxRot( pRowInfo, nArrCount, nX1, nX2, diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 3fb4799a002d..64934400d6c9 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -1961,7 +1961,7 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam ) //TODO: sort? ScStyleSheet* pStyle = static_cast<ScStyleSheet*>(pDocument->GetStyleSheetPool()->Find( - ScGlobal::GetRscString(STR_STYLENAME_RESULT), SFX_STYLE_FAMILY_PARA )); + ScGlobal::GetRscString(STR_STYLENAME_RESULT), SfxStyleFamily::Para )); bool bSpaceLeft = true; // Success when inserting? diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index 8ba078cb4e84..6a2f060a5f14 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -72,7 +72,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) } SfxStyleSheetBase* pStyle = pDocument->GetStyleSheetPool()-> - Find( aPageStyle, SFX_STYLE_FAMILY_PAGE ); + Find( aPageStyle, SfxStyleFamily::Page ); if ( !pStyle ) { OSL_FAIL("UpdatePageBreaks: Style not found"); @@ -1121,17 +1121,17 @@ void ScTable::SetPageStyle( const OUString& rName ) { OUString aStrNew = rName; SfxStyleSheetBasePool* pStylePool = pDocument->GetStyleSheetPool(); - SfxStyleSheetBase* pNewStyle = pStylePool->Find( aStrNew, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pNewStyle = pStylePool->Find( aStrNew, SfxStyleFamily::Page ); if ( !pNewStyle ) { aStrNew = ScGlobal::GetRscString(STR_STYLENAME_STANDARD); - pNewStyle = pStylePool->Find( aStrNew, SFX_STYLE_FAMILY_PAGE ); + pNewStyle = pStylePool->Find( aStrNew, SfxStyleFamily::Page ); } if ( aPageStyle != aStrNew ) { - SfxStyleSheetBase* pOldStyle = pStylePool->Find( aPageStyle, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pOldStyle = pStylePool->Find( aPageStyle, SfxStyleFamily::Page ); if ( pOldStyle && pNewStyle ) { diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index c54812a9cd26..2c63ed46a8ec 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -528,7 +528,7 @@ bool ScTable::SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& { const ScStyleSheet* pSearchStyle = static_cast<const ScStyleSheet*>( pDocument->GetStyleSheetPool()->Find( - rSearchItem.GetSearchString(), SFX_STYLE_FAMILY_PARA )); + rSearchItem.GetSearchString(), SfxStyleFamily::Para )); SCsCOL nCol = rCol; SCsROW nRow = rRow; @@ -620,7 +620,7 @@ bool ScTable::ReplaceStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& { const ScStyleSheet* pReplaceStyle = static_cast<const ScStyleSheet*>( pDocument->GetStyleSheetPool()->Find( - rSearchItem.GetReplaceString(), SFX_STYLE_FAMILY_PARA )); + rSearchItem.GetReplaceString(), SfxStyleFamily::Para )); if (pReplaceStyle) ApplyStyle( rCol, rRow, *pReplaceStyle ); @@ -638,7 +638,7 @@ bool ScTable::SearchAllStyle( { const ScStyleSheet* pSearchStyle = static_cast<const ScStyleSheet*>( pDocument->GetStyleSheetPool()->Find( - rSearchItem.GetSearchString(), SFX_STYLE_FAMILY_PARA )); + rSearchItem.GetSearchString(), SfxStyleFamily::Para )); bool bSelect = rSearchItem.GetSelection(); bool bBack = rSearchItem.GetBackward(); bool bEverFound = false; @@ -678,7 +678,7 @@ bool ScTable::ReplaceAllStyle( { const ScStyleSheet* pReplaceStyle = static_cast<const ScStyleSheet*>( pDocument->GetStyleSheetPool()->Find( - rSearchItem.GetReplaceString(), SFX_STYLE_FAMILY_PARA )); + rSearchItem.GetReplaceString(), SfxStyleFamily::Para )); if (pReplaceStyle) { diff --git a/sc/source/core/tool/stylehelper.cxx b/sc/source/core/tool/stylehelper.cxx index d1eccbdd9bdd..e8fece39eef2 100644 --- a/sc/source/core/tool/stylehelper.cxx +++ b/sc/source/core/tool/stylehelper.cxx @@ -42,9 +42,9 @@ struct ScDisplayNameMap OUString aProgName; }; -static const ScDisplayNameMap* lcl_GetStyleNameMap( sal_uInt16 nType ) +static const ScDisplayNameMap* lcl_GetStyleNameMap( SfxStyleFamily nType ) { - if ( nType == SFX_STYLE_FAMILY_PARA ) + if ( nType == SfxStyleFamily::Para ) { static bool bCellMapFilled = false; static ScDisplayNameMap aCellMap[6]; @@ -71,7 +71,7 @@ static const ScDisplayNameMap* lcl_GetStyleNameMap( sal_uInt16 nType ) } return aCellMap; } - else if ( nType == SFX_STYLE_FAMILY_PAGE ) + else if ( nType == SfxStyleFamily::Page ) { static bool bPageMapFilled = false; static ScDisplayNameMap aPageMap[3]; @@ -104,7 +104,7 @@ static bool lcl_EndsWithUser( const OUString& rString ) return rString.endsWith(SC_SUFFIX_USER); } -OUString ScStyleNameConversion::DisplayToProgrammaticName( const OUString& rDispName, sal_uInt16 nType ) +OUString ScStyleNameConversion::DisplayToProgrammaticName( const OUString& rDispName, SfxStyleFamily nType ) { bool bDisplayIsProgrammatic = false; @@ -131,7 +131,7 @@ OUString ScStyleNameConversion::DisplayToProgrammaticName( const OUString& rDisp return rDispName; } -OUString ScStyleNameConversion::ProgrammaticToDisplayName( const OUString& rProgName, sal_uInt16 nType ) +OUString ScStyleNameConversion::ProgrammaticToDisplayName( const OUString& rProgName, SfxStyleFamily nType ) { if ( lcl_EndsWithUser( rProgName ) ) { diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index c4e27178f654..6d27232ffd61 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -1255,7 +1255,7 @@ void ImportExcel::PostDocLoad() /* Set automatic page numbering in Default page style (default is "page number = 1"). Otherwise hidden tables (i.e. for scenarios) which have Default page style will break automatic page numbering. */ - if( SfxStyleSheetBase* pStyleSheet = GetStyleSheetPool().Find( ScGlobal::GetRscString( STR_STYLENAME_STANDARD ), SFX_STYLE_FAMILY_PAGE ) ) + if( SfxStyleSheetBase* pStyleSheet = GetStyleSheetPool().Find( ScGlobal::GetRscString( STR_STYLENAME_STANDARD ), SfxStyleFamily::Page ) ) pStyleSheet->GetItemSet().Put( SfxUInt16Item( ATTR_PAGE_FIRSTPAGENO, 0 ) ); // outlines for all sheets, sets hidden rows and columns (#i11776# after filtered ranges) diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 1a5ce8d7fa1e..24cc6565e9cd 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -621,7 +621,7 @@ XclExpCFImpl::XclExpCFImpl( const XclExpRoot& rRoot, const ScCondFormatEntry& rF /* Get formatting attributes here, and not in WriteBody(). This is needed to correctly insert all colors into the palette. */ - if( SfxStyleSheetBase* pStyleSheet = GetDoc().GetStyleSheetPool()->Find( mrFormatEntry.GetStyle(), SFX_STYLE_FAMILY_PARA ) ) + if( SfxStyleSheetBase* pStyleSheet = GetDoc().GetStyleSheetPool()->Find( mrFormatEntry.GetStyle(), SfxStyleFamily::Para ) ) { const SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx index 5fb1951236ba..2895819d4ff9 100644 --- a/sc/source/filter/excel/xepage.cxx +++ b/sc/source/filter/excel/xepage.cxx @@ -210,7 +210,7 @@ XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) : ScDocument& rDoc = GetDoc(); SCTAB nScTab = GetCurrScTab(); - if( SfxStyleSheetBase* pStyleSheet = GetStyleSheetPool().Find( rDoc.GetPageStyle( nScTab ), SFX_STYLE_FAMILY_PAGE ) ) + if( SfxStyleSheetBase* pStyleSheet = GetStyleSheetPool().Find( rDoc.GetPageStyle( nScTab ), SfxStyleFamily::Page ) ) { const SfxItemSet& rItemSet = pStyleSheet->GetItemSet(); maData.mbValid = true; diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index d56d041f469d..08007ec51a37 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -2837,7 +2837,7 @@ sal_uInt32 XclExpXFBuffer::InsertStyleXF( const SfxStyleSheetBase& rStyleSheet ) void XclExpXFBuffer::InsertUserStyles() { - SfxStyleSheetIterator aStyleIter( GetDoc().GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); + SfxStyleSheetIterator aStyleIter( GetDoc().GetStyleSheetPool(), SfxStyleFamily::Para ); for( SfxStyleSheetBase* pStyleSheet = aStyleIter.First(); pStyleSheet; pStyleSheet = aStyleIter.Next() ) if( pStyleSheet->IsUserDefined() && !lclIsBuiltInStyle( pStyleSheet->GetName() ) ) InsertStyleXF( *pStyleSheet ); @@ -2884,7 +2884,7 @@ void XclExpXFBuffer::InsertDefaultRecords() maFills.push_back( lcl_GetPatternFill_Gray125() ); // index 0: default style - if( SfxStyleSheetBase* pDefStyleSheet = GetStyleSheetPool().Find( ScGlobal::GetRscString( STR_STYLENAME_STANDARD ), SFX_STYLE_FAMILY_PARA ) ) + if( SfxStyleSheetBase* pDefStyleSheet = GetStyleSheetPool().Find( ScGlobal::GetRscString( STR_STYLENAME_STANDARD ), SfxStyleFamily::Para ) ) { XclExpXFRef xDefStyle( new XclExpXF( GetRoot(), *pDefStyleSheet ) ); sal_uInt32 nXFId = AppendBuiltInXFWithStyle( xDefStyle, EXC_STYLE_NORMAL ); diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index d53c75bf4b8a..e25745873439 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -1352,7 +1352,7 @@ void XclImpXF::ApplyPatternToAttrList( { ScStyleSheet* pStyleSheet = static_cast<ScStyleSheet*>( pStylePool->Find( - ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PARA)); + ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SfxStyleFamily::Para)); if (pStyleSheet) rPat.SetStyleSheet(pStyleSheet, false); @@ -1514,7 +1514,7 @@ ScStyleSheet* XclImpStyle::CreateStyleSheet() if( pXF ) pXF->SetAllUsedFlags( true ); // use existing "Default" style sheet mpStyleSheet = static_cast< ScStyleSheet* >( GetStyleSheetPool().Find( - ScGlobal::GetRscString( STR_STYLENAME_STANDARD ), SFX_STYLE_FAMILY_PARA ) ); + ScGlobal::GetRscString( STR_STYLENAME_STANDARD ), SfxStyleFamily::Para ) ); OSL_ENSURE( mpStyleSheet, "XclImpStyle::CreateStyleSheet - Default style not found" ); bCreatePattern = true; } @@ -1523,10 +1523,10 @@ ScStyleSheet* XclImpStyle::CreateStyleSheet() /* #i103281# do not create another style sheet of the same name, if it exists already. This is needed to prevent that styles pasted from clipboard get duplicated over and over. */ - mpStyleSheet = static_cast< ScStyleSheet* >( GetStyleSheetPool().Find( maFinalName, SFX_STYLE_FAMILY_PARA ) ); + mpStyleSheet = static_cast< ScStyleSheet* >( GetStyleSheetPool().Find( maFinalName, SfxStyleFamily::Para ) ); if( !mpStyleSheet ) { - mpStyleSheet = &static_cast< ScStyleSheet& >( GetStyleSheetPool().Make( maFinalName, SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_USERDEF ) ); + mpStyleSheet = &static_cast< ScStyleSheet& >( GetStyleSheetPool().Make( maFinalName, SfxStyleFamily::Para, SFXSTYLEBIT_USERDEF ) ); bCreatePattern = true; } } @@ -1614,7 +1614,7 @@ void XclImpXFBuffer::CreateUserStyles() for styles in different sheets with the same name. Assuming that the BIFF4W import filter is never used to import from clipboard... */ bool bReserveAll = (GetBiff() == EXC_BIFF4) && (GetCurrScTab() > 0); - SfxStyleSheetIterator aStyleIter( GetDoc().GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); + SfxStyleSheetIterator aStyleIter( GetDoc().GetStyleSheetPool(), SfxStyleFamily::Para ); OUString aStandardName = ScGlobal::GetRscString( STR_STYLENAME_STANDARD ); for( SfxStyleSheetBase* pStyleSheet = aStyleIter.First(); pStyleSheet; pStyleSheet = aStyleIter.Next() ) if( (pStyleSheet->GetName() != aStandardName) && (bReserveAll || !pStyleSheet->IsUserDefined()) ) diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx index fb80b938c3b7..fde80bded0b4 100644 --- a/sc/source/filter/ftools/ftools.cxx +++ b/sc/source/filter/ftools/ftools.cxx @@ -257,12 +257,12 @@ ScStyleSheet& lclMakeStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyle ScStyleSheet& ScfTools::MakeCellStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyleName, bool bForceName ) { - return lclMakeStyleSheet( rPool, rStyleName, SFX_STYLE_FAMILY_PARA, bForceName ); + return lclMakeStyleSheet( rPool, rStyleName, SfxStyleFamily::Para, bForceName ); } ScStyleSheet& ScfTools::MakePageStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyleName, bool bForceName ) { - return lclMakeStyleSheet( rPool, rStyleName, SFX_STYLE_FAMILY_PAGE, bForceName ); + return lclMakeStyleSheet( rPool, rStyleName, SfxStyleFamily::Page, bForceName ); } // *** byte string import operations *** -------------------------------------- diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index 108cd63774d7..901ff80acbd8 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -473,10 +473,10 @@ const SfxItemSet& ScHTMLExport::PageDefaults( SCTAB nTab ) // remember defaults for compare in WriteCell if ( !aHTMLStyle.bInitialized ) { - pStylePool->SetSearchMask( SFX_STYLE_FAMILY_PARA ); + pStylePool->SetSearchMask( SfxStyleFamily::Para ); pStyleSheet = pStylePool->Find( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), - SFX_STYLE_FAMILY_PARA ); + SfxStyleFamily::Para ); OSL_ENSURE( pStyleSheet, "ParaStyle not found! :-(" ); if (!pStyleSheet) pStyleSheet = pStylePool->First(); @@ -496,8 +496,8 @@ const SfxItemSet& ScHTMLExport::PageDefaults( SCTAB nTab ) // Page style sheet printer settings, e.g. for background graphics. // There's only one background graphic in HTML! - pStylePool->SetSearchMask( SFX_STYLE_FAMILY_PAGE ); - pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE ); + pStylePool->SetSearchMask( SfxStyleFamily::Page ); + pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ), SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found! :-(" ); if (!pStyleSheet) pStyleSheet = pStylePool->First(); diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx index 3baae4fe6486..f57b19734922 100644 --- a/sc/source/filter/html/htmlimp.cxx +++ b/sc/source/filter/html/htmlimp.cxx @@ -66,7 +66,7 @@ ScHTMLImport::ScHTMLImport( ScDocument* pDocP, const OUString& rBaseURL, const S OutputDevice* pDefaultDev = Application::GetDefaultDevice(); const OUString& aPageStyle = mpDoc->GetPageStyle( rRange.aStart.Tab() ); ScStyleSheet* pStyleSheet = static_cast<ScStyleSheet*>(mpDoc-> - GetStyleSheetPool()->Find( aPageStyle, SFX_STYLE_FAMILY_PAGE )); + GetStyleSheetPool()->Find( aPageStyle, SfxStyleFamily::Page )); if ( pStyleSheet ) { const SfxItemSet& rSet = pStyleSheet->GetItemSet(); diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index b1d40dcaab93..10cc7c5be1ad 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -2151,7 +2151,7 @@ void Xf::applyPatternToAttrList( AttrList& rAttrs, SCROW nRow1, SCROW nRow2, sal { ScStyleSheet* pStyleSheet = static_cast<ScStyleSheet*>( pStylePool->Find( - ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PARA)); + ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SfxStyleFamily::Para)); if (pStyleSheet) rPat.SetStyleSheet( pStyleSheet, false ); @@ -2243,7 +2243,7 @@ void Xf::writeToDoc( ScDocumentImport& rDoc, const table::CellRangeAddress& rRan ScStyleSheet* pStyleSheet = static_cast<ScStyleSheet*>( - rDoc.getDoc().GetStyleSheetPool()->Find(aStyleName, SFX_STYLE_FAMILY_PARA)); + rDoc.getDoc().GetStyleSheetPool()->Find(aStyleName, SfxStyleFamily::Para)); if (pStyleSheet) { @@ -2631,16 +2631,16 @@ void CellStyle::createCellStyle() { // use existing "Default" style sheet mpStyleSheet = static_cast< ScStyleSheet* >( static_cast< ScStyleSheetPool* >( rDoc.GetStyleSheetPool() )->Find( - ScGlobal::GetRscString( STR_STYLENAME_STANDARD ), SFX_STYLE_FAMILY_PARA ) ); + ScGlobal::GetRscString( STR_STYLENAME_STANDARD ), SfxStyleFamily::Para ) ); OSL_ENSURE( mpStyleSheet, "CellStyle::createStyle - Default style not found" ); bCreatePattern = true; } else { - mpStyleSheet = static_cast< ScStyleSheet* >( static_cast< ScStyleSheetPool* >( rDoc.GetStyleSheetPool() )->Find( maFinalName, SFX_STYLE_FAMILY_PARA ) ); + mpStyleSheet = static_cast< ScStyleSheet* >( static_cast< ScStyleSheetPool* >( rDoc.GetStyleSheetPool() )->Find( maFinalName, SfxStyleFamily::Para ) ); if( !mpStyleSheet ) { - mpStyleSheet = &static_cast< ScStyleSheet& >( rDoc.GetStyleSheetPool()->Make( maFinalName, SFX_STYLE_FAMILY_PARA, SFXSTYLEBIT_USERDEF ) ); + mpStyleSheet = &static_cast< ScStyleSheet& >( rDoc.GetStyleSheetPool()->Make( maFinalName, SfxStyleFamily::Para, SFXSTYLEBIT_USERDEF ) ); bCreatePattern = true; } } diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 176d5eb40096..38da31387d25 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -947,7 +947,7 @@ void WorksheetGlobals::initializeWorksheetImport() ScStyleSheet* pStyleSheet = static_cast<ScStyleSheet*>(rDoc.getDoc().GetStyleSheetPool()->Find( - getStyles().getDefaultStyleName(), SFX_STYLE_FAMILY_PARA)); + getStyles().getDefaultStyleName(), SfxStyleFamily::Para)); if (pStyleSheet) rDoc.setCellStyleToSheet(getSheetIndex(), *pStyleSheet); diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index 496faeae891b..0bfe90f4e6cd 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -1207,7 +1207,7 @@ size_t ScOrcusStyles::commit_cell_style() } ScStyleSheetPool* pPool = mrDoc.GetStyleSheetPool(); - SfxStyleSheetBase& rBase = pPool->Make(maCurrentCellStyle.maName, SFX_STYLE_FAMILY_PARA); + SfxStyleSheetBase& rBase = pPool->Make(maCurrentCellStyle.maName, SfxStyleFamily::Para); SfxItemSet& rSet = rBase.GetItemSet(); xf& rXf = maCellStyleXfs[maCurrentCellStyle.mnXFId]; diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx index 43731e0bd7df..bfac4b03da1f 100644 --- a/sc/source/filter/starcalc/scflt.cxx +++ b/sc/source/filter/starcalc/scflt.cxx @@ -689,7 +689,7 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc ) OUString aName = lcl_MakeOldPageStyleFormatName( i ); ScStyleSheet* pSheet = static_cast<ScStyleSheet*>( &pStylePool->Make( aName, - SFX_STYLE_FAMILY_PAGE, + SfxStyleFamily::Page, SFXSTYLEBIT_USERDEF | SCSTYLEBIT_STANDARD ) ); // #i68483# set page style name at sheet... pDoc->SetPageStyle( static_cast< SCTAB >( i ), aName ); @@ -1107,17 +1107,17 @@ void Sc10Import::LoadPatternCollection() { Sc10PatternData* pPattern = pPatternCollection->At( i ); OUString aName( pPattern->Name, strlen(pPattern->Name), DEFCHARSET ); - SfxStyleSheetBase* pStyle = pStylePool->Find( aName, SFX_STYLE_FAMILY_PARA ); + SfxStyleSheetBase* pStyle = pStylePool->Find( aName, SfxStyleFamily::Para ); if( pStyle == nullptr ) - pStylePool->Make( aName, SFX_STYLE_FAMILY_PARA ); + pStylePool->Make( aName, SfxStyleFamily::Para ); else { pPattern->Name[ 27 ] = 0; strcat( pPattern->Name, "_Old" ); aName = SC10TOSTRING( pPattern->Name ); - pStylePool->Make( aName, SFX_STYLE_FAMILY_PARA ); + pStylePool->Make( aName, SfxStyleFamily::Para ); } - pStyle = pStylePool->Find( aName, SFX_STYLE_FAMILY_PARA ); + pStyle = pStylePool->Find( aName, SfxStyleFamily::Para ); if( pStyle != nullptr ) { SfxItemSet &rItemSet = pStyle->GetItemSet(); @@ -2104,7 +2104,7 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab) if (pPattern != nullptr) { ScStyleSheet* pStyle = static_cast<ScStyleSheet*>( pStylePool->Find( - SC10TOSTRING( pPattern->Name ), SFX_STYLE_FAMILY_PARA) ); + SC10TOSTRING( pPattern->Name ), SfxStyleFamily::Para) ); if (pStyle != nullptr) pDoc->ApplyStyleAreaTab(Col, nStart, Col, nEnd, Tab, *pStyle); diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index 7a06e0e797ee..7e0e0c063ce1 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -588,7 +588,7 @@ ScXMLCondContext::ScXMLCondContext( ScXMLImport& rImport, sal_uInt16 nPrfx, sExpression = sValue; break; case XML_TOK_CONDITION_APPLY_STYLE_NAME: - sStyle = ScStyleNameConversion::ProgrammaticToDisplayName(sValue, SFX_STYLE_FAMILY_PARA ); + sStyle = ScStyleNameConversion::ProgrammaticToDisplayName(sValue, SfxStyleFamily::Para ); break; case XML_TOK_CONDITION_BASE_CELL_ADDRESS: sAddress = sValue; @@ -789,7 +789,7 @@ ScXMLDateContext::ScXMLDateContext( ScXMLImport& rImport, sal_uInt16 nPrfx, sDateType = sValue; break; case XML_TOK_COND_DATE_STYLE: - sStyle = ScStyleNameConversion::ProgrammaticToDisplayName(sValue, SFX_STYLE_FAMILY_PARA ); + sStyle = ScStyleNameConversion::ProgrammaticToDisplayName(sValue, SfxStyleFamily::Para ); break; default: break; diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 9042eb6e2bc0..a92834ea0acc 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -4315,7 +4315,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) default: SAL_WARN("sc", "unimplemented conditional format export"); } - OUString sStyle = ScStyleNameConversion::DisplayToProgrammaticName(pEntry->GetStyle(), SFX_STYLE_FAMILY_PARA); + OUString sStyle = ScStyleNameConversion::DisplayToProgrammaticName(pEntry->GetStyle(), SfxStyleFamily::Para); AddAttribute(XML_NAMESPACE_CALC_EXT, XML_APPLY_STYLE_NAME, sStyle); AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, aCond.makeStringAndClear()); @@ -4464,7 +4464,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) { const ScCondDateFormatEntry& rDateFormat = static_cast<const ScCondDateFormatEntry&>(*pFormatEntry); OUString aDateType = getDateStringForType(rDateFormat.GetDateType()); - OUString aStyleName = ScStyleNameConversion::DisplayToProgrammaticName(rDateFormat.GetStyleName(), SFX_STYLE_FAMILY_PARA ); + OUString aStyleName = ScStyleNameConversion::DisplayToProgrammaticName(rDateFormat.GetStyleName(), SfxStyleFamily::Para ); AddAttribute( XML_NAMESPACE_CALC_EXT, XML_STYLE, aStyleName); AddAttribute( XML_NAMESPACE_CALC_EXT, XML_DATE, aDateType); SvXMLElementExport aElementDateFormat(*this, XML_NAMESPACE_CALC_EXT, XML_DATE_IS, true, true); diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx index 9d39d60830ac..4654add1f021 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); - SfxStyleSheetIteratorPtr pItr = rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SFX_STYLE_FAMILY_PAGE, 0xFFFF); + SfxStyleSheetIteratorPtr pItr = rExportP.GetDocument()->GetStyleSheetPool()->CreateIterator(SfxStyleFamily::Page, 0xFFFF); if(pItr) { diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx index 1a20e96977ce..eda119923b45 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx @@ -228,7 +228,7 @@ sal_Int32 SAL_CALL ScAccessiblePageHeader::getAccessibleChildCount() throw (uno: ScDocument& rDoc = mpViewShell->GetDocument(); // find out how many regions (left,center, right) are with content - SfxStyleSheetBase* pStyle = rDoc.GetStyleSheetPool()->Find(rDoc.GetPageStyle(mpViewShell->GetLocationData().GetPrintTab()), SFX_STYLE_FAMILY_PAGE); + SfxStyleSheetBase* pStyle = rDoc.GetStyleSheetPool()->Find(rDoc.GetPageStyle(mpViewShell->GetLocationData().GetPrintTab()), SfxStyleFamily::Page); if (pStyle) { sal_uInt16 nPageWhichId(0); diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index a5d90f40e139..0800da99f086 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -668,7 +668,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize) Size aPaperSize = SvxPaperInfo::GetPaperSize( PAPER_A4 ); // Twips ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); OUString aStyleName = pDoc->GetPageStyle( aBlock.aStart.Tab() ); - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SfxStyleFamily::Page ); if (pStyleSheet) { const SfxItemSet& rSourceSet = pStyleSheet->GetItemSet(); @@ -676,7 +676,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize) // CopyStyleFrom kopiert SetItems mit richtigem Pool ScStyleSheetPool* pDestPool = rDestDoc.GetStyleSheetPool(); - pDestPool->CopyStyleFrom( pStylePool, aStyleName, SFX_STYLE_FAMILY_PAGE ); + pDestPool->CopyStyleFrom( pStylePool, aStyleName, SfxStyleFamily::Page ); } ScViewData aViewData( pDocSh, nullptr ); diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 7ca4a1838d06..3e3d7f18215f 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -143,7 +143,7 @@ void FillStyleListBox( ScDocument* pDoc, ListBox& rLbStyle ) { rLbStyle.SetSeparatorPos(0); std::set<OUString> aStyleNames; - SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); + SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), SfxStyleFamily::Para ); for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) { OUString aName = pStyle->GetName(); @@ -483,7 +483,7 @@ void StyleSelect( ListBox& rLbStyle, ScDocument* pDoc, SvxFontPrevWindow& rWdPre if(rLbStyle.GetSelectEntryPos() == 0) { // call new style dialog - SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, SFX_STYLE_FAMILY_PARA ); + SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, (sal_uInt16) SfxStyleFamily::Para ); SfxStringItem aRefItem( SID_STYLE_REFERENCE, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); // unlock the dispatcher so SID_STYLE_NEW can be executed @@ -504,7 +504,7 @@ void StyleSelect( ListBox& rLbStyle, ScDocument* pDoc, SvxFontPrevWindow& rWdPre pDisp->Lock(true); // Find the new style and add it into the style list boxes - SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); + SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), SfxStyleFamily::Para ); bool bFound = false; for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle && !bFound; pStyle = aStyleIter.Next() ) { @@ -532,7 +532,7 @@ void StyleSelect( ListBox& rLbStyle, ScDocument* pDoc, SvxFontPrevWindow& rWdPre } OUString aStyleName = rLbStyle.GetSelectEntry(); - SfxStyleSheetBase* pStyleSheet = pDoc->GetStyleSheetPool()->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); + SfxStyleSheetBase* pStyleSheet = pDoc->GetStyleSheetPool()->Find( aStyleName, SfxStyleFamily::Para ); if(pStyleSheet) { const SfxItemSet& rSet = pStyleSheet->GetItemSet(); diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 398a761cf61b..a8f85a0e2fd9 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1392,7 +1392,7 @@ bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const OUString& rStyleName, } ScStyleSheet* pStyleSheet = static_cast<ScStyleSheet*>( rDoc.GetStyleSheetPool()->Find( - rStyleName, SFX_STYLE_FAMILY_PARA )); + rStyleName, SfxStyleFamily::Para )); if (!pStyleSheet) return false; diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 11af532458ab..72bdfadbebaf 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -522,7 +522,7 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlag { OUString aStyle = aDocument.GetPageStyle( GetCurTab() ); ScStyleSheetPool* pStPl = aDocument.GetStyleSheetPool(); - SfxStyleSheet* pStyleSheet = static_cast<SfxStyleSheet*>(pStPl->Find(aStyle, SFX_STYLE_FAMILY_PAGE)); + SfxStyleSheet* pStyleSheet = static_cast<SfxStyleSheet*>(pStPl->Find(aStyle, SfxStyleFamily::Page)); if (pStyleSheet) { SfxItemSet& rSet = pStyleSheet->GetItemSet(); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index b667891759fc..1bedf9183548 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1278,10 +1278,10 @@ void ScDocShell::DoAutoStyle( const ScRange& rRange, const OUString& rStyle ) { ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); ScStyleSheet* pStyleSheet = - pStylePool->FindCaseIns( rStyle, SFX_STYLE_FAMILY_PARA ); + pStylePool->FindCaseIns( rStyle, SfxStyleFamily::Para ); if (!pStyleSheet) pStyleSheet = static_cast<ScStyleSheet*>( - pStylePool->Find( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PARA )); + pStylePool->Find( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SfxStyleFamily::Para )); if (pStyleSheet) { OSL_ENSURE(rRange.aStart.Tab() == rRange.aEnd.Tab(), @@ -1304,7 +1304,7 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint ) if (!pStyle) return; - if ( pStyle->GetFamily() == SFX_STYLE_FAMILY_PAGE ) + if ( pStyle->GetFamily() == SfxStyleFamily::Page ) { if ( nId == SfxStyleSheetHintId::MODIFIED ) { @@ -1344,7 +1344,7 @@ void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint ) } } } - else if ( pStyle->GetFamily() == SFX_STYLE_FAMILY_PARA ) + else if ( pStyle->GetFamily() == SfxStyleFamily::Para ) { if ( nId == SfxStyleSheetHintId::MODIFIED) { @@ -1375,7 +1375,7 @@ void ScDocShell::SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages { OUString aStyleName = aDocument.GetPageStyle( nTab ); ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found" ); if ( pStyleSheet ) { @@ -1411,7 +1411,7 @@ bool ScDocShell::AdjustPrintZoom( const ScRange& rRange ) OUString aStyleName = aDocument.GetPageStyle( nTab ); ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found" ); if ( pStyleSheet ) { @@ -1539,7 +1539,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, OUString aOldName = aDocument.GetPageStyle( nCurTab ); ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet - = pStylePool->Find( aOldName, SFX_STYLE_FAMILY_PAGE ); + = pStylePool->Find( aOldName, SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" ); @@ -1588,7 +1588,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, if (bUndo) { GetUndoManager()->AddUndoAction( - new ScUndoModifyStyle( this, SFX_STYLE_FAMILY_PAGE, + new ScUndoModifyStyle( this, SfxStyleFamily::Page, aOldData, aNewData ) ); } @@ -1613,7 +1613,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller, = aDocument.GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet - = pStylePool->Find( aStr, SFX_STYLE_FAMILY_PAGE ); + = pStylePool->Find( aStr, SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" ); @@ -1761,7 +1761,7 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */, { OUString aStr = aDocument.GetPageStyle( nCurTab ); ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStr, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStr, SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" ); @@ -2068,7 +2068,7 @@ void ScDocShell::GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet, ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = pStylePool-> Find( aDocument.GetPageStyle( nCurTab ), - SFX_STYLE_FAMILY_PAGE ); + SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" ); diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 9198313c19c4..382900a031dc 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -199,7 +199,7 @@ SfxStyleSheetBasePool* ScDocShell::GetStyleSheetPool() static void lcl_AdjustPool( SfxStyleSheetBasePool* pStylePool ) { - pStylePool->SetSearchMask(SFX_STYLE_FAMILY_PAGE); + pStylePool->SetSearchMask(SfxStyleFamily::Page); SfxStyleSheetBase *pStyle = pStylePool->First(); while ( pStyle ) { @@ -252,8 +252,8 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellS ScStyleSheetPool* pDestPool = aDocument.GetStyleSheetPool(); SfxStyleFamily eFamily = bCellStyles ? - ( bPageStyles ? SFX_STYLE_FAMILY_ALL : SFX_STYLE_FAMILY_PARA ) : - SFX_STYLE_FAMILY_PAGE; + ( bPageStyles ? SfxStyleFamily::All : SfxStyleFamily::Para ) : + SfxStyleFamily::Page; SfxStyleSheetIterator aIter( pSourcePool, eFamily ); sal_uInt16 nSourceCount = aIter.Count(); if ( nSourceCount == 0 ) diff --git a/sc/source/ui/styleui/scstyles.src b/sc/source/ui/styleui/scstyles.src index 485ac445a43f..ccb74932f35a 100644 --- a/sc/source/ui/styleui/scstyles.src +++ b/sc/source/ui/styleui/scstyles.src @@ -26,7 +26,7 @@ SfxStyleFamilies DLG_STYLE_DESIGNER { SfxStyleFamilyItem { - StyleFamily = SFX_STYLE_FAMILY_PARA ; + StyleFamily = SfxStyleFamily::Para ; FilterList [ en-US ] = { < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ; @@ -39,7 +39,7 @@ SfxStyleFamilies DLG_STYLE_DESIGNER SfxStyleFamilyItem { - StyleFamily = SFX_STYLE_FAMILY_PAGE ; + StyleFamily = SfxStyleFamily::Page ; FilterList [ en-US ] = { < "All Styles" ; SFXSTYLEBIT_ALL ; > ; diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 04e8e8fb45ab..8379d46b83c0 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1707,7 +1707,7 @@ void ScUndoSelectionStyle::DoChange( const bool bUndo ) { ScStyleSheetPool* pStlPool = rDoc.GetStyleSheetPool(); ScStyleSheet* pStyleSheet = - static_cast<ScStyleSheet*>( pStlPool->Find( aStyleName, SFX_STYLE_FAMILY_PARA ) ); + static_cast<ScStyleSheet*>( pStlPool->Find( aStyleName, SfxStyleFamily::Para ) ); if (!pStyleSheet) { OSL_FAIL("StyleSheet not found"); @@ -1746,7 +1746,7 @@ void ScUndoSelectionStyle::Repeat(SfxRepeatTarget& rTarget) ScDocument& rDoc = pDocShell->GetDocument(); ScStyleSheetPool* pStlPool = rDoc.GetStyleSheetPool(); ScStyleSheet* pStyleSheet = static_cast<ScStyleSheet*>( pStlPool-> - Find( aStyleName, SFX_STYLE_FAMILY_PARA )); + Find( aStyleName, SfxStyleFamily::Para )); if (!pStyleSheet) { OSL_FAIL("StyleSheet not found"); diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 41a5a83e6ca3..f24330881910 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -591,7 +591,7 @@ void ScUndoPrintZoom::DoChange( bool bUndo ) ScDocument& rDoc = pDocShell->GetDocument(); OUString aStyleName = rDoc.GetPageStyle( nTab ); ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool(); - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found" ); if ( pStyleSheet ) { diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index 9d336faef5c2..96ad6ccb2c7e 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -94,7 +94,7 @@ ScUndoModifyStyle::~ScUndoModifyStyle() OUString ScUndoModifyStyle::GetComment() const { - sal_uInt16 nId = (eFamily == SFX_STYLE_FAMILY_PARA) ? + sal_uInt16 nId = (eFamily == SfxStyleFamily::Para) ? STR_UNDO_EDITCELLSTYLE : STR_UNDO_EDITPAGESTYLE; return ScGlobal::GetRscString( nId ); @@ -143,7 +143,7 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName, // create style (with new name) pStyle = &pStlPool->Make( aNewName, eStyleFamily, SFXSTYLEBIT_USERDEF ); - if ( eStyleFamily == SFX_STYLE_FAMILY_PARA ) + if ( eStyleFamily == SfxStyleFamily::Para ) rDoc.GetPool()->CellStyleCreated( aNewName, &rDoc ); } @@ -151,7 +151,7 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName, { if ( bDelete ) { - if ( eStyleFamily == SFX_STYLE_FAMILY_PARA ) + if ( eStyleFamily == SfxStyleFamily::Para ) lcl_DocStyleChanged( &rDoc, pStyle, true ); // TRUE: remove usage of style else rDoc.RemovePageStyleInUse( rName ); @@ -173,7 +173,7 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName, if (pNewSet) rStyleSet.Set( *pNewSet, false ); - if ( eStyleFamily == SFX_STYLE_FAMILY_PARA ) + if ( eStyleFamily == SfxStyleFamily::Para ) { lcl_DocStyleChanged( &rDoc, pStyle, false ); // cell styles: row heights } diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 1247ab21aa2c..213d83f5349f 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -2066,7 +2066,7 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const OUString& aPropert break; case SC_WID_UNO_CELLSTYL: aAny <<= OUString( ScStyleNameConversion::DisplayToProgrammaticName( - ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SFX_STYLE_FAMILY_PARA ) ); + ScGlobal::GetRscString(STR_STYLENAME_STANDARD), SfxStyleFamily::Para ) ); break; case SC_WID_UNO_TBLBORD: case SC_WID_UNO_TBLBORD2: @@ -2351,7 +2351,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE OUString aStrVal; aValue >>= aStrVal; OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( - aStrVal, SFX_STYLE_FAMILY_PARA )); + aStrVal, SfxStyleFamily::Para )); pDocShell->GetDocFunc().ApplyStyle( *GetMarkData(), aString, true ); } break; @@ -2539,7 +2539,7 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE if (pStyle) aStyleName = pStyle->GetName(); rAny <<= OUString( ScStyleNameConversion::DisplayToProgrammaticName( - aStyleName, SFX_STYLE_FAMILY_PARA ) ); + aStyleName, SfxStyleFamily::Para ) ); } break; case SC_WID_UNO_TBLBORD: @@ -8130,7 +8130,7 @@ void ScTableSheetObj::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn OUString aStrVal; aValue >>= aStrVal; OUString aNewStr(ScStyleNameConversion::ProgrammaticToDisplayName( - aStrVal, SFX_STYLE_FAMILY_PAGE )); + aStrVal, SfxStyleFamily::Page )); //! Undo? (auch bei SID_STYLE_APPLY an der View) @@ -8455,7 +8455,7 @@ void ScTableSheetObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEn else if ( pEntry->nWID == SC_WID_UNO_PAGESTL ) { rAny <<= OUString( ScStyleNameConversion::DisplayToProgrammaticName( - rDoc.GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE ) ); + rDoc.GetPageStyle( nTab ), SfxStyleFamily::Page ) ); } else if ( pEntry->nWID == SC_WID_UNO_CELLVIS ) { diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx index 2abcfb96fcf6..e4692ae1af9c 100644 --- a/sc/source/ui/unoobj/fmtuno.cxx +++ b/sc/source/ui/unoobj/fmtuno.cxx @@ -308,7 +308,7 @@ void SAL_CALL ScTableConditionalFormat::addNew( OUString aStrVal; if ( rProp.Value >>= aStrVal ) aEntry.maStyle = ScStyleNameConversion::ProgrammaticToDisplayName( - aStrVal, SFX_STYLE_FAMILY_PARA ); + aStrVal, SfxStyleFamily::Para ); } else if ( rProp.Name == SC_UNONAME_FORMULANMSP1 ) { @@ -592,14 +592,14 @@ void SAL_CALL ScTableConditionalEntry::setSourcePosition( const table::CellAddre OUString SAL_CALL ScTableConditionalEntry::getStyleName() throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - return ScStyleNameConversion::DisplayToProgrammaticName( aData.maStyle, SFX_STYLE_FAMILY_PARA ); + return ScStyleNameConversion::DisplayToProgrammaticName( aData.maStyle, SfxStyleFamily::Para ); } void SAL_CALL ScTableConditionalEntry::setStyleName( const OUString& aStyleName ) throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - aData.maStyle = ScStyleNameConversion::ProgrammaticToDisplayName( aStyleName, SFX_STYLE_FAMILY_PARA ); + aData.maStyle = ScStyleNameConversion::ProgrammaticToDisplayName( aStyleName, SfxStyleFamily::Para ); } ScTableValidationObj::ScTableValidationObj(ScDocument* pDoc, sal_uLong nKey, diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index 0d242d73df34..ddfa113ebf51 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -412,10 +412,10 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance( new ScEditFieldObj(xNullContent, nullptr, getFieldType(nType), ESelection()))); } break; case Type::CELLSTYLE: - xRet.set(static_cast<style::XStyle*>(new ScStyleObj( nullptr, SFX_STYLE_FAMILY_PARA, OUString() ))); + xRet.set(static_cast<style::XStyle*>(new ScStyleObj( nullptr, SfxStyleFamily::Para, OUString() ))); break; case Type::PAGESTYLE: - xRet.set(static_cast<style::XStyle*>(new ScStyleObj( nullptr, SFX_STYLE_FAMILY_PAGE, OUString() ))); + xRet.set(static_cast<style::XStyle*>(new ScStyleObj( nullptr, SfxStyleFamily::Page, OUString() ))); break; case Type::AUTOFORMAT: xRet.set(static_cast<container::XIndexAccess*>(new ScAutoFormatObj( SC_AFMTOBJ_INVALID ))); diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index d5942b056c52..4a7b14ff8a8b 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -372,7 +372,7 @@ static const SfxItemPropertyMap* lcl_GetFooterStyleMap() #define SC_FAMILYNAME_CELL "CellStyles" #define SC_FAMILYNAME_PAGE "PageStyles" -static const sal_uInt16 aStyleFamilyTypes[SC_STYLE_FAMILY_COUNT] = { SFX_STYLE_FAMILY_PARA, SFX_STYLE_FAMILY_PAGE }; +static const SfxStyleFamily aStyleFamilyTypes[SC_STYLE_FAMILY_COUNT] = { SfxStyleFamily::Para, SfxStyleFamily::Page }; using sc::HMMToTwips; using sc::TwipsToHMM; @@ -422,14 +422,14 @@ void ScStyleFamiliesObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) // XStyleFamilies -ScStyleFamilyObj*ScStyleFamiliesObj::GetObjectByType_Impl(sal_uInt16 nType) const +ScStyleFamilyObj*ScStyleFamiliesObj::GetObjectByType_Impl(SfxStyleFamily nType) const { if ( pDocShell ) { - if ( nType == SFX_STYLE_FAMILY_PARA ) - return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PARA ); - else if ( nType == SFX_STYLE_FAMILY_PAGE ) - return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PAGE ); + if ( nType == SfxStyleFamily::Para ) + return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Para ); + else if ( nType == SfxStyleFamily::Page ) + return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Page ); } OSL_FAIL("getStyleFamilyByType: keine DocShell oder falscher Typ"); return nullptr; @@ -448,9 +448,9 @@ ScStyleFamilyObj* ScStyleFamiliesObj::GetObjectByName_Impl(const OUString& aName if ( pDocShell ) { if ( aName == SC_FAMILYNAME_CELL ) - return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PARA ); + return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Para ); else if ( aName == SC_FAMILYNAME_PAGE ) - return new ScStyleFamilyObj( pDocShell, SFX_STYLE_FAMILY_PAGE ); + return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Page ); } // no assertion - called directly from getByName return nullptr; @@ -682,7 +682,7 @@ void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno:: if ( pStyleObj && pStyleObj->GetFamily() == eFamily && !pStyleObj->IsInserted() ) // noch nicht eingefuegt? { - OUString aNameStr(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) )); + OUString aNameStr(ScStyleNameConversion::ProgrammaticToDisplayName( aName, eFamily )); ScDocument& rDoc = pDocShell->GetDocument(); ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool(); @@ -694,7 +694,7 @@ void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno:: { (void)pStylePool->Make( aNameStr, eFamily, SFXSTYLEBIT_USERDEF ); - if ( eFamily == SFX_STYLE_FAMILY_PARA && !rDoc.IsImportingXML() ) + if ( eFamily == SfxStyleFamily::Para && !rDoc.IsImportingXML() ) rDoc.GetPool()->CellStyleCreated( aNameStr, &rDoc ); pStyleObj->InitDoc( pDocShell, aNameStr ); // Objekt kann benutzt werden @@ -735,7 +735,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName ) bool bFound = false; if ( pDocShell ) { - OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) )); + OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, eFamily )); ScDocument& rDoc = pDocShell->GetDocument(); ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool(); @@ -747,7 +747,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName ) if (pStyle) { bFound = true; - if ( eFamily == SFX_STYLE_FAMILY_PARA ) + if ( eFamily == SfxStyleFamily::Para ) { // wie ScViewFunc::RemoveStyleSheetInUse ScopedVclPtrInstance< VirtualDevice > pVDev; @@ -831,7 +831,7 @@ uno::Any SAL_CALL ScStyleFamilyObj::getByName( const OUString& aName ) { SolarMutexGuard aGuard; uno::Reference< style::XStyle > xObj( - GetObjectByName_Impl( ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) ) )); + GetObjectByName_Impl( ScStyleNameConversion::ProgrammaticToDisplayName( aName, eFamily ) )); if (xObj.is()) return uno::makeAny(xObj); else @@ -860,7 +860,7 @@ uno::Sequence<OUString> SAL_CALL ScStyleFamilyObj::getElementNames() OSL_ENSURE( nPos<nCount, "Anzahl durcheinandergekommen" ); if (nPos<nCount) pAry[nPos++] = ScStyleNameConversion::DisplayToProgrammaticName( - pStyle->GetName(), sal::static_int_cast<sal_uInt16>(eFamily) ); + pStyle->GetName(), eFamily ); pStyle = aIter.Next(); } return aSeq; @@ -874,7 +874,7 @@ sal_Bool SAL_CALL ScStyleFamilyObj::hasByName( const OUString& aName ) SolarMutexGuard aGuard; if ( pDocShell ) { - OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, sal::static_int_cast<sal_uInt16>(eFamily) )); + OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, eFamily )); ScDocument& rDoc = pDocShell->GetDocument(); ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool(); @@ -907,9 +907,9 @@ uno::Any SAL_CALL ScStyleFamilyObj::getPropertyValue( const OUString& sPropertyN sal_uInt32 nResId = 0; switch ( eFamily ) { - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: nResId = STR_STYLE_FAMILY_CELL; break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: nResId = STR_STYLE_FAMILY_PAGE; break; default: OSL_FAIL( "ScStyleFamilyObj::getPropertyValue(): invalid family" ); @@ -951,7 +951,7 @@ void SAL_CALL ScStyleFamilyObj::removeVetoableChangeListener( const OUString&, c // Default-ctor wird fuer die Reflection gebraucht ScStyleObj::ScStyleObj(ScDocShell* pDocSh, SfxStyleFamily eFam, const OUString& rName) : - pPropSet( (eFam == SFX_STYLE_FAMILY_PARA) ? lcl_GetCellStyleSet() : lcl_GetPageStyleSet() ), + pPropSet( (eFam == SfxStyleFamily::Para) ? lcl_GetCellStyleSet() : lcl_GetPageStyleSet() ), pDocShell( pDocSh ), eFamily( eFam ), aStyleName( rName ) @@ -1060,7 +1060,7 @@ OUString SAL_CALL ScStyleObj::getParentStyle() throw(uno::RuntimeException, std: SolarMutexGuard aGuard; SfxStyleSheetBase* pStyle = GetStyle_Impl(); if (pStyle) - return ScStyleNameConversion::DisplayToProgrammaticName( pStyle->GetParent(), sal::static_int_cast<sal_uInt16>(eFamily) ); + return ScStyleNameConversion::DisplayToProgrammaticName( pStyle->GetParent(), eFamily ); return OUString(); } @@ -1074,20 +1074,20 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle ) if (pStyle) { // cell styles cannot be modified if any sheet is protected - if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( pDocShell->GetDocument() ) ) + if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) ) return; //! exception? //! DocFunc-Funktion?? //! Undo ????????????? - OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( rParentStyle, sal::static_int_cast<sal_uInt16>(eFamily) )); + OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( rParentStyle, eFamily )); bool bOk = pStyle->SetParent( aString ); if (bOk) { // wie bei setPropertyValue ScDocument& rDoc = pDocShell->GetDocument(); - if ( eFamily == SFX_STYLE_FAMILY_PARA ) + if ( eFamily == SfxStyleFamily::Para ) { // Zeilenhoehen anpassen... @@ -1121,7 +1121,7 @@ OUString SAL_CALL ScStyleObj::getName() throw(uno::RuntimeException, std::except SolarMutexGuard aGuard; SfxStyleSheetBase* pStyle = GetStyle_Impl(); if (pStyle) - return ScStyleNameConversion::DisplayToProgrammaticName( pStyle->GetName(), sal::static_int_cast<sal_uInt16>(eFamily) ); + return ScStyleNameConversion::DisplayToProgrammaticName( pStyle->GetName(), eFamily ); return OUString(); } @@ -1133,7 +1133,7 @@ void SAL_CALL ScStyleObj::setName( const OUString& aNewName ) if (pStyle) { // cell styles cannot be renamed if any sheet is protected - if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( pDocShell->GetDocument() ) ) + if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) ) return; //! exception? //! DocFunc-Funktion?? @@ -1145,11 +1145,11 @@ void SAL_CALL ScStyleObj::setName( const OUString& aNewName ) aStyleName = aNewName; //! notify other objects for this style? ScDocument& rDoc = pDocShell->GetDocument(); - if ( eFamily == SFX_STYLE_FAMILY_PARA && !rDoc.IsImportingXML() ) + if ( eFamily == SfxStyleFamily::Para && !rDoc.IsImportingXML() ) rDoc.GetPool()->CellStyleCreated( aNewName, &rDoc ); // Zellvorlagen = 2, Seitenvorlagen = 4 - sal_uInt16 nId = ( eFamily == SFX_STYLE_FAMILY_PARA ) ? + sal_uInt16 nId = ( eFamily == SfxStyleFamily::Para ) ? SID_STYLE_FAMILY2 : SID_STYLE_FAMILY4; SfxBindings* pBindings = pDocShell->GetViewBindings(); if (pBindings) @@ -1178,7 +1178,7 @@ const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( const OUString& rPropName, if (pStyle) { const SfxItemPropertySimpleEntry* pEntry = nullptr; - if ( eFamily == SFX_STYLE_FAMILY_PAGE ) + if ( eFamily == SfxStyleFamily::Page ) { pEntry = lcl_GetHeaderStyleMap()->getByName( rPropName ); if ( pEntry ) // only item-wids in header/footer map @@ -1444,7 +1444,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault() if ( pStyle ) { // cell styles cannot be modified if any sheet is protected - if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( pDocShell->GetDocument() ) ) + if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) ) throw uno::RuntimeException(); SfxItemSet& rSet = pStyle->GetItemSet(); @@ -1453,7 +1453,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault() //! merge with SetOneProperty ScDocument& rDoc = pDocShell->GetDocument(); - if ( eFamily == SFX_STYLE_FAMILY_PARA ) + if ( eFamily == SfxStyleFamily::Para ) { // row heights @@ -1558,12 +1558,12 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt if ( pStyle && pEntry ) { // cell styles cannot be modified if any sheet is protected - if ( eFamily == SFX_STYLE_FAMILY_PARA && lcl_AnyTabProtected( pDocShell->GetDocument() ) ) + if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) ) throw uno::RuntimeException(); SfxItemSet& rSet = pStyle->GetItemSet(); // direkt im lebenden Style aendern... bool bDone = false; - if ( eFamily == SFX_STYLE_FAMILY_PAGE ) + if ( eFamily == SfxStyleFamily::Page ) { if(pEntry->nWID == SC_WID_UNO_HEADERSET) { @@ -1835,7 +1835,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt //! Undo ????????????? ScDocument& rDoc = pDocShell->GetDocument(); - if ( eFamily == SFX_STYLE_FAMILY_PARA ) + if ( eFamily == SfxStyleFamily::Para ) { // Zeilenhoehen anpassen... @@ -2017,7 +2017,7 @@ sal_Bool SAL_CALL ScStyleObj::supportsService( const OUString& rServiceName ) uno::Sequence<OUString> SAL_CALL ScStyleObj::getSupportedServiceNames() throw(uno::RuntimeException, std::exception) { - bool bPage = ( eFamily == SFX_STYLE_FAMILY_PAGE ); + bool bPage = ( eFamily == SfxStyleFamily::Page ); uno::Sequence<OUString> aRet(2); OUString* pArray = aRet.getArray(); pArray[0] = SCSTYLE_SERVICE; diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 0850aad67670..258a9c3d1e90 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -196,7 +196,7 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) SCTAB nCurTab = GetViewData()->GetTabNo(); OUString aPageStyle = pDoc->GetPageStyle( nCurTab ); SfxStyleSheet* pStyleSheet = pStylePool ? static_cast<SfxStyleSheet*>(pStylePool-> - Find( aPageStyle, SFX_STYLE_FAMILY_PAGE )) : nullptr; + Find( aPageStyle, SfxStyleFamily::Page )) : nullptr; if ( pStyleSheet ) rSet.Put( SfxTemplateItem( nSlotId, aPageStyle ) ); @@ -217,7 +217,7 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) pTabViewShell->GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get()); - bool bPage = pFamilyItem && SFX_STYLE_FAMILY_PAGE == SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()); + bool bPage = pFamilyItem && SfxStyleFamily::Page == SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()); if ( bProtected || bPage ) rSet.DisableItem( nSlotId ); @@ -232,7 +232,7 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) std::unique_ptr<SfxPoolItem> pItem; pTabViewShell->GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get()); - bool bPage = pFamilyItem && SFX_STYLE_FAMILY_PAGE == SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()); + bool bPage = pFamilyItem && SfxStyleFamily::Page == SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()); if ( bProtected && !bPage ) rSet.DisableItem( nSlotId ); @@ -274,7 +274,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) { if (nSlotId == SID_STYLE_PREVIEW) { - SfxStyleFamily eFamily = SFX_STYLE_FAMILY_PARA; + SfxStyleFamily eFamily = SfxStyleFamily::Para; const SfxPoolItem* pFamItem; if ( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY, true, &pFamItem ) ) eFamily = (SfxStyleFamily) static_cast<const SfxUInt16Item*>(pFamItem)->GetValue(); @@ -282,7 +282,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) OUString aStyleName; if (pArgs && SfxItemState::SET == pArgs->GetItemState( nSlotId, true, &pNameItem )) aStyleName = static_cast<const SfxStringItem*>(pNameItem)->GetValue(); - if ( eFamily == SFX_STYLE_FAMILY_PARA ) // CellStyles + if ( eFamily == SfxStyleFamily::Para ) // CellStyles { ScMarkData aFuncMark( pViewData->GetMarkData() ); ScViewUtil::UnmarkFiltered( aFuncMark, &rDoc ); @@ -354,7 +354,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) ScStyleSaveData aOldData; // for undo/redo ScStyleSaveData aNewData; - SfxStyleFamily eFamily = SFX_STYLE_FAMILY_PARA; + SfxStyleFamily eFamily = SfxStyleFamily::Para; const SfxPoolItem* pFamItem; if ( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY, true, &pFamItem ) ) eFamily = (SfxStyleFamily) static_cast<const SfxUInt16Item*>(pFamItem)->GetValue(); @@ -362,9 +362,9 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) { OUString sFamily = static_cast<const SfxStringItem*>(pFamItem)->GetValue(); if (sFamily == "CellStyles") - eFamily = SFX_STYLE_FAMILY_PARA; + eFamily = SfxStyleFamily::Para; else if (sFamily == "PageStyles") - eFamily = SFX_STYLE_FAMILY_PAGE; + eFamily = SfxStyleFamily::Page; } OUString aStyleName; @@ -495,7 +495,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) switch ( eFamily ) { - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: { switch ( nSlotId ) { @@ -652,10 +652,10 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) default: break; } - } // case SFX_STYLE_FAMILY_PARA: + } // case SfxStyleFamily::Para: break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: { switch ( nSlotId ) { @@ -764,7 +764,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) default: break; } // switch ( nSlotId ) - } // case SFX_STYLE_FAMILY_PAGE: + } // case SfxStyleFamily::Page: break; default: @@ -786,11 +786,11 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) switch ( eFam ) { - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: nRsc = RID_SCDLG_STYLES_PAGE; break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: default: { SfxItemSet& rSet = pStyleSheet->GetItemSet(); @@ -876,7 +876,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) // Attribute comparisons (earlier in ModifyStyleSheet) now here // with the old values (the style is already changed) - if ( SFX_STYLE_FAMILY_PARA == eFam ) + if ( SfxStyleFamily::Para == eFam ) { SfxItemSet& rNewSet = pStyleSheet->GetItemSet(); bool bNumFormatChanged; @@ -923,7 +923,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) pDocSh->SetDocumentModified(); - if ( SFX_STYLE_FAMILY_PARA == eFam ) + if ( SfxStyleFamily::Para == eFam ) { ScTabViewShell::UpdateNumberFormatter( static_cast<const SvxNumberInfoItem&>( diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 0abbfa970629..5cc9ba4e5c01 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2184,12 +2184,12 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) switch ( eFamily ) { - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: pViewData->GetView()->SetStyleSheetToMarked( pStyleSheet ); pViewData->GetView()->DoneBlockMode(); break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: pViewData->GetDocument()->SetPageStyle( pViewData->GetTabNo(), pStyleSheet->GetName() ); diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 18f40388d8ee..db7d43b0a592 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -790,7 +790,7 @@ static Size lcl_GetDocPageSize( ScDocument* pDoc, SCTAB nTab ) { OUString aName = pDoc->GetPageStyle( nTab ); ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aName, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aName, SfxStyleFamily::Page ); if ( pStyleSheet ) { SfxItemSet& rStyleSet = pStyleSheet->GetItemSet(); @@ -1061,7 +1061,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) OUString aOldName = rDoc.GetPageStyle( nTab ); bool bUndo = rDoc.IsUndoEnabled(); ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool(); - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SfxStyleFamily::Page ); if ( pStyleSheet ) { @@ -1115,7 +1115,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) if( bUndo ) { pDocShell->GetUndoManager()->AddUndoAction( - new ScUndoModifyStyle( pDocShell, SFX_STYLE_FAMILY_PAGE, + new ScUndoModifyStyle( pDocShell, SfxStyleFamily::Page, aOldData, aNewData ) ); } @@ -1156,7 +1156,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) ScDocument& rDoc = pDocShell->GetDocument(); bool bUndo = rDoc.IsUndoEnabled(); ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool(); - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( rDoc.GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find( rDoc.GetPageStyle( nTab ), SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found" ); if ( pStyleSheet ) { @@ -1217,7 +1217,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) if( bUndo ) { pDocShell->GetUndoManager()->AddUndoAction( - new ScUndoModifyStyle( pDocShell, SFX_STYLE_FAMILY_PAGE, + new ScUndoModifyStyle( pDocShell, SfxStyleFamily::Page, aOldData, aNewData ) ); } diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 3dfb9e5efc5b..885273f78739 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -240,7 +240,7 @@ bool ScPreviewShell::GetPageSize( Size& aPageSize ) ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = pStylePool->Find( rDoc.GetPageStyle( nTab ), - SFX_STYLE_FAMILY_PAGE ); + SfxStyleFamily::Page ); OSL_ENSURE(pStyleSheet,"No style sheet"); if (!pStyleSheet) return false; const SfxItemSet* pParamSet = &pStyleSheet->GetItemSet(); @@ -727,7 +727,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq ) SCTAB nTab = pPreview->GetTab(); OUString aOldName = pDocShell->GetDocument().GetPageStyle( pPreview->GetTab() ); ScStyleSheetPool* pStylePool = pDocShell->GetDocument().GetStyleSheetPool(); - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" ); if ( pReqArgs && pStyleSheet && SfxItemState::SET == pReqArgs->GetItemState( SID_PREVIEW_SCALINGFACTOR, true, &pItem ) ) @@ -841,7 +841,7 @@ void ScPreviewShell::GetState( SfxItemSet& rSet ) { OUString aOldName = pDocShell->GetDocument().GetPageStyle( pPreview->GetTab() ); ScStyleSheetPool* pStylePool = pDocShell->GetDocument().GetStyleSheetPool(); - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found! :-/" ); if ( pStyleSheet ) diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index ca7a15a82fb2..26851bc47b73 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -203,7 +203,7 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions ) ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nPrintTab ), - SFX_STYLE_FAMILY_PAGE ); + SfxStyleFamily::Page ); if (pStyleSheet) pParamSet = &pStyleSheet->GetItemSet(); else @@ -424,7 +424,7 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr bool bDoGrid, bNullVal, bFormula; ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE ); + SfxStyleSheetBase* pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ), SfxStyleFamily::Page ); if (pStyleSheet) { SfxItemSet& rSet = pStyleSheet->GetItemSet(); diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index 3468d086d8dd..42b843cdd59a 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -1288,7 +1288,7 @@ sal_uInt16 ScTabView::CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom ) ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nCurTab ), - SFX_STYLE_FAMILY_PAGE ); + SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found :-/" ); diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index c005614bdb4e..e012f7157fc6 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -278,7 +278,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) OUString aStyleName = pDoc->GetPageStyle( nTab ); ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, - SFX_STYLE_FAMILY_PAGE ); + SfxStyleFamily::Page ); OSL_ENSURE( pStyleSheet, "PageStyle not found" ); if ( pStyleSheet ) { diff --git a/sd/inc/glob.hxx b/sd/inc/glob.hxx index e229e9a2efd9..6f66420624a1 100644 --- a/sd/inc/glob.hxx +++ b/sd/inc/glob.hxx @@ -54,10 +54,10 @@ const sal_uInt32 SdUDInventor=sal_uInt32('S')*0x00000001+ #define SD_IMAPINFO_ID 2 // FamilyId of presentation templates -#define SD_STYLE_FAMILY_GRAPHICS SFX_STYLE_FAMILY_PARA -#define SD_STYLE_FAMILY_PSEUDO SFX_STYLE_FAMILY_PSEUDO -#define SD_STYLE_FAMILY_CELL SFX_STYLE_FAMILY_FRAME -#define SD_STYLE_FAMILY_MASTERPAGE SFX_STYLE_FAMILY_PAGE // ex LT_FAMILY +#define SD_STYLE_FAMILY_GRAPHICS SfxStyleFamily::Para +#define SD_STYLE_FAMILY_PSEUDO SfxStyleFamily::Pseudo +#define SD_STYLE_FAMILY_CELL SfxStyleFamily::Frame +#define SD_STYLE_FAMILY_MASTERPAGE SfxStyleFamily::Page // ex LT_FAMILY // Separator between layout name and template name of presentation templates #define SD_LT_SEPARATOR "~LT~" diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 49bc9bfa56c1..5f8b31abd807 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -1645,8 +1645,8 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum, } // Now look for all of them when searching - pSourceStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_ALL); - mxStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_ALL); + pSourceStyleSheetPool->SetSearchMask(SfxStyleFamily::All); + mxStyleSheetPool->SetSearchMask(SfxStyleFamily::All); } if (bUndo && !aCreatedStyles.empty()) diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index e94ac242ae6b..9facb3020bcd 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -142,7 +142,7 @@ SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SotSt // iterate over all styles SdStyleSheetPool* pStyleSheetPool = pDocument->GetSdStyleSheetPool(); SfxStyleSheetIteratorPtr aIter = - std::make_shared<SfxStyleSheetIterator>(pStyleSheetPool, SFX_STYLE_FAMILY_ALL); + std::make_shared<SfxStyleSheetIterator>(pStyleSheetPool, SfxStyleFamily::All); for (SfxStyleSheetBase *pSheet = aIter->First(); pSheet; pSheet = aIter->Next()) { diff --git a/sd/source/ui/app/res_bmp.src b/sd/source/ui/app/res_bmp.src index c81f408621e7..abc0ef1b0d46 100644 --- a/sd/source/ui/app/res_bmp.src +++ b/sd/source/ui/app/res_bmp.src @@ -287,7 +287,7 @@ SfxStyleFamilies DLG_STYLE_DESIGNER SfxStyleFamilyItem RID_GRAPHICSTYLEFAMILY { Text [ en-US ] = "Graphic Styles" ; - StyleFamily = SFX_STYLE_FAMILY_PARA ; + StyleFamily = SfxStyleFamily::Para ; FilterList [ en-US ] = { < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ; @@ -299,7 +299,7 @@ SfxStyleFamilies DLG_STYLE_DESIGNER SfxStyleFamilyItem RID_PRESENTATIONSTYLEFAMILY { Text [ en-US ] = "Presentation Styles" ; - StyleFamily = SFX_STYLE_FAMILY_PSEUDO ; + StyleFamily = SfxStyleFamily::Pseudo ; FilterList [ en-US ] = { < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ; diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index dcec27d767a3..e91caaac95f6 100644 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -110,7 +110,7 @@ void DrawDocShell::Construct( bool bClipboard ) mpDoc->SetSdrUndoManager( mpUndoManager ); mpDoc->SetSdrUndoFactory( new sd::UndoFactory ); UpdateTablePointers(); - SetStyleFamily(5); //CL: actually SFX_STYLE_FAMILY_PSEUDO + SetStyleFamily(SfxStyleFamily::Pseudo); } DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode, diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index e0d97731796c..ddeb24c01aa1 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -103,11 +103,11 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) SfxStyleSheetBase* pStyleSheet = nullptr; const SfxPoolItem* pItem; - sal_uInt16 nFamily = USHRT_MAX; + SfxStyleFamily nFamily = (SfxStyleFamily)USHRT_MAX; if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY, false, &pItem )) { - nFamily = static_cast<const SfxUInt16Item &>( pArgs->Get( SID_STYLE_FAMILY ) ).GetValue(); + nFamily = (SfxStyleFamily) static_cast<const SfxUInt16Item &>( pArgs->Get( SID_STYLE_FAMILY ) ).GetValue(); } else if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILYNAME, false, &pItem )) @@ -162,13 +162,13 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) { case SID_STYLE_NEW: { - SfxStyleSheetBase *p = pSSPool->Find(aStyleName, (SfxStyleFamily) nFamily ); + SfxStyleSheetBase *p = pSSPool->Find(aStyleName, nFamily ); if(p) { pSSPool->Remove(p); p = nullptr; } - pStyleSheet = &pSSPool->Make( aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_USERDEF ); + pStyleSheet = &pSSPool->Make( aStyleName, nFamily, SFXSTYLEBIT_USERDEF ); if (pArgs && pArgs->GetItemState(SID_STYLE_REFERENCE) == SfxItemState::SET) { @@ -185,23 +185,23 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) case SID_STYLE_NEW_BY_EXAMPLE: { // at the moment, the dialog to enter the name of the template is still opened - SfxStyleSheetBase *p = pSSPool->Find(aStyleName, (SfxStyleFamily) nFamily ); + SfxStyleSheetBase *p = pSSPool->Find(aStyleName, nFamily ); if(p) { pSSPool->Remove(p); p = nullptr; } - pStyleSheet = &pSSPool->Make( aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_USERDEF ); + pStyleSheet = &pSSPool->Make( aStyleName, nFamily, SFXSTYLEBIT_USERDEF ); pStyleSheet->SetParent(SD_RESSTR(STR_STANDARD_STYLESHEET_NAME)); } break; case SID_STYLE_EDIT: - pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily); + pStyleSheet = pSSPool->Find( aStyleName, nFamily); break; case SID_STYLE_DELETE: - pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily); + pStyleSheet = pSSPool->Find( aStyleName, nFamily); if( pStyleSheet ) { pSSPool->Remove( pStyleSheet ); @@ -216,14 +216,14 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) case SID_STYLE_HIDE: case SID_STYLE_SHOW: - pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily); + pStyleSheet = pSSPool->Find( aStyleName, nFamily); pStyleSheet->SetHidden( nSId == SID_STYLE_HIDE ); nRetMask = sal_uInt16(true); break; case SID_STYLE_APPLY: // apply the template to the document - pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily); + pStyleSheet = pSSPool->Find( aStyleName, nFamily); // do not set presentation styles, they will be set implicit if ( pStyleSheet && pStyleSheet->GetFamily() != SD_STYLE_FAMILY_PSEUDO ) @@ -258,7 +258,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) { aStyleName = static_cast<const SfxStringItem &>( pArgs->Get( nSId ) ).GetValue(); SD_MOD()->SetWaterCan( true ); - pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily); + pStyleSheet = pSSPool->Find( aStyleName, nFamily); } // no presentation object templates, they are only allowed implicitly if( pStyleSheet && pStyleSheet->GetFamily() != SD_STYLE_FAMILY_PSEUDO ) diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx index 7323d28fe4ed..cc5a8c0e3d1c 100644 --- a/sd/source/ui/inc/DrawDocShell.hxx +++ b/sd/source/ui/inc/DrawDocShell.hxx @@ -156,8 +156,8 @@ public: void SetSlotFilter(bool bEnable = false, sal_uInt16 nCount = 0, const sal_uInt16* pSIDs = nullptr) { mbFilterEnable = bEnable; mnFilterCount = nCount; mpFilterSIDs = pSIDs; } void ApplySlotFilter() const; - sal_uInt16 GetStyleFamily() const { return mnStyleFamily; } - void SetStyleFamily( sal_uInt16 nSF ) { mnStyleFamily = nSF; } + SfxStyleFamily GetStyleFamily() const { return mnStyleFamily; } + void SetStyleFamily( SfxStyleFamily nSF ) { mnStyleFamily = nSF; } /** executes the SID_OPENDOC slot to let the framework open a document with the given URL and this document as a referer */ @@ -212,7 +212,7 @@ protected: FontList* mpFontList; rtl::Reference<FuPoor> mxDocShellFunction; DocumentType meDocType; - sal_uInt16 mnStyleFamily; + SfxStyleFamily mnStyleFamily; const sal_uInt16* mpFilterSIDs; sal_uInt16 mnFilterCount; bool mbFilterEnable; diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 6fcf154f7cc9..56e7e4b7e2c4 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -348,7 +348,7 @@ void SlotManager::FuSupport (SfxRequest& rRequest) const SfxPoolItem& rItem ( rRequest.GetArgs()->Get(SID_STYLE_FAMILY)); pDocument->GetDocSh()->SetStyleFamily( - static_cast<const SfxUInt16Item&>(rItem).GetValue()); + (SfxStyleFamily) static_cast<const SfxUInt16Item&>(rItem).GetValue()); } } break; diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 36d9519e3cf5..b4f59a6bc9ed 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -694,7 +694,7 @@ void DrawViewShell::FuDeleteSelectedObjects() void DrawViewShell::FuSupport(SfxRequest& rReq) { if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs()) - GetDocSh()->SetStyleFamily(static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()); + GetDocSh()->SetStyleFamily((SfxStyleFamily) static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()); // We do not execute a thing during a native slide show if(SlideShow::IsRunning(GetViewShellBase()) && diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index adf70d3a3555..2c8787db715c 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -417,7 +417,7 @@ void OutlineViewShell::GetCtrlState(SfxItemSet &rSet) void OutlineViewShell::FuSupport(SfxRequest &rReq) { if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs()) - GetDocSh()->SetStyleFamily(static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()); + GetDocSh()->SetStyleFamily((SfxStyleFamily) static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()); bool bPreviewState = false; sal_uLong nSlot = rReq.GetSlot(); diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index 24517015a02f..a23c752b5670 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -103,9 +103,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet ) if( pStyleSheet ) { - SfxStyleFamily eFamily = pStyleSheet->GetFamily(); - nFamily = SfxTemplate::SfxFamilyIdToNId(eFamily); - GetDocSh()->SetStyleFamily(nFamily); + GetDocSh()->SetStyleFamily(pStyleSheet->GetFamily()); } } } diff --git a/sfx2/source/dialog/styfitem.cxx b/sfx2/source/dialog/styfitem.cxx index c851670650a1..afc5a2b01a3e 100644 --- a/sfx2/source/dialog/styfitem.cxx +++ b/sfx2/source/dialog/styfitem.cxx @@ -57,10 +57,11 @@ SfxStyleFamilyItem::SfxStyleFamilyItem( const ResId &rResId ) : } if(nMask & (sal_uInt32)SfxStyleItem::StyleFamily) { - nFamily = static_cast<sal_uInt16>(ReadLongRes()); + nFamily = static_cast<SfxStyleFamily>(ReadLongRes()); } else - nFamily = SFX_STYLE_FAMILY_PARA; + nFamily = SfxStyleFamily::Para; + if(nMask & (sal_uInt32)SfxStyleItem::Image) { aImage = Image(ResId(static_cast<RSHEADER_TYPE *>(GetClassRes()),*rResId.GetResMgr())); diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 8827712c30ef..36105009920d 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -236,7 +236,7 @@ sal_Int8 DropListBox_Impl::AcceptDrop( const AcceptDropEvent& rEvt ) { // special case: page styles are allowed to create new styles by example // but not allowed to be created by drag and drop - if (pDialog->GetActualFamily() == SFX_STYLE_FAMILY_PAGE || + if (pDialog->GetActualFamily() == SfxStyleFamily::Page || pDialog->bNewByExampleDisabled) return DND_ACTION_NONE; else @@ -744,17 +744,17 @@ void SfxCommonTemplateDialog_Impl::ReadResource() for (i = 0; i < nCount; ++i) { sal_uInt16 nSlot = 0; - switch( (sal_uInt16)pStyleFamilies->at( i )->GetFamily() ) + switch( pStyleFamilies->at( i )->GetFamily() ) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: nSlot = SID_STYLE_FAMILY1; break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: nSlot = SID_STYLE_FAMILY2; break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: nSlot = SID_STYLE_FAMILY3; break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: nSlot = SID_STYLE_FAMILY4; break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: nSlot = SID_STYLE_FAMILY5; break; default: OSL_FAIL("unknown StyleFamily"); break; } @@ -890,11 +890,11 @@ namespace SfxTemplate { switch ( nFamily ) { - case SFX_STYLE_FAMILY_CHAR: return 1; - case SFX_STYLE_FAMILY_PARA: return 2; - case SFX_STYLE_FAMILY_FRAME: return 3; - case SFX_STYLE_FAMILY_PAGE: return 4; - case SFX_STYLE_FAMILY_PSEUDO: return 5; + case SfxStyleFamily::Char: return 1; + case SfxStyleFamily::Para: return 2; + case SfxStyleFamily::Frame: return 3; + case SfxStyleFamily::Page: return 4; + case SfxStyleFamily::Pseudo: return 5; default: return 0; } } @@ -903,12 +903,12 @@ namespace SfxTemplate { switch (nId) { - case 1: return SFX_STYLE_FAMILY_CHAR; - case 2: return SFX_STYLE_FAMILY_PARA; - case 3: return SFX_STYLE_FAMILY_FRAME; - case 4: return SFX_STYLE_FAMILY_PAGE; - case 5: return SFX_STYLE_FAMILY_PSEUDO; - default: return SFX_STYLE_FAMILY_ALL; + case 1: return SfxStyleFamily::Char; + case 2: return SfxStyleFamily::Para; + case 3: return SfxStyleFamily::Frame; + case 4: return SfxStyleFamily::Page; + case 5: return SfxStyleFamily::Pseudo; + default: return SfxStyleFamily::All; } } } @@ -2157,7 +2157,7 @@ SfxStyleFamily SfxCommonTemplateDialog_Impl::GetActualFamily() const { const SfxStyleFamilyItem *pFamilyItem = GetFamilyItem_Impl(); if( !pFamilyItem || nActFamily == 0xffff ) - return SFX_STYLE_FAMILY_PARA; + return SfxStyleFamily::Para; else return pFamilyItem->GetFamily(); } @@ -2277,13 +2277,13 @@ void SfxTemplateDialog_Impl::EnableFamilyItem( sal_uInt16 nId, bool bEnable ) void SfxTemplateDialog_Impl::InsertFamilyItem(sal_uInt16 nId,const SfxStyleFamilyItem *pItem) { OString sHelpId; - switch( (sal_uInt16) pItem->GetFamily() ) + switch( pItem->GetFamily() ) { - case SFX_STYLE_FAMILY_CHAR: sHelpId = ".uno:CharStyle"; break; - case SFX_STYLE_FAMILY_PARA: sHelpId = ".uno:ParaStyle"; break; - case SFX_STYLE_FAMILY_FRAME: sHelpId = ".uno:FrameStyle"; break; - case SFX_STYLE_FAMILY_PAGE: sHelpId = ".uno:PageStyle"; break; - case SFX_STYLE_FAMILY_PSEUDO: sHelpId = ".uno:ListStyle"; break; + case SfxStyleFamily::Char: sHelpId = ".uno:CharStyle"; break; + case SfxStyleFamily::Para: sHelpId = ".uno:ParaStyle"; break; + case SfxStyleFamily::Frame: sHelpId = ".uno:FrameStyle"; break; + case SfxStyleFamily::Page: sHelpId = ".uno:PageStyle"; break; + case SfxStyleFamily::Pseudo: sHelpId = ".uno:ListStyle"; break; default: OSL_FAIL("unknown StyleFamily"); break; } m_aActionTbL->InsertItem( nId, pItem->GetImage(), pItem->GetText(), ToolBoxItemBits::NONE, 0); @@ -2624,7 +2624,7 @@ sal_Int8 DropToolBox_Impl::AcceptDrop( const AcceptDropEvent& rEvt ) } // special case: page styles are allowed to create new styles by example // but not allowed to be created by drag and drop - if ( nItemId != SfxTemplate::SfxFamilyIdToNId( SFX_STYLE_FAMILY_PAGE )&& + if ( nItemId != SfxTemplate::SfxFamilyIdToNId( SfxStyleFamily::Page )&& IsDropFormatSupported( SotClipboardFormatId::OBJECTDESCRIPTOR ) && !rParent.bNewByExampleDisabled ) { diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 545165c37909..7219e3fbefd8 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -327,7 +327,7 @@ void SfxObjectShell::LoadStyles DBG_ASSERT(pSourcePool, "Source-DocumentShell ohne StyleSheetPool"); SfxStyleSheetBasePool *pMyPool = GetStyleSheetPool(); DBG_ASSERT(pMyPool, "Dest-DocumentShell ohne StyleSheetPool"); - pSourcePool->SetSearchMask(SFX_STYLE_FAMILY_ALL); + pSourcePool->SetSearchMask(SfxStyleFamily::All); std::unique_ptr<Styles_Impl[]> pFound(new Styles_Impl[pSourcePool->Count()]); sal_uInt16 nFound = 0; diff --git a/svl/qa/unit/items/test_IndexedStyleSheets.cxx b/svl/qa/unit/items/test_IndexedStyleSheets.cxx index c6c728818979..bb06e05cbfc5 100644 --- a/svl/qa/unit/items/test_IndexedStyleSheets.cxx +++ b/svl/qa/unit/items/test_IndexedStyleSheets.cxx @@ -23,7 +23,7 @@ using namespace svl; class MockedStyleSheet : public SfxStyleSheetBase { public: - MockedStyleSheet(const rtl::OUString& name, SfxStyleFamily fam = SFX_STYLE_FAMILY_CHAR) + MockedStyleSheet(const rtl::OUString& name, SfxStyleFamily fam = SfxStyleFamily::Char) : SfxStyleSheetBase(name, nullptr, fam, 0) {;} @@ -172,28 +172,28 @@ void IndexedStyleSheetsTest::PositionCanBeQueriedByFamily() rtl::OUString name1("name1"); rtl::OUString name2("name2"); rtl::OUString name3("name3"); - rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name1, SFX_STYLE_FAMILY_CHAR)); - rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name2, SFX_STYLE_FAMILY_PARA)); - rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet(name3, SFX_STYLE_FAMILY_CHAR)); + rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name1, SfxStyleFamily::Char)); + rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name2, SfxStyleFamily::Para)); + rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet(name3, SfxStyleFamily::Char)); IndexedStyleSheets iss; iss.AddStyleSheet(sheet1); iss.AddStyleSheet(sheet2); iss.AddStyleSheet(sheet3); - const std::vector<unsigned>& v = iss.GetStyleSheetPositionsByFamily(SFX_STYLE_FAMILY_CHAR); + const std::vector<unsigned>& v = iss.GetStyleSheetPositionsByFamily(SfxStyleFamily::Char); CPPUNIT_ASSERT_EQUAL_MESSAGE("Separation by family works.", static_cast<size_t>(2), v.size()); - const std::vector<unsigned>& w = iss.GetStyleSheetPositionsByFamily(SFX_STYLE_FAMILY_ALL); + const std::vector<unsigned>& w = iss.GetStyleSheetPositionsByFamily(SfxStyleFamily::All); CPPUNIT_ASSERT_EQUAL_MESSAGE("Wildcard works for family queries.", static_cast<size_t>(3), w.size()); } void IndexedStyleSheetsTest::OnlyOneStyleSheetIsReturnedWhenReturnFirstIsUsed() { rtl::OUString name("name1"); - rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name, SFX_STYLE_FAMILY_CHAR)); - rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name, SFX_STYLE_FAMILY_PARA)); - rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet(name, SFX_STYLE_FAMILY_CHAR)); + rtl::Reference<SfxStyleSheetBase> sheet1(new MockedStyleSheet(name, SfxStyleFamily::Char)); + rtl::Reference<SfxStyleSheetBase> sheet2(new MockedStyleSheet(name, SfxStyleFamily::Para)); + rtl::Reference<SfxStyleSheetBase> sheet3(new MockedStyleSheet(name, SfxStyleFamily::Char)); IndexedStyleSheets iss; iss.AddStyleSheet(sheet1); diff --git a/svl/source/items/IndexedStyleSheets.cxx b/svl/source/items/IndexedStyleSheets.cxx index 750a7fd18771..1b1b54eb4bd9 100644 --- a/svl/source/items/IndexedStyleSheets.cxx +++ b/svl/source/items/IndexedStyleSheets.cxx @@ -23,18 +23,19 @@ const size_t NUMBER_OF_FAMILIES = 6; size_t family_to_index(SfxStyleFamily family) { switch (family) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: return 0; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: return 1; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: return 2; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: return 3; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: return 4; - case SFX_STYLE_FAMILY_ALL: + case SfxStyleFamily::All: return 5; + default: break; } assert(false); // only for compiler warning. all cases are handled in the switch return 0; @@ -57,7 +58,7 @@ IndexedStyleSheets::Register(const SfxStyleSheetBase& style, unsigned pos) mPositionsByName.insert(std::make_pair(style.GetName(), pos)); size_t position = family_to_index(style.GetFamily()); mStyleSheetPositionsByFamily.at(position).push_back(pos); - size_t positionForFamilyAll = family_to_index(SFX_STYLE_FAMILY_ALL); + size_t positionForFamilyAll = family_to_index(SfxStyleFamily::All); mStyleSheetPositionsByFamily.at(positionForFamilyAll).push_back(pos); } diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index 881c464ee1f4..f26597fc61d7 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.cxx @@ -113,7 +113,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : 2, 2, 2, TransliterationModules_IGNORE_CASE, SearchAlgorithms2::ABSOLUTE, '\\' ), - m_eFamily ( SFX_STYLE_FAMILY_PARA ), + m_eFamily ( SfxStyleFamily::Para ), m_nCommand ( SvxSearchCmd::FIND ), m_nCellType ( SvxSearchCellType::FORMULA ), m_nAppFlag ( SvxSearchApp::WRITER ), diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 4221020c5077..f14dd8a1137e 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -372,7 +372,7 @@ SfxStyleFamily SfxStyleSheetIterator::GetSearchFamily() const inline bool SfxStyleSheetIterator::IsTrivialSearch() { return (( nMask & SFXSTYLEBIT_ALL_VISIBLE ) == SFXSTYLEBIT_ALL_VISIBLE) && - (GetSearchFamily() == SFX_STYLE_FAMILY_ALL); + (GetSearchFamily() == SfxStyleFamily::All); } namespace { @@ -385,7 +385,7 @@ struct DoesStyleMatchStyleSheetPredicate final : public svl::StyleSheetPredicate bool Check(const SfxStyleSheetBase& styleSheet) override { - bool bMatchFamily = ((mIterator->GetSearchFamily() == SFX_STYLE_FAMILY_ALL) || + bool bMatchFamily = ((mIterator->GetSearchFamily() == SfxStyleFamily::All) || ( styleSheet.GetFamily() == mIterator->GetSearchFamily() )); bool bUsed = mIterator->SearchUsed() && styleSheet.IsUsed( ); @@ -577,7 +577,7 @@ SfxStyleSheetBasePool::SfxStyleSheetBasePool( SfxItemPool& r ) : pImp(new SfxStyleSheetBasePool_Impl), aAppName(r.GetName()), rPool(r), - nSearchFamily(SFX_STYLE_FAMILY_PARA), + nSearchFamily(SfxStyleFamily::Para), nMask(SFXSTYLEBIT_ALL) { #ifdef DBG_UTIL @@ -656,7 +656,7 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create( const SfxStyleSheetBase& r ) SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const OUString& rName, SfxStyleFamily eFam, sal_uInt16 mask) { - OSL_ENSURE( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" ); + OSL_ENSURE( eFam != SfxStyleFamily::All, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" ); SfxStyleSheetIterator aIter(this, eFam, mask); rtl::Reference< SfxStyleSheetBase > xStyle( aIter.Find( rName ) ); diff --git a/svx/qa/unit/svdraw/test_SdrTextObject.cxx b/svx/qa/unit/svdraw/test_SdrTextObject.cxx index 3b8264deba6e..1062fc0fec57 100644 --- a/svx/qa/unit/svdraw/test_SdrTextObject.cxx +++ b/svx/qa/unit/svdraw/test_SdrTextObject.cxx @@ -26,16 +26,16 @@ public: void SdrTextObjTest::AllFamiliesCanBeRestoredFromSavedString() { std::vector<SfxStyleFamily> allFamilies; - allFamilies.push_back(SFX_STYLE_FAMILY_CHAR); - allFamilies.push_back(SFX_STYLE_FAMILY_PARA); - allFamilies.push_back(SFX_STYLE_FAMILY_PAGE); - allFamilies.push_back(SFX_STYLE_FAMILY_PSEUDO); + allFamilies.push_back(SfxStyleFamily::Char); + allFamilies.push_back(SfxStyleFamily::Para); + allFamilies.push_back(SfxStyleFamily::Page); + allFamilies.push_back(SfxStyleFamily::Pseudo); for (SfxStyleFamily family : allFamilies) { OUString styleName = "styleName"; SdrTextObj::AppendFamilyToStyleName(styleName, family); SfxStyleFamily readFamily = SdrTextObj::ReadFamilyFromStyleName(styleName); - CPPUNIT_ASSERT_EQUAL(family, readFamily); + CPPUNIT_ASSERT_EQUAL((int)family, (int)readFamily); } } diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index babd7ae740d1..1c390e9dcd81 100755 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -1508,19 +1508,19 @@ IMPL_LINK_NOARG_TYPED(SvxSearchDialog, TemplateHdl_Impl, Button*, void) // Enable templates controller switch ( pSearchItem->GetFamily() ) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: nId = SID_STYLE_FAMILY1; break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: nId = SID_STYLE_FAMILY2; break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: nId = SID_STYLE_FAMILY3; break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: nId = SID_STYLE_FAMILY4; break; - case SFX_STYLE_FAMILY_ALL: + case SfxStyleFamily::All: break; default: diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx index 701895228ab0..8e526634193d 100644 --- a/svx/source/sdr/properties/attributeproperties.cxx +++ b/svx/source/sdr/properties/attributeproperties.cxx @@ -288,7 +288,7 @@ namespace sdr SfxStyleSheet* pNewStyleSheet = dynamic_cast<SfxStyleSheet*>( pNewModel->GetStyleSheetPool()->Find( pStySheet->GetName(), - SFX_STYLE_FAMILY_ALL)); + SfxStyleFamily::All)); if (pNewStyleSheet == nullptr || &pNewStyleSheet->GetPool().GetPool() != pDestPool) { diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx index 49f884abf470..577744f62ec0 100644 --- a/svx/source/styles/CommonStylePreviewRenderer.cxx +++ b/svx/source/styles/CommonStylePreviewRenderer.cxx @@ -115,7 +115,7 @@ bool CommonStylePreviewRenderer::recalculate() maFontColor = Color(static_cast<const SvxColorItem*>(pItem)->GetValue()); } - if (mpStyle->GetFamily() == SFX_STYLE_FAMILY_PARA) + if (mpStyle->GetFamily() == SfxStyleFamily::Para) { if ((pItem = pItemSet->GetItem(XATTR_FILLSTYLE)) != nullptr) { diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 4ffef623369d..923c19690d24 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2227,7 +2227,7 @@ void SdrObject::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHar void SdrObject::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) { // only allow graphic and presentation styles for shapes - if( pNewStyleSheet && (pNewStyleSheet->GetFamily() == SFX_STYLE_FAMILY_PARA) && (pNewStyleSheet->GetFamily() == SFX_STYLE_FAMILY_PAGE) ) + if( pNewStyleSheet && (pNewStyleSheet->GetFamily() == SfxStyleFamily::Para) && (pNewStyleSheet->GetFamily() == SfxStyleFamily::Page) ) return; GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr); diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index b4ff60a407f1..5e517514d111 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -613,7 +613,7 @@ OutlinerParaObject* Cell::GetEditOutlinerParaObject() const void Cell::SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr ) { // only allow cell styles for cells - if( pStyleSheet && pStyleSheet->GetFamily() != SFX_STYLE_FAMILY_FRAME ) + if( pStyleSheet && pStyleSheet->GetFamily() != SfxStyleFamily::Frame ) return; if( mpProperties && (mpProperties->GetStyleSheet() != pStyleSheet) ) diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index aba6dedfc148..927bacc98c75 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -1417,7 +1417,7 @@ bool SvxTableController::GetStyleSheet( SfxStyleSheet*& rpStyleSheet ) const bool SvxTableController::SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr ) { - if( hasSelectedCells() && (!pStyleSheet || pStyleSheet->GetFamily() == SFX_STYLE_FAMILY_FRAME) ) + if( hasSelectedCells() && (!pStyleSheet || pStyleSheet->GetFamily() == SfxStyleFamily::Frame) ) { if( mxTable.is() ) { diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index d672e3d3eef4..bcc310560b7f 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2273,16 +2273,16 @@ SfxStyleFamily SvxStyleToolBoxControl::GetActFamily() { switch ( nActFamily-1 + SID_STYLE_FAMILY_START ) { - case SID_STYLE_FAMILY1: return SFX_STYLE_FAMILY_CHAR; - case SID_STYLE_FAMILY2: return SFX_STYLE_FAMILY_PARA; - case SID_STYLE_FAMILY3: return SFX_STYLE_FAMILY_FRAME; - case SID_STYLE_FAMILY4: return SFX_STYLE_FAMILY_PAGE; - case SID_STYLE_FAMILY5: return SFX_STYLE_FAMILY_PSEUDO; + case SID_STYLE_FAMILY1: return SfxStyleFamily::Char; + case SID_STYLE_FAMILY2: return SfxStyleFamily::Para; + case SID_STYLE_FAMILY3: return SfxStyleFamily::Frame; + case SID_STYLE_FAMILY4: return SfxStyleFamily::Page; + case SID_STYLE_FAMILY5: return SfxStyleFamily::Pseudo; default: OSL_FAIL( "unknown style family" ); break; } - return SFX_STYLE_FAMILY_PARA; + return SfxStyleFamily::Para; } void SvxStyleToolBoxControl::FillStyleBox() @@ -2543,7 +2543,7 @@ VclPtr<vcl::Window> SvxStyleToolBoxControl::CreateItemWindow( vcl::Window *pPare { VclPtrInstance<SvxStyleBox_Impl> pBox( pParent, OUString( ".uno:StyleApply" ), - SFX_STYLE_FAMILY_PARA, + SfxStyleFamily::Para, Reference< XDispatchProvider >( m_xFrame->getController(), UNO_QUERY ), m_xFrame, pImpl->aClearForm, diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 0b564e02004c..cce1600ae5b0 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -116,28 +116,28 @@ class SW_DLLPUBLIC SwDocShell /// Methods for StyleSheets /// @param nSlot - /// Only used for nFamily == SFX_STYLE_FAMILY_PAGE. Identifies optional Slot by which the edit is triggered. + /// Only used for nFamily == SfxStyleFamily::Page. Identifies optional Slot by which the edit is triggered. /// Used to activate certain dialog pane SAL_DLLPRIVATE sal_uInt16 Edit( const OUString &rName, const OUString& rParent, - const sal_uInt16 nFamily, + const SfxStyleFamily nFamily, sal_uInt16 nMask, const bool bNew, const OString& sPageId = OString(), SwWrtShell* pActShell = nullptr, const bool bBasic = false ); - SAL_DLLPRIVATE bool Delete(const OUString &rName, sal_uInt16 nFamily); - SAL_DLLPRIVATE bool Hide(const OUString &rName, sal_uInt16 nFamily, bool bHidden); - SAL_DLLPRIVATE sal_uInt16 ApplyStyles(const OUString &rName, - const sal_uInt16 nFamily, + SAL_DLLPRIVATE bool Delete(const OUString &rName, SfxStyleFamily nFamily); + SAL_DLLPRIVATE bool Hide(const OUString &rName, SfxStyleFamily nFamily, bool bHidden); + SAL_DLLPRIVATE SfxStyleFamily ApplyStyles(const OUString &rName, + const SfxStyleFamily nFamily, SwWrtShell* pShell = nullptr, sal_uInt16 nMode = 0); - SAL_DLLPRIVATE sal_uInt16 DoWaterCan( const OUString &rName, sal_uInt16 nFamily); - SAL_DLLPRIVATE sal_uInt16 UpdateStyle(const OUString &rName, sal_uInt16 nFamily, SwWrtShell* pShell = nullptr); - SAL_DLLPRIVATE sal_uInt16 MakeByExample(const OUString &rName, - sal_uInt16 nFamily, sal_uInt16 nMask, SwWrtShell* pShell = nullptr); + SAL_DLLPRIVATE SfxStyleFamily DoWaterCan( const OUString &rName, SfxStyleFamily nFamily); + SAL_DLLPRIVATE SfxStyleFamily UpdateStyle(const OUString &rName, SfxStyleFamily nFamily, SwWrtShell* pShell = nullptr); + SAL_DLLPRIVATE SfxStyleFamily MakeByExample(const OUString &rName, + SfxStyleFamily nFamily, sal_uInt16 nMask, SwWrtShell* pShell = nullptr); SAL_DLLPRIVATE void SubInitNew(); ///< for InitNew and HtmlSourceMode. diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 5de822c98b10..a46e2acec5b0 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -36,6 +36,7 @@ #include "itabenum.hxx" #include <boost/optional.hpp> #include "dbmgr.hxx" +#include <cnttab.hxx> class SfxViewFrame; class SfxBindings; @@ -74,7 +75,7 @@ class SwTOXMark; struct SwDocStat; enum class SwBorderModes; enum class SwCharDlgMode; -#include <cnttab.hxx> +enum class SfxStyleFamily; namespace com{namespace sun{namespace star{ namespace frame{ @@ -394,10 +395,10 @@ public: const OUString* pFormatStr = nullptr) = 0; /// @param nSlot /// Identifies optional Slot by which the creation of the Template (Style) dialog is triggered. - /// Currently used, if nRegion == SFX_STYLE_FAMILY_PAGE in order to activate certain dialog pane + /// Currently used, if nRegion == SfxStyleFamily::Page in order to activate certain dialog pane virtual SfxAbstractApplyTabDialog* CreateTemplateDialog( SfxStyleSheetBase& rBase, - sal_uInt16 nRegion, + SfxStyleFamily nRegion, const OString& sPage = OString(), SwWrtShell* pActShell = nullptr, bool bNew = false) = 0; diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index 5fcf51b90f29..b569b561b6a2 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -131,13 +131,13 @@ struct SwApplyTemplate SwNumRule* pNumRule; } aColl; - int eType; + SfxStyleFamily eType; sal_uInt16 nColor; SwFormatClipboard* m_pFormatClipboard; size_t nUndo; //< The initial undo stack depth. SwApplyTemplate() : - eType(0), + eType(SfxStyleFamily::None), nColor(0), m_pFormatClipboard(nullptr), nUndo(0) diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 43cb12145782..44c7b2670072 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -621,7 +621,7 @@ void SwDoc::DelPageDesc( size_t i, bool bBroadcast ) SwPageDesc &rDel = *m_PageDescs[i]; if (bBroadcast) - BroadcastStyleOperation(rDel.GetName(), SFX_STYLE_FAMILY_PAGE, + BroadcastStyleOperation(rDel.GetName(), SfxStyleFamily::Page, SfxStyleSheetHintId::ERASED); if (GetIDocumentUndoRedo().DoesUndo()) @@ -669,7 +669,7 @@ SwPageDesc* SwDoc::MakePageDesc(const OUString &rName, const SwPageDesc *pCpy, m_PageDescs.push_back(std::unique_ptr<SwPageDesc>(pNew)); if (bBroadcast) - BroadcastStyleOperation(rName, SFX_STYLE_FAMILY_PAGE, + BroadcastStyleOperation(rName, SfxStyleFamily::Page, SfxStyleSheetHintId::CREATED); if (GetIDocumentUndoRedo().DoesUndo()) diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 88518874a544..eb2f5d5638c2 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -677,7 +677,7 @@ void SwDoc::DelCharFormat(size_t nFormat, bool bBroadcast) SwCharFormat * pDel = (*mpCharFormatTable)[nFormat]; if (bBroadcast) - BroadcastStyleOperation(pDel->GetName(), SFX_STYLE_FAMILY_CHAR, + BroadcastStyleOperation(pDel->GetName(), SfxStyleFamily::Char, SfxStyleSheetHintId::ERASED); if (GetIDocumentUndoRedo().DoesUndo()) @@ -718,7 +718,7 @@ void SwDoc::DelFrameFormat( SwFrameFormat *pFormat, bool bBroadcast ) { if (bBroadcast) BroadcastStyleOperation(pFormat->GetName(), - SFX_STYLE_FAMILY_FRAME, + SfxStyleFamily::Frame, SfxStyleSheetHintId::ERASED); if (GetIDocumentUndoRedo().DoesUndo()) @@ -832,7 +832,7 @@ SwFrameFormat *SwDoc::MakeFrameFormat(const OUString &rFormatName, if (bBroadcast) { - BroadcastStyleOperation(rFormatName, SFX_STYLE_FAMILY_FRAME, + BroadcastStyleOperation(rFormatName, SfxStyleFamily::Frame, SfxStyleSheetHintId::CREATED); } @@ -868,7 +868,7 @@ SwCharFormat *SwDoc::MakeCharFormat( const OUString &rFormatName, if (bBroadcast) { - BroadcastStyleOperation(rFormatName, SFX_STYLE_FAMILY_CHAR, + BroadcastStyleOperation(rFormatName, SfxStyleFamily::Char, SfxStyleSheetHintId::CREATED); } @@ -904,7 +904,7 @@ SwTextFormatColl* SwDoc::MakeTextFormatColl( const OUString &rFormatName, } if (bBroadcast) - BroadcastStyleOperation(rFormatName, SFX_STYLE_FAMILY_PARA, + BroadcastStyleOperation(rFormatName, SfxStyleFamily::Para, SfxStyleSheetHintId::CREATED); return pFormatColl; @@ -938,7 +938,7 @@ SwConditionTextFormatColl* SwDoc::MakeCondTextFormatColl( const OUString &rForma } if (bBroadcast) - BroadcastStyleOperation(rFormatName, SFX_STYLE_FAMILY_PARA, + BroadcastStyleOperation(rFormatName, SfxStyleFamily::Para, SfxStyleSheetHintId::CREATED); return pFormatColl; @@ -967,7 +967,7 @@ void SwDoc::DelTextFormatColl(size_t nFormatColl, bool bBroadcast) return; // never delete default! if (bBroadcast) - BroadcastStyleOperation(pDel->GetName(), SFX_STYLE_FAMILY_PARA, + BroadcastStyleOperation(pDel->GetName(), SfxStyleFamily::Para, SfxStyleSheetHintId::ERASED); if (GetIDocumentUndoRedo().DoesUndo()) @@ -1879,7 +1879,7 @@ void SwDoc::ChgFormat(SwFormat & rFormat, const SfxItemSet & rSet) void SwDoc::RenameFormat(SwFormat & rFormat, const OUString & sNewName, bool bBroadcast) { - SfxStyleFamily eFamily = SFX_STYLE_FAMILY_ALL; + SfxStyleFamily eFamily = SfxStyleFamily::All; if (GetIDocumentUndoRedo().DoesUndo()) { @@ -1889,15 +1889,15 @@ void SwDoc::RenameFormat(SwFormat & rFormat, const OUString & sNewName, { case RES_CHRFMT: pUndo = new SwUndoRenameCharFormat(rFormat.GetName(), sNewName, this); - eFamily = SFX_STYLE_FAMILY_CHAR; + eFamily = SfxStyleFamily::Char; break; case RES_TXTFMTCOLL: pUndo = new SwUndoRenameFormatColl(rFormat.GetName(), sNewName, this); - eFamily = SFX_STYLE_FAMILY_PARA; + eFamily = SfxStyleFamily::Para; break; case RES_FRMFMT: pUndo = new SwUndoRenameFrameFormat(rFormat.GetName(), sNewName, this); - eFamily = SFX_STYLE_FAMILY_FRAME; + eFamily = SfxStyleFamily::Frame; break; default: diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 32bfae2b4832..bf8703fa89e7 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1023,7 +1023,7 @@ bool SwDoc::DelNumRule( const OUString& rName, bool bBroadcast ) } if (bBroadcast) - BroadcastStyleOperation(rName, SFX_STYLE_FAMILY_PSEUDO, + BroadcastStyleOperation(rName, SfxStyleFamily::Pseudo, SfxStyleSheetHintId::ERASED); getIDocumentListsAccess().deleteListForListStyle( rName ); @@ -1096,7 +1096,7 @@ bool SwDoc::RenameNumRule(const OUString & rOldName, const OUString & rNewName, bResult = true; if (bBroadcast) - BroadcastStyleOperation(rOldName, SFX_STYLE_FAMILY_PSEUDO, + BroadcastStyleOperation(rOldName, SfxStyleFamily::Pseudo, SfxStyleSheetHintId::MODIFIED); } @@ -2182,7 +2182,7 @@ sal_uInt16 SwDoc::MakeNumRule( const OUString &rName, } if (bBroadcast) - BroadcastStyleOperation(pNew->GetName(), SFX_STYLE_FAMILY_PSEUDO, + BroadcastStyleOperation(pNew->GetName(), SfxStyleFamily::Pseudo, SfxStyleSheetHintId::CREATED); return nRet; diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 57d3dafbae5a..5b8ca54a2ca0 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -81,7 +81,7 @@ long EvalGridWidthAdd( const SwTextGridItem *const pGrid, const SwDrawTextInfo & OUString sString(SW_RESSTR(STR_POOLCOLL_STANDARD)); - SfxStyleSheetBase* pStyle = pBasePool->Find(sString, (SfxStyleFamily)SFX_STYLE_FAMILY_PARA); + SfxStyleSheetBase* pStyle = pBasePool->Find(sString, (SfxStyleFamily)SfxStyleFamily::Para); SfxItemSet& aTmpSet = pStyle->GetItemSet(); const SvxFontHeightItem &aDefaultFontItem = static_cast<const SvxFontHeightItem&>(aTmpSet.Get(RES_CHRATR_CJK_FONTSIZE)); diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx index bf93a11e6e5c..7897e2ff7622 100644 --- a/sw/source/core/unocore/SwXTextDefaults.cxx +++ b/sw/source/core/unocore/SwXTextDefaults.cxx @@ -88,7 +88,7 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName, OUString sStyle; SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true ); SwDocStyleSheet* pStyle = - static_cast<SwDocStyleSheet*>(m_pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR)); + static_cast<SwDocStyleSheet*>(m_pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Char)); SwFormatDrop* pDrop = nullptr; SwFormatCharFormat *pCharFormat = nullptr; if(pStyle) diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 9b2f278e6d67..b66916db1416 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -671,24 +671,24 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc) case SW_SERVICE_STYLE_PAGE_STYLE: case SW_SERVICE_STYLE_NUMBERING_STYLE: { - SfxStyleFamily eFamily = SFX_STYLE_FAMILY_CHAR; + SfxStyleFamily eFamily = SfxStyleFamily::Char; switch(nObjectType) { case SW_SERVICE_STYLE_PARAGRAPH_STYLE: - eFamily = SFX_STYLE_FAMILY_PARA; + eFamily = SfxStyleFamily::Para; break; case SW_SERVICE_STYLE_CONDITIONAL_PARAGRAPH_STYLE: - eFamily = SFX_STYLE_FAMILY_PARA; + eFamily = SfxStyleFamily::Para; xRet = SwXStyleFamilies::CreateStyleCondParagraph(rDoc); break; case SW_SERVICE_STYLE_FRAME_STYLE: - eFamily = SFX_STYLE_FAMILY_FRAME; + eFamily = SfxStyleFamily::Frame; break; case SW_SERVICE_STYLE_PAGE_STYLE: - eFamily = SFX_STYLE_FAMILY_PAGE; + eFamily = SfxStyleFamily::Page; break; case SW_SERVICE_STYLE_NUMBERING_STYLE: - eFamily = SFX_STYLE_FAMILY_PSEUDO; + eFamily = SfxStyleFamily::Pseudo; break; } if(!xRet.is()) diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index c6fe4d9d64bd..22b41fed67fc 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -801,10 +801,10 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam) { SfxStyleSheetBasePool* pPool = pDoc->GetDocShell()->GetStyleSheetPool(); SfxStyleSheetBase* pBase; - pBase = pPool->Find(pNewCharStyles[i], SFX_STYLE_FAMILY_CHAR); + pBase = pPool->Find(pNewCharStyles[i], SfxStyleFamily::Char); // shall it really be created? if(!pBase) - pBase = &pPool->Make(pNewCharStyles[i], SFX_STYLE_FAMILY_PAGE); + pBase = &pPool->Make(pNewCharStyles[i], SfxStyleFamily::Page); pCharFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat(); } if(pCharFormat) diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index b0dd93277ee8..2bb4a87ce860 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -988,7 +988,7 @@ bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SfxItem *pStyleName >>= sStyle; SwStyleNameMapper::FillUIName(sStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, true); pStyle = static_cast<SwDocStyleSheet*>(pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, - SFX_STYLE_FAMILY_FRAME)); + SfxStyleFamily::Frame)); } const ::uno::Any* pColumns = nullptr; @@ -1062,7 +1062,7 @@ bool SwGraphicProperties_Impl::AnyToItemSet( *pStyleName >>= sStyle; SwStyleNameMapper::FillUIName(sStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, true); pStyle = static_cast<SwDocStyleSheet*>(pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, - SFX_STYLE_FAMILY_FRAME)); + SfxStyleFamily::Frame)); } const ::uno::Any* pHEvenMirror = nullptr; @@ -1396,7 +1396,7 @@ static SwFrameFormat *lcl_GetFrameFormat( const ::uno::Any& rValue, SwDoc *pDoc nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, true); SwDocStyleSheet* pStyle = static_cast<SwDocStyleSheet*>(pDocSh->GetStyleSheetPool()->Find(sStyle, - SFX_STYLE_FAMILY_FRAME)); + SfxStyleFamily::Frame)); if(pStyle) pRet = pStyle->GetFrameFormat(); } diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 3436361c3564..600c393bb698 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -221,7 +221,7 @@ lcl_setCharStyle(SwDoc *const pDoc, const uno::Any & rValue, SfxItemSet & rSet) SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true); SwDocStyleSheet *const pStyle = static_cast<SwDocStyleSheet*>( - pDocSh->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR)); + pDocSh->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Char)); if (!pStyle) { throw lang::IllegalArgumentException(); @@ -272,7 +272,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true ); SwDocStyleSheet *const pStyle = static_cast<SwDocStyleSheet*>( - pDocSh->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_PARA)); + pDocSh->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Para)); if (!pStyle) { throw lang::IllegalArgumentException(); @@ -412,7 +412,7 @@ lcl_setDropcapCharStyle(SwPaM & rPam, SfxItemSet & rItemSet, //default character style must not be set as default format SwDocStyleSheet *const pStyle = static_cast<SwDocStyleSheet*>( pDoc->GetDocShell() - ->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR)); + ->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Char)); if (!pStyle || (static_cast<SwDocStyleSheet*>(pStyle)->GetCharFormat() == pDoc->GetDfltCharFormat())) diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 32ea26f32160..92b493197351 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1220,9 +1220,9 @@ void SwXNumberingRules::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElemen { SfxStyleSheetBase* pBase; pBase = pDocShell->GetStyleSheetPool()->Find(m_sNewCharStyleNames[i], - SFX_STYLE_FAMILY_CHAR); + SfxStyleFamily::Char); if(!pBase) - pBase = &pDocShell->GetStyleSheetPool()->Make(m_sNewCharStyleNames[i], SFX_STYLE_FAMILY_CHAR); + pBase = &pDocShell->GetStyleSheetPool()->Make(m_sNewCharStyleNames[i], SfxStyleFamily::Char); pCharFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat(); } @@ -1744,9 +1744,9 @@ void SwXNumberingRules::SetPropertiesToNumFormat( SfxStyleSheetBase* pBase; SfxStyleSheetBasePool* pPool = pLocalDoc->GetDocShell()->GetStyleSheetPool(); - pBase = static_cast<SfxStyleSheetBasePool*>(pPool)->Find(sCharFormatName, SFX_STYLE_FAMILY_CHAR); + pBase = static_cast<SfxStyleSheetBasePool*>(pPool)->Find(sCharFormatName, SfxStyleFamily::Char); if(!pBase) - pBase = &pPool->Make(sCharFormatName, SFX_STYLE_FAMILY_CHAR); + pBase = &pPool->Make(sCharFormatName, SfxStyleFamily::Char); pCharFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat(); } } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index edee1e0c5519..e4b67d816697 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -299,7 +299,7 @@ protected: virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override; public: - SwXStyle(SwDoc* pDoc, SfxStyleFamily eFam = SFX_STYLE_FAMILY_PARA, bool bConditional = false); + SwXStyle(SwDoc* pDoc, SfxStyleFamily eFam = SfxStyleFamily::Para, bool bConditional = false); SwXStyle(SfxStyleSheetBasePool* pPool, SfxStyleFamily eFamily, SwDoc* pDoc, const OUString& rStyleName); virtual ~SwXStyle(); @@ -391,7 +391,7 @@ public: SwXFrameStyle(SfxStyleSheetBasePool& rPool, SwDoc* pDoc, const OUString& rStyleName) : - SwXStyle(&rPool, SFX_STYLE_FAMILY_FRAME, pDoc, rStyleName){} + SwXStyle(&rPool, SfxStyleFamily::Frame, pDoc, rStyleName){} explicit SwXFrameStyle(SwDoc *pDoc); virtual ~SwXFrameStyle(); @@ -500,7 +500,7 @@ uno::Any SwXStyleFamilies::getByIndex(sal_Int32 nIndex) if(!IsValid()) throw uno::RuntimeException(); auto eFamily = (*pEntries)[nIndex].m_eFamily; - assert(eFamily != SFX_STYLE_FAMILY_ALL); + assert(eFamily != SfxStyleFamily::All); auto& rxFamily = m_vFamilies[eFamily]; if(!rxFamily.is()) rxFamily = new XStyleFamily(m_pDocShell, eFamily); @@ -587,7 +587,7 @@ template<enum SfxStyleFamily> static sal_Int32 lcl_GetCountOrName(const SwDoc&, OUString*, sal_Int32); template<> -sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_CHAR>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex) +sal_Int32 lcl_GetCountOrName<SfxStyleFamily::Char>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex) { const sal_uInt16 nBaseCount = nPoolChrHtmlRange + nPoolChrNormalRange; nIndex -= nBaseCount; @@ -613,7 +613,7 @@ sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_CHAR>(const SwDoc& rDoc, OUString* } template<> -sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_PARA>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex) +sal_Int32 lcl_GetCountOrName<SfxStyleFamily::Para>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex) { const sal_uInt16 nBaseCount = nPoolCollHtmlStackedStart + nPoolCollHtmlRange; nIndex -= nBaseCount; @@ -635,7 +635,7 @@ sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_PARA>(const SwDoc& rDoc, OUString* } template<> -sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_FRAME>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex) +sal_Int32 lcl_GetCountOrName<SfxStyleFamily::Frame>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex) { nIndex -= nPoolFrameRange; sal_Int32 nCount = 0; @@ -656,7 +656,7 @@ sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_FRAME>(const SwDoc& rDoc, OUString } template<> -sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_PAGE>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex) +sal_Int32 lcl_GetCountOrName<SfxStyleFamily::Page>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex) { nIndex -= nPoolPageRange; sal_Int32 nCount = 0; @@ -678,7 +678,7 @@ sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_PAGE>(const SwDoc& rDoc, OUString* } template<> -sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_PSEUDO>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex) +sal_Int32 lcl_GetCountOrName<SfxStyleFamily::Pseudo>(const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex) { nIndex -= nPoolNumRange; sal_Int32 nCount = 0; @@ -698,20 +698,20 @@ sal_Int32 lcl_GetCountOrName<SFX_STYLE_FAMILY_PSEUDO>(const SwDoc& rDoc, OUStrin return nCount + nPoolNumRange; } -template<enum SfxStyleFamily eFamily> +template<SfxStyleFamily eFamily> static uno::Reference< css::style::XStyle> lcl_CreateStyle(SfxStyleSheetBasePool* pBasePool, SwDocShell* pDocShell, const OUString& sStyleName) { return pBasePool ? new SwXStyle(pBasePool, eFamily, pDocShell->GetDoc(), sStyleName) : new SwXStyle(pDocShell->GetDoc(), eFamily, false); }; template<> -uno::Reference< css::style::XStyle> lcl_CreateStyle<SFX_STYLE_FAMILY_PARA>(SfxStyleSheetBasePool* pBasePool, SwDocShell* pDocShell, const OUString& sStyleName) - { return pBasePool ? new SwXStyle(pBasePool, SFX_STYLE_FAMILY_PARA, pDocShell->GetDoc(), sStyleName) : new SwXStyle(pDocShell->GetDoc(), SFX_STYLE_FAMILY_PARA, false); }; +uno::Reference< css::style::XStyle> lcl_CreateStyle<SfxStyleFamily::Para>(SfxStyleSheetBasePool* pBasePool, SwDocShell* pDocShell, const OUString& sStyleName) + { return pBasePool ? new SwXStyle(pBasePool, SfxStyleFamily::Para, pDocShell->GetDoc(), sStyleName) : new SwXStyle(pDocShell->GetDoc(), SfxStyleFamily::Para, false); }; template<> -uno::Reference< css::style::XStyle> lcl_CreateStyle<SFX_STYLE_FAMILY_FRAME>(SfxStyleSheetBasePool* pBasePool, SwDocShell* pDocShell, const OUString& sStyleName) +uno::Reference< css::style::XStyle> lcl_CreateStyle<SfxStyleFamily::Frame>(SfxStyleSheetBasePool* pBasePool, SwDocShell* pDocShell, const OUString& sStyleName) { return pBasePool ? new SwXFrameStyle(*pBasePool, pDocShell->GetDoc(), sStyleName) : new SwXFrameStyle(pDocShell->GetDoc()); }; template<> -uno::Reference< css::style::XStyle> lcl_CreateStyle<SFX_STYLE_FAMILY_PAGE>(SfxStyleSheetBasePool* pBasePool, SwDocShell* pDocShell, const OUString& sStyleName) - { return pBasePool ? new SwXPageStyle(*pBasePool, pDocShell, SFX_STYLE_FAMILY_PAGE, sStyleName) : new SwXPageStyle(pDocShell); }; +uno::Reference< css::style::XStyle> lcl_CreateStyle<SfxStyleFamily::Page>(SfxStyleSheetBasePool* pBasePool, SwDocShell* pDocShell, const OUString& sStyleName) + { return pBasePool ? new SwXPageStyle(*pBasePool, pDocShell, SfxStyleFamily::Page, sStyleName) : new SwXPageStyle(pDocShell); }; uno::Reference<css::style::XStyle> SwXStyleFamilies::CreateStyle(SfxStyleFamily eFamily, SwDoc& rDoc) { @@ -723,13 +723,13 @@ uno::Reference<css::style::XStyle> SwXStyleFamilies::CreateStyle(SfxStyleFamily // FIXME: Ugly special casing that should die. uno::Reference<css::style::XStyle> SwXStyleFamilies::CreateStyleCondParagraph(SwDoc& rDoc) - { return new SwXStyle(&rDoc, SFX_STYLE_FAMILY_PARA, true); }; + { return new SwXStyle(&rDoc, SfxStyleFamily::Para, true); }; template<enum SfxStyleFamily> static sal_uInt16 lcl_TranslateIndex(const sal_uInt16 nIndex); template<> -sal_uInt16 lcl_TranslateIndex<SFX_STYLE_FAMILY_CHAR>(const sal_uInt16 nIndex) +sal_uInt16 lcl_TranslateIndex<SfxStyleFamily::Char>(const sal_uInt16 nIndex) { static_assert(nPoolChrNormalRange > 0 && nPoolChrHtmlRange > 0, "invalid pool range"); if(nIndex < nPoolChrNormalRange) @@ -740,7 +740,7 @@ sal_uInt16 lcl_TranslateIndex<SFX_STYLE_FAMILY_CHAR>(const sal_uInt16 nIndex) } template<> -sal_uInt16 lcl_TranslateIndex<SFX_STYLE_FAMILY_PARA>(const sal_uInt16 nIndex) +sal_uInt16 lcl_TranslateIndex<SfxStyleFamily::Para>(const sal_uInt16 nIndex) { static_assert(nPoolCollTextRange > 0 && nPoolCollListsRange > 0 && nPoolCollExtraRange > 0 && nPoolCollRegisterRange > 0 && nPoolCollDocRange > 0 && nPoolCollHtmlRange > 0, "weird pool range"); if(nIndex < nPoolCollListsStackedStart) @@ -800,7 +800,7 @@ uno::Any XStyleFamily::getByName(const OUString& rName) throw container::NoSuchElementException(); uno::Reference<style::XStyle> xStyle = FindStyle(sStyleName); if(!xStyle.is()) - xStyle = m_rEntry.m_fCreateStyle(m_pBasePool, m_pDocShell, m_rEntry.m_eFamily == SFX_STYLE_FAMILY_FRAME ? pBase->GetName() : sStyleName); + xStyle = m_rEntry.m_fCreateStyle(m_pBasePool, m_pDocShell, m_rEntry.m_eFamily == SfxStyleFamily::Frame ? pBase->GetName() : sStyleName); return uno::makeAny(xStyle); } @@ -860,7 +860,7 @@ void XStyleFamily::insertByName(const OUString& rName, const uno::Any& rElement) throw lang::IllegalArgumentException(); sal_uInt16 nMask = SFXSTYLEBIT_ALL; - if(m_rEntry.m_eFamily == SFX_STYLE_FAMILY_PARA && !pNewStyle->IsConditional()) + if(m_rEntry.m_eFamily == SfxStyleFamily::Para && !pNewStyle->IsConditional()) nMask &= ~SWSTYLEBIT_CONDCOLL; m_pBasePool->Make(sStyleName, m_rEntry.m_eFamily, nMask); pNewStyle->SetDoc(m_pDocShell->GetDoc(), m_pBasePool); @@ -948,11 +948,11 @@ static const std::vector<StyleFamilyEntry>* lcl_GetStyleFamilyEntries() if(!our_pStyleFamilyEntries) { our_pStyleFamilyEntries = new std::vector<StyleFamilyEntry>{ - { SFX_STYLE_FAMILY_CHAR, PROPERTY_MAP_CHAR_STYLE, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, "CharacterStyles", STR_STYLE_FAMILY_CHARACTER, &lcl_GetCountOrName<SFX_STYLE_FAMILY_CHAR>, &lcl_CreateStyle<SFX_STYLE_FAMILY_CHAR>, &lcl_TranslateIndex<SFX_STYLE_FAMILY_CHAR> }, - { SFX_STYLE_FAMILY_PARA, PROPERTY_MAP_PARA_STYLE, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, "ParagraphStyles", STR_STYLE_FAMILY_PARAGRAPH, &lcl_GetCountOrName<SFX_STYLE_FAMILY_PARA>, &lcl_CreateStyle<SFX_STYLE_FAMILY_PARA>, &lcl_TranslateIndex<SFX_STYLE_FAMILY_PARA> }, - { SFX_STYLE_FAMILY_PAGE, PROPERTY_MAP_PAGE_STYLE, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, "PageStyles", STR_STYLE_FAMILY_PAGE, &lcl_GetCountOrName<SFX_STYLE_FAMILY_PAGE>, &lcl_CreateStyle<SFX_STYLE_FAMILY_PAGE>, &lcl_TranslateIndexRange<RES_POOLPAGE_BEGIN, nPoolPageRange> }, - { SFX_STYLE_FAMILY_FRAME, PROPERTY_MAP_FRAME_STYLE, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, "FrameStyles", STR_STYLE_FAMILY_FRAME, &lcl_GetCountOrName<SFX_STYLE_FAMILY_FRAME>, &lcl_CreateStyle<SFX_STYLE_FAMILY_FRAME>, &lcl_TranslateIndexRange<RES_POOLFRM_BEGIN, nPoolFrameRange> }, - { SFX_STYLE_FAMILY_PSEUDO, PROPERTY_MAP_NUM_STYLE, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE, "NumberingStyles", STR_STYLE_FAMILY_NUMBERING, &lcl_GetCountOrName<SFX_STYLE_FAMILY_PSEUDO>, &lcl_CreateStyle<SFX_STYLE_FAMILY_PSEUDO>, &lcl_TranslateIndexRange<RES_POOLNUMRULE_BEGIN, nPoolNumRange> } + { SfxStyleFamily::Char, PROPERTY_MAP_CHAR_STYLE, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, "CharacterStyles", STR_STYLE_FAMILY_CHARACTER, &lcl_GetCountOrName<SfxStyleFamily::Char>, &lcl_CreateStyle<SfxStyleFamily::Char>, &lcl_TranslateIndex<SfxStyleFamily::Char> }, + { SfxStyleFamily::Para, PROPERTY_MAP_PARA_STYLE, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, "ParagraphStyles", STR_STYLE_FAMILY_PARAGRAPH, &lcl_GetCountOrName<SfxStyleFamily::Para>, &lcl_CreateStyle<SfxStyleFamily::Para>, &lcl_TranslateIndex<SfxStyleFamily::Para> }, + { SfxStyleFamily::Page, PROPERTY_MAP_PAGE_STYLE, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, "PageStyles", STR_STYLE_FAMILY_PAGE, &lcl_GetCountOrName<SfxStyleFamily::Page>, &lcl_CreateStyle<SfxStyleFamily::Page>, &lcl_TranslateIndexRange<RES_POOLPAGE_BEGIN, nPoolPageRange> }, + { SfxStyleFamily::Frame, PROPERTY_MAP_FRAME_STYLE, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, "FrameStyles", STR_STYLE_FAMILY_FRAME, &lcl_GetCountOrName<SfxStyleFamily::Frame>, &lcl_CreateStyle<SfxStyleFamily::Frame>, &lcl_TranslateIndexRange<RES_POOLFRM_BEGIN, nPoolFrameRange> }, + { SfxStyleFamily::Pseudo, PROPERTY_MAP_NUM_STYLE, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE, "NumberingStyles", STR_STYLE_FAMILY_NUMBERING, &lcl_GetCountOrName<SfxStyleFamily::Pseudo>, &lcl_CreateStyle<SfxStyleFamily::Pseudo>, &lcl_TranslateIndexRange<RES_POOLNUMRULE_BEGIN, nPoolNumRange> } }; } return our_pStyleFamilyEntries; @@ -1077,32 +1077,32 @@ sal_Int64 SAL_CALL SwXStyle::getSomething(const uno::Sequence<sal_Int8>& rId) uno::Sequence< OUString > SwXStyle::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { long nCount = 1; - if(SFX_STYLE_FAMILY_PARA == m_rEntry.m_eFamily) + if(SfxStyleFamily::Para == m_rEntry.m_eFamily) { nCount = 5; if(m_bIsConditional) nCount++; } - else if(SFX_STYLE_FAMILY_CHAR == m_rEntry.m_eFamily) + else if(SfxStyleFamily::Char == m_rEntry.m_eFamily) nCount = 5; - else if(SFX_STYLE_FAMILY_PAGE == m_rEntry.m_eFamily) + else if(SfxStyleFamily::Page == m_rEntry.m_eFamily) nCount = 3; uno::Sequence< OUString > aRet(nCount); OUString* pArray = aRet.getArray(); pArray[0] = "com.sun.star.style.Style"; switch(m_rEntry.m_eFamily) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: pArray[1] = "com.sun.star.style.CharacterStyle"; pArray[2] = "com.sun.star.style.CharacterProperties"; pArray[3] = "com.sun.star.style.CharacterPropertiesAsian"; pArray[4] = "com.sun.star.style.CharacterPropertiesComplex"; break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: pArray[1] = "com.sun.star.style.PageStyle"; pArray[2] = "com.sun.star.style.PageProperties"; break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: pArray[1] = "com.sun.star.style.ParagraphStyle"; pArray[2] = "com.sun.star.style.ParagraphProperties"; pArray[3] = "com.sun.star.style.ParagraphPropertiesAsian"; @@ -1120,7 +1120,7 @@ uno::Sequence< OUString > SwXStyle::getSupportedServiceNames() throw( uno::Runti static uno::Reference<beans::XPropertySet> lcl_InitStandardStyle(const SfxStyleFamily eFamily, uno::Reference<container::XNameAccess>& rxStyleFamily) { using return_t = decltype(lcl_InitStandardStyle(eFamily, rxStyleFamily)); - if(eFamily != SFX_STYLE_FAMILY_PARA && eFamily != SFX_STYLE_FAMILY_PAGE) + if(eFamily != SfxStyleFamily::Para && eFamily != SfxStyleFamily::Page) return {}; auto aResult(rxStyleFamily->getByName("Standard")); if(!aResult.has<return_t>()) @@ -1131,9 +1131,9 @@ static uno::Reference<beans::XPropertySet> lcl_InitStandardStyle(const SfxStyleF static uno::Reference<container::XNameAccess> lcl_InitStyleFamily(SwDoc* pDoc, const StyleFamilyEntry& rEntry) { using return_t = decltype(lcl_InitStyleFamily(pDoc, rEntry)); - if(rEntry.m_eFamily != SFX_STYLE_FAMILY_CHAR - && rEntry.m_eFamily != SFX_STYLE_FAMILY_PARA - && rEntry.m_eFamily != SFX_STYLE_FAMILY_PAGE) + if(rEntry.m_eFamily != SfxStyleFamily::Char + && rEntry.m_eFamily != SfxStyleFamily::Para + && rEntry.m_eFamily != SfxStyleFamily::Page) return {}; auto xModel(pDoc->GetDocShell()->GetBaseModel()); uno::Reference<style::XStyleFamiliesSupplier> xFamilySupplier(xModel, uno::UNO_QUERY); @@ -1146,7 +1146,7 @@ static uno::Reference<container::XNameAccess> lcl_InitStyleFamily(SwDoc* pDoc, c static bool lcl_InitConditional(SfxStyleSheetBasePool* pBasePool, const SfxStyleFamily eFamily, const OUString& rStyleName) { - if(!pBasePool || eFamily != SFX_STYLE_FAMILY_PARA) + if(!pBasePool || eFamily != SfxStyleFamily::Para) return false; pBasePool->SetSearchMask(eFamily); SfxStyleSheetBase* pBase = pBasePool->Find(rStyleName); @@ -1177,7 +1177,7 @@ SwXStyle::SwXStyle(SwDoc* pDoc, SfxStyleFamily eFamily, bool bConditional) , m_xStyleFamily(lcl_InitStyleFamily(pDoc, m_rEntry)) , m_xStyleData(lcl_InitStandardStyle(eFamily, m_xStyleFamily)) { - assert(!m_bIsConditional || m_rEntry.m_eFamily == SFX_STYLE_FAMILY_PARA); // only paragraph styles are conditional + assert(!m_bIsConditional || m_rEntry.m_eFamily == SfxStyleFamily::Para); // only paragraph styles are conditional // Register ourselves as a listener to the document (via the page descriptor) pDoc->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this); m_pPropertiesImpl = std::unique_ptr<SwStyleProperties_Impl>( @@ -1325,7 +1325,7 @@ uno::Reference<beans::XPropertySetInfo> SwXStyle::getPropertySetInfo() throw( un { if(m_bIsConditional) { - assert(m_rEntry.m_eFamily == SFX_STYLE_FAMILY_PARA); + assert(m_rEntry.m_eFamily == SfxStyleFamily::Para); static uno::Reference<beans::XPropertySetInfo> xCondParaRef; xCondParaRef = aSwMapProvider.GetPropertySet(PROPERTY_MAP_CONDITIONAL_PARA_STYLE)->getPropertySetInfo(); return xCondParaRef; @@ -1599,9 +1599,9 @@ void SwXStyle::SetPropertyValue<FN_UNO_NUM_RULES>(const SfxItemPropertySimpleEnt aFormat.SetCharFormat(*pCharFormatIt); else if(m_pBasePool) { - auto pBase(static_cast<SfxStyleSheetBasePool*>(m_pBasePool)->Find(rCharName, SFX_STYLE_FAMILY_CHAR)); + auto pBase(static_cast<SfxStyleSheetBasePool*>(m_pBasePool)->Find(rCharName, SfxStyleFamily::Char)); if(!pBase) - pBase = &m_pBasePool->Make(rCharName, SFX_STYLE_FAMILY_CHAR); + pBase = &m_pBasePool->Make(rCharName, SfxStyleFamily::Char); aFormat.SetCharFormat(static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat()); } else @@ -1694,9 +1694,9 @@ void SwXStyle::SetPropertyValue<FN_UNO_IS_AUTO_UPDATE>(const SfxItemPropertySimp if(!rValue.has<bool>()) throw lang::IllegalArgumentException(); const bool bAuto(rValue.get<bool>()); - if(SFX_STYLE_FAMILY_PARA == m_rEntry.m_eFamily) + if(SfxStyleFamily::Para == m_rEntry.m_eFamily) o_rStyleBase.getNewBase()->GetCollection()->SetAutoUpdateFormat(bAuto); - else if(SFX_STYLE_FAMILY_FRAME == m_rEntry.m_eFamily) + else if(SfxStyleFamily::Frame == m_rEntry.m_eFamily) o_rStyleBase.getNewBase()->GetFrameFormat()->SetAutoUpdateFormat(bAuto); } template<> @@ -1721,7 +1721,7 @@ void SwXStyle::SetPropertyValue<FN_UNO_PARA_STYLE_CONDITIONS>(const SfxItemPrope const auto nIdx(GetCommandContextIndex(rNamedValue.Name)); if (nIdx == -1) throw lang::IllegalArgumentException(); - m_pBasePool->SetSearchMask(SFX_STYLE_FAMILY_PARA); + m_pBasePool->SetSearchMask(SfxStyleFamily::Para); bool bStyleFound = false; for(auto pBase = m_pBasePool->First(); pBase; pBase = m_pBasePool->Next()) { @@ -1809,7 +1809,7 @@ void SwXStyle::SetPropertyValue<RES_PARATR_DROP>(const SfxItemPropertySimpleEntr const auto sValue(rValue.get<OUString>()); OUString sStyle; SwStyleNameMapper::FillUIName(sValue, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, true); - auto pStyle(static_cast<SwDocStyleSheet*>(m_pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR))); + auto pStyle(static_cast<SwDocStyleSheet*>(m_pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SfxStyleFamily::Char))); if(!pStyle) throw lang::IllegalArgumentException(); pDrop->SetCharFormat(pStyle->GetCharFormat()); @@ -1822,7 +1822,7 @@ void SwXStyle::SetPropertyValue<RES_PARATR_NUMRULE>(const SfxItemPropertySimpleE lcl_TranslateMetric(rEntry, m_pDoc, aValue); SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, aValue, o_rStyleBase); // --> OD 2006-10-18 #i70223# - if(SFX_STYLE_FAMILY_PARA == m_rEntry.m_eFamily && + if(SfxStyleFamily::Para == m_rEntry.m_eFamily && o_rStyleBase.getNewBase().is() && o_rStyleBase.getNewBase()->GetCollection() && //rBase.getNewBase()->GetCollection()->GetOutlineLevel() < MAXLEVEL /* assigned to list level of outline style */) //#outline level,removed by zhaojianwei o_rStyleBase.getNewBase()->GetCollection()->IsAssignedToListLevelOfOutlineStyle()) ////<-end,add by zhaojianwei @@ -1971,7 +1971,7 @@ uno::Any SwXStyle::GetStyleProperty<FN_UNO_IS_PHYSICAL>(const SfxItemPropertySim return uno::makeAny(false); bool bPhys = static_cast<SwDocStyleSheet*>(pBase)->IsPhysical(); // The standard character format is not existing physically - if( bPhys && SFX_STYLE_FAMILY_CHAR == GetFamily() && + if( bPhys && SfxStyleFamily::Char == GetFamily() && static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat() && static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat()->IsDefault() ) bPhys = false; @@ -2025,7 +2025,7 @@ template<> uno::Any SwXStyle::GetStyleProperty<RES_PARATR_OUTLINELEVEL>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, SwStyleBase_Impl& rBase) { PrepareStyleBase(rBase); - SAL_WARN_IF(SFX_STYLE_FAMILY_PARA == GetFamily(), "sw.uno", "only paras"); + SAL_WARN_IF(SfxStyleFamily::Para == GetFamily(), "sw.uno", "only paras"); return uno::makeAny<sal_Int16>(rBase.getNewBase()->GetCollection()->GetAttrOutlineLevel()); } template<> @@ -2060,8 +2060,8 @@ uno::Any SwXStyle::GetStyleProperty<FN_UNO_IS_AUTO_UPDATE>(const SfxItemProperty PrepareStyleBase(rBase); switch(GetFamily()) { - case SFX_STYLE_FAMILY_PARA : return uno::makeAny<bool>(rBase.getNewBase()->GetCollection()->IsAutoUpdateFormat()); - case SFX_STYLE_FAMILY_FRAME: return uno::makeAny<bool>(rBase.getNewBase()->GetFrameFormat()->IsAutoUpdateFormat()); + case SfxStyleFamily::Para : return uno::makeAny<bool>(rBase.getNewBase()->GetCollection()->IsAutoUpdateFormat()); + case SfxStyleFamily::Frame: return uno::makeAny<bool>(rBase.getNewBase()->GetFrameFormat()->IsAutoUpdateFormat()); default: return uno::Any(); } } @@ -2234,20 +2234,20 @@ uno::Any SwXStyle::GetPropertyValue_Impl(const SfxItemPropertySet* pPropSet, SwS uno::Any aValue; switch(m_rEntry.m_eFamily) { - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: throw uno::RuntimeException("No default value for: " + rPropertyName); break; - case SFX_STYLE_FAMILY_PARA: - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Para: + case SfxStyleFamily::Page: SwStyleProperties_Impl::GetProperty(rPropertyName, m_xStyleData, aValue); break; - case SFX_STYLE_FAMILY_CHAR: - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Char: + case SfxStyleFamily::Frame: { if(pEntry->nWID < POOLATTR_BEGIN || pEntry->nWID >= RES_UNKNOWNATR_END) throw uno::RuntimeException("No default value for: " + rPropertyName); SwFormat* pFormat; - if(m_rEntry.m_eFamily == SFX_STYLE_FAMILY_CHAR) + if(m_rEntry.m_eFamily == SfxStyleFamily::Char) pFormat = m_pDoc->GetDfltCharFormat(); else pFormat = m_pDoc->GetDfltFrameFormat(); @@ -2327,7 +2327,7 @@ beans::PropertyState SwXStyle::getPropertyState(const OUString& rPropertyName) // use pSourceSet below this point (except in header/footer processing) const SfxItemSet* lcl_GetItemsetForProperty(const SfxItemSet& rSet, SfxStyleFamily eFamily, const OUString& rPropertyName) { - if(eFamily != SFX_STYLE_FAMILY_PAGE) + if(eFamily != SfxStyleFamily::Page) return &rSet; const bool isFooter = rPropertyName.startsWith("Footer"); if(!isFooter && !rPropertyName.startsWith("Header") && rPropertyName != UNO_NAME_FIRST_IS_SHARED) @@ -2418,7 +2418,7 @@ uno::Sequence<beans::PropertyState> SwXStyle::getPropertyStates(const uno::Seque { pStates[i] = pPropSet->getPropertyState(*pEntry, *pSourceSet); - if(SFX_STYLE_FAMILY_PAGE == m_rEntry.m_eFamily && SID_ATTR_PAGE_SIZE == pEntry->nWID && beans::PropertyState_DIRECT_VALUE == pStates[i]) + if(SfxStyleFamily::Page == m_rEntry.m_eFamily && SID_ATTR_PAGE_SIZE == pEntry->nWID && beans::PropertyState_DIRECT_VALUE == pStates[i]) { const SvxSizeItem& rSize = static_cast <const SvxSizeItem&>( rSet.Get(SID_ATTR_PAGE_SIZE)); sal_uInt8 nMemberId = pEntry->nMemberId & 0x7f; @@ -2448,10 +2448,10 @@ SwFormat* lcl_GetFormatForStyle(SwDoc* pDoc, const rtl::Reference<SwDocStyleShee return nullptr; switch(eFamily) { - case SFX_STYLE_FAMILY_CHAR: return xStyle->GetCharFormat(); - case SFX_STYLE_FAMILY_PARA: return xStyle->GetCollection(); - case SFX_STYLE_FAMILY_FRAME: return xStyle->GetFrameFormat(); - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Char: return xStyle->GetCharFormat(); + case SfxStyleFamily::Para: return xStyle->GetCollection(); + case SfxStyleFamily::Frame: return xStyle->GetFrameFormat(); + case SfxStyleFamily::Page: { SwPageDesc* pDesc(pDoc->FindPageDesc(xStyle->GetPageDesc()->GetName())); if(pDesc) @@ -2524,7 +2524,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault() const rtl::Reference<SwDocStyleSheet> xStyle(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(GetStyleSheetBase()))); if(!xStyle.is()) throw uno::RuntimeException(); - if(SFX_STYLE_FAMILY_PAGE == m_rEntry.m_eFamily) + if(SfxStyleFamily::Page == m_rEntry.m_eFamily) { size_t nPgDscPos(0); SwPageDesc* pDesc = m_pDoc->FindPageDesc(xStyle->GetPageDesc()->GetName(), &nPgDscPos); @@ -2581,7 +2581,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault() m_pDoc->ChgPageDesc(nPgDscPos, m_pDoc->GetPageDesc(nPgDscPos)); return; } - if(SFX_STYLE_FAMILY_PARA == m_rEntry.m_eFamily) + if(SfxStyleFamily::Para == m_rEntry.m_eFamily) { if(xStyle->GetCollection()) xStyle->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle(); @@ -2676,7 +2676,7 @@ SwXPageStyle::SwXPageStyle(SfxStyleSheetBasePool& rPool, SwDocShell* pDocSh, Sfx { } SwXPageStyle::SwXPageStyle(SwDocShell* pDocSh) - : SwXStyle(pDocSh->GetDoc(), SFX_STYLE_FAMILY_PAGE) + : SwXStyle(pDocSh->GetDoc(), SfxStyleFamily::Page) { } SwXPageStyle::~SwXPageStyle() @@ -3175,7 +3175,7 @@ void SwXPageStyle::setPropertyValue(const OUString& rPropertyName, const uno::An } SwXFrameStyle::SwXFrameStyle(SwDoc *pDoc) - : SwXStyle(pDoc, SFX_STYLE_FAMILY_FRAME, false) + : SwXStyle(pDoc, SfxStyleFamily::Frame, false) { } SwXFrameStyle::~SwXFrameStyle() diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index 33c976f61b68..e82ea4d9ef31 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -703,19 +703,19 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c Sequence< OUString> aFamiliesSeq( nCount ); OUString *pSeq = aFamiliesSeq.getArray(); if( aOpt.IsFrameFormats() ) - // SFX_STYLE_FAMILY_FRAME; + // SfxStyleFamily::Frame; *pSeq++ = "FrameStyles"; if( aOpt.IsPageDescs() ) - // SFX_STYLE_FAMILY_PAGE; + // SfxStyleFamily::Page; *pSeq++ = "PageStyles"; if( aOpt.IsTextFormats() ) { - // (SFX_STYLE_FAMILY_CHAR|SFX_STYLE_FAMILY_PARA); + // (SfxStyleFamily::Char|SfxStyleFamily::Para); *pSeq++ = "CharacterStyles"; *pSeq++ = "ParagraphStyles"; } if( aOpt.IsNumRules() ) - // SFX_STYLE_FAMILY_PSEUDO; + // SfxStyleFamily::Pseudo; *pSeq++ = "NumberingStyles"; xInfoSet->setPropertyValue( "StyleInsertModeFamilies", diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index 4251a45ecfac..dcf39d823327 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -812,22 +812,22 @@ SwXMLStylesContext_Impl::~SwXMLStylesContext_Impl() bool SwXMLStylesContext_Impl::InsertStyleFamily( sal_uInt16 nFamily ) const { const SwXMLImport& rSwImport = GetSwImport(); - const sal_uInt16 nStyleFamilyMask = rSwImport.GetStyleFamilyMask(); + const SfxStyleFamily nStyleFamilyMask = rSwImport.GetStyleFamilyMask(); bool bIns = true; switch( nFamily ) { case XML_STYLE_FAMILY_TEXT_PARAGRAPH: - bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_PARA) != 0; + bIns = bool(nStyleFamilyMask & SfxStyleFamily::Para); break; case XML_STYLE_FAMILY_TEXT_TEXT: - bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_CHAR) != 0; + bIns = bool(nStyleFamilyMask & SfxStyleFamily::Char); break; case XML_STYLE_FAMILY_SD_GRAPHICS_ID: - bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_FRAME) != 0; + bIns = bool(nStyleFamilyMask & SfxStyleFamily::Frame); break; case XML_STYLE_FAMILY_TEXT_LIST: - bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_PSEUDO) != 0; + bIns = bool(nStyleFamilyMask & SfxStyleFamily::Pseudo); break; case XML_STYLE_FAMILY_TEXT_OUTLINE: case XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG: @@ -923,9 +923,9 @@ bool SwXMLMasterStylesContext_Impl::InsertStyleFamily( sal_uInt16 nFamily ) cons bool bIns; const SwXMLImport& rSwImport = GetSwImport(); - const sal_uInt16 nStyleFamilyMask = rSwImport.GetStyleFamilyMask(); + const SfxStyleFamily nStyleFamilyMask = rSwImport.GetStyleFamilyMask(); if( XML_STYLE_FAMILY_MASTER_PAGE == nFamily ) - bIns = (nStyleFamilyMask & SFX_STYLE_FAMILY_PAGE) != 0; + bIns = bool(nStyleFamilyMask & SfxStyleFamily::Page); else bIns = XMLTextMasterStylesContext::InsertStyleFamily( nFamily ); diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index e749b3a3d2c2..8ee58ceb6bfc 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -344,7 +344,7 @@ void SwXMLDocStylesContext_Impl::EndElement() // are imported and finished. SwXMLImport& rSwImport = dynamic_cast<SwXMLImport&>( GetImport()); GetImport().GetTextImport()->SetOutlineStyles( - (rSwImport.GetStyleFamilyMask() & SFX_STYLE_FAMILY_PARA ) != 0); + bool(rSwImport.GetStyleFamilyMask() & SfxStyleFamily::Para)); } const SvXMLTokenMap& SwXMLImport::GetDocElemTokenMap() @@ -404,7 +404,7 @@ SwXMLImport::SwXMLImport( m_pTableCellAttrTokenMap( nullptr ), m_pGraphicResolver( nullptr ), m_pEmbeddedResolver( nullptr ), - m_nStyleFamilyMask( SFX_STYLE_FAMILY_ALL ), + m_nStyleFamilyMask( SfxStyleFamily::All ), m_bLoadDoc( true ), m_bInsert( false ), m_bBlock( false ), @@ -437,7 +437,7 @@ void SwXMLImport::setTextInsertMode( GetTextImport()->SetCursor( xTextCursor ); } -void SwXMLImport::setStyleInsertMode( sal_uInt16 nFamilies, +void SwXMLImport::setStyleInsertMode( SfxStyleFamily nFamilies, bool bOverwrite ) { m_bInsert = !bOverwrite; @@ -519,22 +519,22 @@ void SwXMLImport::startDocument() Sequence< OUString> aFamiliesSeq; if( aAny >>= aFamiliesSeq ) { - sal_uInt16 nFamilyMask = 0U; + SfxStyleFamily nFamilyMask = SfxStyleFamily::None; sal_Int32 nCount = aFamiliesSeq.getLength(); const OUString *pSeq = aFamiliesSeq.getConstArray(); for( sal_Int32 i=0; i < nCount; i++ ) { const OUString& rFamily = pSeq[i]; if( rFamily=="FrameStyles" ) - nFamilyMask |= SFX_STYLE_FAMILY_FRAME; + nFamilyMask |= SfxStyleFamily::Frame; else if( rFamily=="PageStyles" ) - nFamilyMask |= SFX_STYLE_FAMILY_PAGE; + nFamilyMask |= SfxStyleFamily::Page; else if( rFamily=="CharacterStyles" ) - nFamilyMask |= SFX_STYLE_FAMILY_CHAR; + nFamilyMask |= SfxStyleFamily::Char; else if( rFamily=="ParagraphStyles" ) - nFamilyMask |= SFX_STYLE_FAMILY_PARA; + nFamilyMask |= SfxStyleFamily::Para; else if( rFamily=="NumberingStyles" ) - nFamilyMask |= SFX_STYLE_FAMILY_PSEUDO; + nFamilyMask |= SfxStyleFamily::Pseudo; } bool bOverwrite = false; diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx index 1f5cf7e41218..a3d335f84a95 100644 --- a/sw/source/filter/xml/xmlimp.hxx +++ b/sw/source/filter/xml/xmlimp.hxx @@ -32,6 +32,7 @@ #include <xmloff/xmlimp.hxx> #include "xmlitmap.hxx" +#include <o3tl/typed_flags_set.hxx> class SwDoc; class SvXMLUnitConverter; @@ -42,6 +43,7 @@ class SwNodeIndex; class XMLTextImportHelper; class SvXMLGraphicHelper; class SvXMLEmbeddedObjectHelper; +enum class SfxStyleFamily; // define, how many steps ( = paragraphs ) the progress bar should advance // for styles, autostyles and settings + meta @@ -51,6 +53,12 @@ namespace SwImport { SwDoc* GetDocFromXMLImport( SvXMLImport& ); } +// we only need this scoped enum to be flags here, in sw +namespace o3tl +{ + template<> struct typed_flags<SfxStyleFamily> : is_typed_flags<SfxStyleFamily, 0xffff> {}; +} + class SwXMLImport: public SvXMLImport { std::unique_ptr<SwNodeIndex> m_pSttNdIdx; @@ -70,7 +78,7 @@ class SwXMLImport: public SvXMLImport css::uno::Reference< css::container::XNameContainer > m_xLateInitSettings; - sal_uInt16 m_nStyleFamilyMask;// Mask of styles to load + SfxStyleFamily m_nStyleFamilyMask;// Mask of styles to load bool m_bLoadDoc : 1; // Load doc or styles only bool m_bInsert : 1; // Insert mode. If styles are // loaded only false means that @@ -90,7 +98,7 @@ class SwXMLImport: public SvXMLImport void setTextInsertMode( const css::uno::Reference< css::text::XTextRange > & rInsertPos ); - void setStyleInsertMode( sal_uInt16 nFamilies, + void setStyleInsertMode( SfxStyleFamily nFamilies, bool bOverwrite ); void setBlockMode(); void setOrganizerMode(); @@ -149,7 +157,7 @@ public: const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ); SvXMLImportContext *CreateBodyContentContext( const OUString& rLocalName ); - sal_uInt16 GetStyleFamilyMask() const { return m_nStyleFamilyMask; } + SfxStyleFamily GetStyleFamilyMask() const { return m_nStyleFamilyMask; } bool IsInsertMode() const { return m_bInsert; } bool IsStylesOnlyMode() const { return !m_bLoadDoc; } bool IsBlockMode() const { return m_bBlock; } diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src index 4f16b1de0853..4f8bcdbed691 100644 --- a/sw/source/ui/app/app.src +++ b/sw/source/ui/app/app.src @@ -85,7 +85,7 @@ SfxStyleFamilies DLG_STYLE_DESIGNER SfxStyleFamilyItem { Text [ en-US ] = "Paragraph Styles" ; - StyleFamily = SFX_STYLE_FAMILY_PARA ; + StyleFamily = SfxStyleFamily::Para ; FilterList [ en-US ] = { < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ; @@ -105,7 +105,7 @@ SfxStyleFamilies DLG_STYLE_DESIGNER SfxStyleFamilyItem { Text [ en-US ] = "Character Styles" ; - StyleFamily = SFX_STYLE_FAMILY_CHAR ; + StyleFamily = SfxStyleFamily::Char ; FilterList [ en-US ] = { < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ; @@ -117,7 +117,7 @@ SfxStyleFamilies DLG_STYLE_DESIGNER SfxStyleFamilyItem { Text [ en-US ] = "Frame Styles" ; - StyleFamily = SFX_STYLE_FAMILY_FRAME ; + StyleFamily = SfxStyleFamily::Frame ; FilterList [ en-US ] = { < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ; @@ -129,7 +129,7 @@ SfxStyleFamilies DLG_STYLE_DESIGNER SfxStyleFamilyItem { Text [ en-US ] = "Page Styles" ; - StyleFamily = SFX_STYLE_FAMILY_PAGE ; + StyleFamily = SfxStyleFamily::Page ; FilterList [ en-US ] = { < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ; @@ -140,7 +140,7 @@ SfxStyleFamilies DLG_STYLE_DESIGNER }; SfxStyleFamilyItem { - StyleFamily = SFX_STYLE_FAMILY_PSEUDO ; + StyleFamily = SfxStyleFamily::Pseudo ; FilterList [ en-US ] = { < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ; diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index c90136653180..41ccbb854b4f 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -339,18 +339,18 @@ IMPL_LINK_NOARG_TYPED( SwParagraphNumTabPage, EditNumStyleSelectHdl_Impl, ListBo IMPL_LINK_NOARG_TYPED(SwParagraphNumTabPage, EditNumStyleHdl_Impl, Button*, void) { OUString aTemplName(m_pNumberStyleLB->GetSelectEntry()); - ExecuteEditNumStyle_Impl( SID_STYLE_EDIT, aTemplName, OUString(),SFX_STYLE_FAMILY_PSEUDO ); + ExecuteEditNumStyle_Impl( SID_STYLE_EDIT, aTemplName, OUString(), SfxStyleFamily::Pseudo ); } // Internal: Perform functions through the Dispatcher bool SwParagraphNumTabPage::ExecuteEditNumStyle_Impl( - sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, sal_uInt16 nFamily, + sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, SfxStyleFamily nFamily, sal_uInt16 nMask) { SfxDispatcher &rDispatcher = *SfxViewShell::Current()->GetDispatcher(); SfxStringItem aItem(nId, rStr); - SfxUInt16Item aFamily(SID_STYLE_FAMILY, nFamily); + SfxUInt16Item aFamily(SID_STYLE_FAMILY, (sal_uInt16)nFamily); SfxUInt16Item aMask( SID_STYLE_MASK, nMask ); SfxStringItem aUpdName(SID_STYLE_UPD_BY_EX_NAME, rStr); SfxStringItem aRefName( SID_STYLE_REFERENCE, rRefStr ); diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index 0775a2bedbc9..9a2932a0888f 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -246,7 +246,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) static_cast<SwParagraphNumTabPage&>(rPage).EnableNewStart(); ListBox & rBox = static_cast<SwParagraphNumTabPage&>(rPage).GetStyleBox(); SfxStyleSheetBasePool* pPool = rView.GetDocShell()->GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO); + pPool->SetSearchMask(SfxStyleFamily::Pseudo); const SfxStyleSheetBase* pBase = pPool->First(); std::set<OUString> aNames; while(pBase) @@ -261,7 +261,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) // The selection attribute lists (XPropertyList derivates, e.g. XColorList for // the color table) need to be added as items (e.g. SvxColorTableItem) to make // these pages find the needed attributes for fill style suggestions. - // These are added in SwDocStyleSheet::GetItemSet() for the SFX_STYLE_FAMILY_PARA on + // These are added in SwDocStyleSheet::GetItemSet() for the SfxStyleFamily::Para on // demand, but could also be directly added from the DrawModel. else if (m_nAreaId == nId) { diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index 8e74408a5972..271e8ee2436b 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -102,7 +102,7 @@ SwCondCollPage::SwCondCollPage(vcl::Window *pParent, const SfxItemSet &rSet) size_t nCount = aFamilies.size(); for( size_t i = 0; i < nCount; ++i ) { - if(SFX_STYLE_FAMILY_PARA == (pFamilyItem = aFamilies.at( i ))->GetFamily()) + if(SfxStyleFamily::Para == (pFamilyItem = aFamilies.at( i ))->GetFamily()) break; } @@ -182,7 +182,7 @@ void SwCondCollPage::Reset(const SfxItemSet *) m_pTbLinks->Clear(); SfxStyleSheetBasePool* pPool = m_rSh.GetView().GetDocShell()->GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PARA); + pPool->SetSearchMask(SfxStyleFamily::Para); m_pStyleLB->Clear(); const SfxStyleSheetBase* pBase = pPool->First(); while( pBase ) @@ -284,7 +284,7 @@ void SwCondCollPage::SelectHdl(void* pBox) const sal_Int32 nSelPos = static_cast<ListBox*>(pBox)->GetSelectEntryPos(); const sal_uInt16 nSearchFlags = *static_cast<sal_uInt16*>(m_pFilterLB->GetEntryData(nSelPos)); SfxStyleSheetBasePool* pPool = m_rSh.GetView().GetDocShell()->GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PARA, nSearchFlags); + pPool->SetSearchMask(SfxStyleFamily::Para, nSearchFlags); const SfxStyleSheetBase* pBase = pPool->First(); while( pBase ) diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index af78932c4ba3..e9f706e2b4d2 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -335,7 +335,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, // fill paragraph templates-ListBox { SfxStyleSheetBasePool* pPool = pView->GetDocShell()->GetStyleSheetPool(); - pPool->SetSearchMask( SFX_STYLE_FAMILY_PARA ); + pPool->SetSearchMask( SfxStyleFamily::Para ); m_pLbDbParaColl->InsertEntry( sNoTmpl ); const SfxStyleSheetBase* pBase = pPool->First(); diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 6c6e1c611924..2c57b97a0425 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -936,7 +936,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrameTabDialog(const O SfxAbstractApplyTabDialog* SwAbstractDialogFactory_Impl::CreateTemplateDialog( SfxStyleSheetBase& rBase, - sal_uInt16 nRegion, + SfxStyleFamily nRegion, const OString& sPage, SwWrtShell* pActShell, bool bNew ) diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index aafd58c5b167..98116f90e890 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -435,7 +435,7 @@ public: const OUString* pFormatStr = nullptr) override; virtual SfxAbstractApplyTabDialog* CreateTemplateDialog( SfxStyleSheetBase& rBase, - sal_uInt16 nRegion, + SfxStyleFamily nRegion, const OString& sPage = OString(), SwWrtShell* pActShell = nullptr, bool bNew = false) override; diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index 3e53d6bfa2a6..f1262f6ff38c 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -69,14 +69,14 @@ // the dialog's carrier SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent, SfxStyleSheetBase& rBase, - sal_uInt16 nRegion, + SfxStyleFamily nRegion, const OString& sPage, SwWrtShell* pActShell, bool bNew) : SfxStyleDialog(pParent, - "TemplateDialog" + OUString::number(nRegion), + "TemplateDialog" + OUString::number((sal_uInt16)nRegion), "modules/swriter/ui/templatedialog" + - OUString::number(nRegion) + ".ui", + OUString::number((sal_uInt16)nRegion) + ".ui", rBase) , nType(nRegion) , pWrtShell(pActShell) @@ -121,7 +121,7 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent, switch( nRegion ) { // character styles - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: { OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) , "GetTabPageRangesFunc fail!"); @@ -153,7 +153,7 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent, } break; // paragraph styles - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: { OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!"); @@ -240,7 +240,7 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent, } break; // frame styles - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: { m_nTypeId = AddTabPage("type", SwFramePage::Create, SwFramePage::GetRanges); @@ -263,7 +263,7 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent, break; } // page styles - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: { //UUUU remove? //OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); @@ -309,7 +309,7 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent, } break; // numbering styles - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { m_nSingleId = AddTabPage("numbering", RID_SVXPAGE_PICK_SINGLE_NUM); m_nBulletId = AddTabPage("bullets", RID_SVXPAGE_PICK_BULLET); @@ -380,7 +380,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) sal_uInt32 nFlags = 0; if(rPage.GetItemSet().GetParent() && 0 == (nHtmlMode & HTMLMODE_ON )) nFlags = SVX_RELATIVE_MODE; - if( SFX_STYLE_FAMILY_CHAR == nType ) + if( SfxStyleFamily::Char == nType ) nFlags = nFlags|SVX_PREVIEW_CHARACTER; aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlags)); rPage.PageCreated(aSet); @@ -388,14 +388,14 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) else if (nId == m_nFontEffectId) { sal_uInt32 nFlags = SVX_ENABLE_FLASH; - if( SFX_STYLE_FAMILY_CHAR == nType ) + if( SfxStyleFamily::Char == nType ) nFlags = nFlags|SVX_PREVIEW_CHARACTER; aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlags)); rPage.PageCreated(aSet); } else if (nId == m_nPositionId) { - if( SFX_STYLE_FAMILY_CHAR == nType ) + if( SfxStyleFamily::Char == nType ) { aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER)); rPage.PageCreated(aSet); @@ -403,7 +403,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) } else if (nId == m_nAsianLayoutId) { - if( SFX_STYLE_FAMILY_CHAR == nType ) + if( SfxStyleFamily::Char == nType ) { aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER)); rPage.PageCreated(aSet); @@ -430,7 +430,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) }//<-end ListBox & rBox = static_cast<SwParagraphNumTabPage&>(rPage).GetStyleBox(); SfxStyleSheetBasePool* pPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO); + pPool->SetSearchMask(SfxStyleFamily::Pseudo); const SfxStyleSheetBase* pBase = pPool->First(); std::set<OUString> aNames; while(pBase) @@ -462,7 +462,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) } else if (nId == m_nColumnId) { - if( nType == SFX_STYLE_FAMILY_FRAME ) + if( nType == SfxStyleFamily::Frame ) static_cast<SwColumnPage&>(rPage).SetFrameMode(true); static_cast<SwColumnPage&>(rPage).SetFormatUsed( true ); } @@ -471,7 +471,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) else if (nId == m_nBackgroundId) { SvxBackgroundTabFlags nFlagType = SvxBackgroundTabFlags::NONE; - if( SFX_STYLE_FAMILY_CHAR == nType || SFX_STYLE_FAMILY_PARA == nType ) + if( SfxStyleFamily::Char == nType || SfxStyleFamily::Para == nType ) nFlagType |= SvxBackgroundTabFlags::SHOW_HIGHLIGHTING; aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, static_cast<sal_uInt32>(nFlagType))); rPage.PageCreated(aSet); @@ -493,7 +493,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell-> GetView().GetDocShell()->GetStyleSheetPool(); - pStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_PARA); + pStyleSheetPool->SetSearchMask(SfxStyleFamily::Para); SfxStyleSheetBase *pFirstStyle = pStyleSheetPool->First(); while(pFirstStyle) { @@ -579,11 +579,11 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) } else if (nId == m_nBorderId) { - if( SFX_STYLE_FAMILY_PARA == nType ) + if( SfxStyleFamily::Para == nType ) { aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,static_cast<sal_uInt16>(SwBorderModes::PARA))); } - else if( SFX_STYLE_FAMILY_FRAME == nType ) + else if( SfxStyleFamily::Frame == nType ) { aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,static_cast<sal_uInt16>(SwBorderModes::FRAME))); } @@ -593,7 +593,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) // The selection attribute lists (XPropertyList derivates, e.g. XColorList for // the color table) need to be added as items (e.g. SvxColorTableItem) to make // these pages find the needed attributes for fill style suggestions. - // These are added in SwDocStyleSheet::GetItemSet() for the SFX_STYLE_FAMILY_PARA on + // These are added in SwDocStyleSheet::GetItemSet() for the SfxStyleFamily::Para on // demand, but could also be directly added from the DrawModel. else if (nId == m_nAreaId) { diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index d6cdcd918376..20662f2dea2c 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -2229,7 +2229,7 @@ IMPL_LINK_TYPED(SwTOXEntryTabPage, EditStyleHdl, Button*, pBtn, void) if( LISTBOX_ENTRY_NOTFOUND != m_pCharStyleLB->GetSelectEntryPos()) { SfxStringItem aStyle(SID_STYLE_EDIT, m_pCharStyleLB->GetSelectEntry()); - SfxUInt16Item aFamily(SID_STYLE_FAMILY, SFX_STYLE_FAMILY_CHAR); + SfxUInt16Item aFamily(SID_STYLE_FAMILY, (sal_uInt16)SfxStyleFamily::Char); vcl::Window* pDefDlgParent = Application::GetDefDialogParent(); Application::SetDefDialogParent( pBtn ); static_cast<SwMultiTOXTabDialog*>(GetTabDialog())->GetWrtShell(). @@ -3742,7 +3742,7 @@ IMPL_LINK_TYPED( SwTOXStylesTabPage, EditStyleHdl, Button *, pBtn, void ) if( LISTBOX_ENTRY_NOTFOUND != m_pParaLayLB->GetSelectEntryPos()) { SfxStringItem aStyle(SID_STYLE_EDIT, m_pParaLayLB->GetSelectEntry()); - SfxUInt16Item aFamily(SID_STYLE_FAMILY, SFX_STYLE_FAMILY_PARA); + SfxUInt16Item aFamily(SID_STYLE_FAMILY, (sal_uInt16)SfxStyleFamily::Para); vcl::Window* pDefDlgParent = Application::GetDefDialogParent(); Application::SetDefDialogParent( pBtn ); SwWrtShell& rSh = static_cast<SwMultiTOXTabDialog*>(GetTabDialog())->GetWrtShell(); diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 5f32002007d0..8cea39999609 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -200,7 +200,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet* ) // styles special regions // paragraph SfxStyleSheetBasePool* pStyleSheetPool = pSh->GetView().GetDocShell()->GetStyleSheetPool(); - pStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_PARA, SWSTYLEBIT_EXTRA); + pStyleSheetPool->SetSearchMask(SfxStyleFamily::Para, SWSTYLEBIT_EXTRA); SfxStyleSheetBase *pStyle = pStyleSheetPool->First(); while(pStyle) { @@ -353,9 +353,9 @@ static SwCharFormat* lcl_GetCharFormat( SwWrtShell* pSh, const OUString& rCharFo { SfxStyleSheetBasePool* pPool = pSh->GetView().GetDocShell()->GetStyleSheetPool(); SfxStyleSheetBase* pBase; - pBase = pPool->Find(rCharFormatName, SFX_STYLE_FAMILY_CHAR); + pBase = pPool->Find(rCharFormatName, SfxStyleFamily::Char); if(!pBase) - pBase = &pPool->Make(rCharFormatName, SFX_STYLE_FAMILY_CHAR); + pBase = &pPool->Make(rCharFormatName, SfxStyleFamily::Char); pFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat(); } return pFormat; diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx index 789904392edd..09c8bcebbd11 100644 --- a/sw/source/ui/misc/linenum.cxx +++ b/sw/source/ui/misc/linenum.cxx @@ -38,9 +38,9 @@ static rtl::Reference<SwDocStyleSheet> lcl_getDocStyleSheet(const OUString& rName, SwWrtShell *pSh) { - sal_uInt16 nFamily = SFX_STYLE_FAMILY_PARA; + SfxStyleFamily nFamily = SfxStyleFamily::Para; SfxStyleSheetBasePool* pBase = pSh->GetView().GetDocShell()->GetStyleSheetPool(); - SfxStyleSheetBase* pStyle = pBase->Find(rName, (SfxStyleFamily)nFamily); + SfxStyleSheetBase* pStyle = pBase->Find(rName, nFamily); SAL_WARN_IF( !pStyle, "sw.ui", "Style not found" ); if(!pStyle) return nullptr; @@ -205,9 +205,9 @@ IMPL_LINK_NOARG_TYPED(SwLineNumberingDlg, OKHdl, Button*, void) { SfxStyleSheetBasePool* pPool = pSh->GetView().GetDocShell()->GetStyleSheetPool(); SfxStyleSheetBase* pBase; - pBase = pPool->Find(sCharFormatName, SFX_STYLE_FAMILY_CHAR); + pBase = pPool->Find(sCharFormatName, SfxStyleFamily::Char); if(!pBase) - pBase = &pPool->Make(sCharFormatName, SFX_STYLE_FAMILY_CHAR); + pBase = &pPool->Make(sCharFormatName, SfxStyleFamily::Char); pCharFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat(); } diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 10685ec4ce15..c676566e2e2d 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -720,9 +720,9 @@ IMPL_LINK_NOARG_TYPED(SwOutlineSettingsTabPage, CharFormatHdl, ListBox&, void) { SfxStyleSheetBasePool* pPool = pSh->GetView().GetDocShell()->GetStyleSheetPool(); SfxStyleSheetBase* pBase; - pBase = pPool->Find(sEntry, SFX_STYLE_FAMILY_CHAR); + pBase = pPool->Find(sEntry, SfxStyleFamily::Char); if(!pBase) - pBase = &pPool->Make(sEntry, SFX_STYLE_FAMILY_PAGE); + pBase = &pPool->Make(sEntry, SfxStyleFamily::Page); pFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat(); } diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index db70a137a086..c9ec1e470ceb 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -93,7 +93,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) { SfxWhichIter aIter(rSet); sal_uInt16 nWhich = aIter.FirstWhich(); - sal_uInt16 nActualFamily = USHRT_MAX; + SfxStyleFamily nActualFamily = (SfxStyleFamily)USHRT_MAX; SwWrtShell* pShell = pSh ? pSh : GetWrtShell(); if(!pShell) @@ -113,7 +113,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get()); if (pFamilyItem) { - nActualFamily = static_cast<sal_uInt16>(SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue())); + nActualFamily = SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()); } } @@ -232,15 +232,15 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) { SwEditWin& rEdtWin = pShell->GetView().GetEditWin(); SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate(); - rSet.Put(SfxBoolItem(nWhich, pApply && pApply->eType != 0)); + rSet.Put(SfxBoolItem(nWhich, pApply && pApply->eType != (SfxStyleFamily)0)); } break; case SID_STYLE_UPDATE_BY_EXAMPLE: if( pShell->IsFrameSelected() - ? SFX_STYLE_FAMILY_FRAME != nActualFamily - : ( SFX_STYLE_FAMILY_FRAME == nActualFamily || - SFX_STYLE_FAMILY_PAGE == nActualFamily || - (SFX_STYLE_FAMILY_PSEUDO == nActualFamily && !pShell->GetNumRuleAtCurrCursorPos())) ) + ? SfxStyleFamily::Frame != nActualFamily + : ( SfxStyleFamily::Frame == nActualFamily || + SfxStyleFamily::Page == nActualFamily || + (SfxStyleFamily::Pseudo == nActualFamily && !pShell->GetNumRuleAtCurrCursorPos())) ) { rSet.DisableItem( nWhich ); } @@ -248,9 +248,9 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) case SID_STYLE_NEW_BY_EXAMPLE: if( (pShell->IsFrameSelected() - ? SFX_STYLE_FAMILY_FRAME != nActualFamily - : SFX_STYLE_FAMILY_FRAME == nActualFamily) || - (SFX_STYLE_FAMILY_PSEUDO == nActualFamily && !pShell->GetNumRuleAtCurrCursorPos()) ) + ? SfxStyleFamily::Frame != nActualFamily + : SfxStyleFamily::Frame == nActualFamily) || + (SfxStyleFamily::Pseudo == nActualFamily && !pShell->GetNumRuleAtCurrCursorPos()) ) { rSet.DisableItem( nWhich ); } @@ -281,7 +281,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY, false, &pItem )) { - const sal_uInt16 nFamily = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); + const SfxStyleFamily nFamily = (SfxStyleFamily) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); OUString sName; sal_uInt16 nMask = 0; @@ -347,13 +347,13 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) case SID_STYLE_NEW_BY_EXAMPLE: { OUString aParam; - sal_uInt16 nFamily = SFX_STYLE_FAMILY_PARA; + SfxStyleFamily nFamily = SfxStyleFamily::Para; sal_uInt16 nMask = 0; SwWrtShell* pActShell = nullptr; if( !pArgs ) { - nFamily = SFX_STYLE_FAMILY_PARA; + nFamily = SfxStyleFamily::Para; switch (nSlot) { @@ -391,25 +391,25 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) if( SfxItemState::SET == pArgs->GetItemState(SID_STYLE_FAMILY, false, &pItem )) - nFamily = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); + nFamily = (SfxStyleFamily) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); if( SfxItemState::SET == pArgs->GetItemState(SID_STYLE_FAMILYNAME, false, &pItem )) { OUString aFamily = static_cast<const SfxStringItem*>(pItem)->GetValue(); if(aFamily == "CharacterStyles") - nFamily = SFX_STYLE_FAMILY_CHAR; + nFamily = SfxStyleFamily::Char; else if(aFamily == "ParagraphStyles") - nFamily = SFX_STYLE_FAMILY_PARA; + nFamily = SfxStyleFamily::Para; else if(aFamily == "PageStyles") - nFamily = SFX_STYLE_FAMILY_PAGE; + nFamily = SfxStyleFamily::Page; else if(aFamily == "FrameStyles") - nFamily = SFX_STYLE_FAMILY_FRAME; + nFamily = SfxStyleFamily::Frame; else if(aFamily == "NumberingStyles") - nFamily = SFX_STYLE_FAMILY_PSEUDO; + nFamily = SfxStyleFamily::Pseudo; } if( SfxItemState::SET == pArgs->GetItemState(SID_STYLE_MASK, @@ -423,33 +423,34 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) { switch( nFamily ) { - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: { SwTextFormatColl* pColl = pShell->GetCurTextFormatColl(); if(pColl) aParam = pColl->GetName(); } break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: { SwFrameFormat* pFrame = m_pWrtShell->GetSelectedFrameFormat(); if( pFrame ) aParam = pFrame->GetName(); } break; - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: { SwCharFormat* pChar = m_pWrtShell->GetCurCharFormat(); if( pChar ) aParam = pChar->GetName(); } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: if(SfxItemState::SET == pArgs->GetItemState(SID_STYLE_UPD_BY_EX_NAME, false, &pItem)) { aParam = static_cast<const SfxStringItem*>(pItem)->GetValue(); } break; + default: break; } rReq.AppendItem(SfxStringItem(nSlot, aParam)); } @@ -470,16 +471,16 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) break; case SID_STYLE_APPLY: // Shell-switch in ApplyStyles - nRet = ApplyStyles(aParam, nFamily, pActShell, rReq.GetModifier() ); + nRet = (sal_uInt16) ApplyStyles(aParam, nFamily, pActShell, rReq.GetModifier() ); break; case SID_STYLE_WATERCAN: - nRet = DoWaterCan(aParam, nFamily); + nRet = (sal_uInt16) DoWaterCan(aParam, nFamily); break; case SID_STYLE_UPDATE_BY_EXAMPLE: - nRet = UpdateStyle(aParam, nFamily, pActShell); + nRet = (sal_uInt16) UpdateStyle(aParam, nFamily, pActShell); break; case SID_STYLE_NEW_BY_EXAMPLE: - nRet = MakeByExample(aParam, nFamily, nMask, pActShell ); + nRet = (sal_uInt16) MakeByExample(aParam, nFamily, nMask, pActShell ); break; default: @@ -504,7 +505,7 @@ class ApplyStyle public: ApplyStyle(SwDocShell &rDocSh, bool bNew, SfxStyleSheetBase* pStyle, sal_uInt16 nRet, rtl::Reference< SwDocStyleSheet > xTmp, - sal_uInt16 nFamily, SfxAbstractApplyTabDialog *pDlg, + SfxStyleFamily nFamily, SfxAbstractApplyTabDialog *pDlg, rtl::Reference< SfxStyleSheetBasePool > xBasePool, bool bModified) : m_rDocSh(rDocSh) @@ -530,7 +531,7 @@ private: SfxStyleSheetBase* m_pStyle; sal_uInt16 m_nRet; rtl::Reference< SwDocStyleSheet > m_xTmp; - sal_uInt16 m_nFamily; + SfxStyleFamily m_nFamily; SfxAbstractApplyTabDialog *m_pDlg; rtl::Reference< SfxStyleSheetBasePool > m_xBasePool; bool m_bModified; @@ -547,14 +548,14 @@ IMPL_LINK_NOARG_TYPED(ApplyStyle, ApplyHdl, LinkParamNone*, void) // newly set the mask only with paragraph-templates if( m_bNew ) { - m_nRet = SFX_STYLE_FAMILY_PARA == m_pStyle->GetFamily() + m_nRet = SfxStyleFamily::Para == m_pStyle->GetFamily() ? m_xTmp->GetMask() : SFXSTYLEBIT_USERDEF; } else if( m_pStyle->GetMask() != m_xTmp->GetMask() ) m_nRet = m_xTmp->GetMask(); - if( SFX_STYLE_FAMILY_PARA == m_nFamily ) + if( SfxStyleFamily::Para == m_nFamily ) { SfxItemSet aSet( *m_pDlg->GetOutputItemSet() ); ::SfxToSwPageDescAttr( *pWrtShell, aSet ); @@ -564,7 +565,7 @@ IMPL_LINK_NOARG_TYPED(ApplyStyle, ApplyHdl, LinkParamNone*, void) } else { - if(SFX_STYLE_FAMILY_PAGE == m_nFamily) + if(SfxStyleFamily::Page == m_nFamily) { static const sal_uInt16 aInval[] = { SID_IMAGE_ORIENTATION, @@ -573,14 +574,14 @@ IMPL_LINK_NOARG_TYPED(ApplyStyle, ApplyHdl, LinkParamNone*, void) pView->GetViewFrame()->GetBindings().Invalidate(aInval); } SfxItemSet aTmpSet( *m_pDlg->GetOutputItemSet() ); - if( SFX_STYLE_FAMILY_CHAR == m_nFamily ) + if( SfxStyleFamily::Char == m_nFamily ) { ::ConvertAttrGenToChar(aTmpSet, m_xTmp->GetItemSet(), CONV_ATTR_STD); } m_xTmp->SetItemSet( aTmpSet ); - if( SFX_STYLE_FAMILY_PAGE == m_nFamily && SvtLanguageOptions().IsCTLFontEnabled() ) + if( SfxStyleFamily::Page == m_nFamily && SvtLanguageOptions().IsCTLFontEnabled() ) { const SfxPoolItem *pItem = nullptr; if( aTmpSet.GetItemState( m_rDocSh.GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, false ) , true, &pItem ) == SfxItemState::SET ) @@ -591,7 +592,7 @@ IMPL_LINK_NOARG_TYPED(ApplyStyle, ApplyHdl, LinkParamNone*, void) //UUUU if(m_bNew) { - if(SFX_STYLE_FAMILY_FRAME == m_nFamily || SFX_STYLE_FAMILY_PARA == m_nFamily) + if(SfxStyleFamily::Frame == m_nFamily || SfxStyleFamily::Para == m_nFamily) { // clear FillStyle so that it works as a derived attribute SfxItemSet aTmpSet(*m_pDlg->GetOutputItemSet()); @@ -601,7 +602,7 @@ IMPL_LINK_NOARG_TYPED(ApplyStyle, ApplyHdl, LinkParamNone*, void) } } - if(SFX_STYLE_FAMILY_PAGE == m_nFamily) + if(SfxStyleFamily::Page == m_nFamily) pView->InvalidateRulerPos(); if( m_bNew ) @@ -619,7 +620,7 @@ IMPL_LINK_NOARG_TYPED(ApplyStyle, ApplyHdl, LinkParamNone*, void) sal_uInt16 SwDocShell::Edit( const OUString &rName, const OUString &rParent, - const sal_uInt16 nFamily, + const SfxStyleFamily nFamily, sal_uInt16 nMask, const bool bNew, const OString& sPage, @@ -654,7 +655,7 @@ sal_uInt16 SwDocShell::Edit( SwDocStyleSheet* pDStyle = static_cast<SwDocStyleSheet*>(pStyle); switch( nFamily ) { - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: { if(!rParent.isEmpty()) { @@ -688,7 +689,7 @@ sal_uInt16 SwDocShell::Edit( } } break; - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: { if(!rParent.isEmpty()) { @@ -712,7 +713,7 @@ sal_uInt16 SwDocShell::Edit( } } break; - case SFX_STYLE_FAMILY_FRAME : + case SfxStyleFamily::Frame : { if(!rParent.isEmpty()) { @@ -728,6 +729,7 @@ sal_uInt16 SwDocShell::Edit( } } break; + default: break; } if (!bBasic) @@ -748,19 +750,19 @@ sal_uInt16 SwDocShell::Edit( // put dialogues together rtl::Reference< SwDocStyleSheet > xTmp( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pStyle) ) ); - if( SFX_STYLE_FAMILY_PARA == nFamily ) + if( SfxStyleFamily::Para == nFamily ) { SfxItemSet& rSet = xTmp->GetItemSet(); ::SwToSfxPageDescAttr( rSet ); // merge list level indent attributes into the item set if needed xTmp->MergeIndentAttrsOfListStyle( rSet ); } - else if( SFX_STYLE_FAMILY_CHAR == nFamily ) + else if( SfxStyleFamily::Char == nFamily ) { ::ConvertAttrCharToGen(xTmp->GetItemSet(), CONV_ATTR_STD); } - if(SFX_STYLE_FAMILY_PAGE == nFamily || SFX_STYLE_FAMILY_PARA == nFamily) + if(SfxStyleFamily::Page == nFamily || SfxStyleFamily::Para == nFamily) { //UUUU create needed items for XPropertyList entries from the DrawModel so that // the Area TabPage can access them @@ -838,20 +840,20 @@ sal_uInt16 SwDocShell::Edit( // newly set the mask only with paragraph-templates if( bNew ) { - nRet = SFX_STYLE_FAMILY_PARA == pStyle->GetFamily() + nRet = SfxStyleFamily::Para == pStyle->GetFamily() ? xTmp->GetMask() : SFXSTYLEBIT_USERDEF; } else if( pStyle->GetMask() != xTmp->GetMask() ) nRet = xTmp->GetMask(); - if( SFX_STYLE_FAMILY_PARA == nFamily ) + if( SfxStyleFamily::Para == nFamily ) ::SfxToSwPageDescAttr( *GetWrtShell(), xTmp->GetItemSet() ); else { ::ConvertAttrGenToChar(xTmp->GetItemSet(), xTmp->GetItemSet(), CONV_ATTR_STD); } - if(SFX_STYLE_FAMILY_PAGE == nFamily) + if(SfxStyleFamily::Page == nFamily) m_pView->InvalidateRulerPos(); if( bNew ) @@ -868,9 +870,9 @@ sal_uInt16 SwDocShell::Edit( return nRet; } -bool SwDocShell::Delete(const OUString &rName, sal_uInt16 nFamily) +bool SwDocShell::Delete(const OUString &rName, SfxStyleFamily nFamily) { - SfxStyleSheetBase *pStyle = m_xBasePool->Find(rName, (SfxStyleFamily)nFamily); + SfxStyleSheetBase *pStyle = m_xBasePool->Find(rName, nFamily); if(pStyle) { @@ -885,9 +887,9 @@ bool SwDocShell::Delete(const OUString &rName, sal_uInt16 nFamily) return false; } -bool SwDocShell::Hide(const OUString &rName, sal_uInt16 nFamily, bool bHidden) +bool SwDocShell::Hide(const OUString &rName, SfxStyleFamily nFamily, bool bHidden) { - SfxStyleSheetBase *pStyle = m_xBasePool->Find(rName, (SfxStyleFamily)nFamily); + SfxStyleSheetBase *pStyle = m_xBasePool->Find(rName, nFamily); if(pStyle) { @@ -904,15 +906,15 @@ bool SwDocShell::Hide(const OUString &rName, sal_uInt16 nFamily, bool bHidden) } // apply template -sal_uInt16 SwDocShell::ApplyStyles(const OUString &rName, sal_uInt16 nFamily, +SfxStyleFamily SwDocShell::ApplyStyles(const OUString &rName, SfxStyleFamily nFamily, SwWrtShell* pShell, const sal_uInt16 nMode ) { - SwDocStyleSheet* pStyle = static_cast<SwDocStyleSheet*>( m_xBasePool->Find( rName, (SfxStyleFamily) nFamily ) ); + SwDocStyleSheet* pStyle = static_cast<SwDocStyleSheet*>( m_xBasePool->Find( rName, nFamily ) ); SAL_WARN_IF( !pStyle, "sw.ui", "Style not found" ); if(!pStyle) - return 0; + return SfxStyleFamily::None; SwWrtShell *pSh = pShell ? pShell : GetWrtShell(); @@ -922,14 +924,14 @@ sal_uInt16 SwDocShell::ApplyStyles(const OUString &rName, sal_uInt16 nFamily, switch (nFamily) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: { SwFormatCharFormat aFormat(pStyle->GetCharFormat()); pSh->SetAttrItem( aFormat, (nMode & KEY_SHIFT) ? SetAttrMode::DONTREPLACE : SetAttrMode::DEFAULT ); break; } - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: { // #i62675# // clear also list attributes at affected text nodes, if paragraph @@ -937,18 +939,18 @@ sal_uInt16 SwDocShell::ApplyStyles(const OUString &rName, sal_uInt16 nFamily, pSh->SetTextFormatColl( pStyle->GetCollection(), true ); break; } - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: { if ( pSh->IsFrameSelected() ) pSh->SetFrameFormat( pStyle->GetFrameFormat() ); break; } - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: { pSh->SetPageStyle(pStyle->GetPageDesc()->GetName()); break; } - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { // reset indent attribute on applying list style // continue list of list style @@ -966,13 +968,13 @@ sal_uInt16 SwDocShell::ApplyStyles(const OUString &rName, sal_uInt16 nFamily, } // start watering-can -sal_uInt16 SwDocShell::DoWaterCan(const OUString &rName, sal_uInt16 nFamily) +SfxStyleFamily SwDocShell::DoWaterCan(const OUString &rName, SfxStyleFamily nFamily) { assert( GetWrtShell() ); SwEditWin& rEdtWin = m_pView->GetEditWin(); SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate(); - bool bWaterCan = !(pApply && pApply->eType != 0); + bool bWaterCan = !(pApply && pApply->eType != (SfxStyleFamily)0); if( rName.isEmpty() ) bWaterCan = false; @@ -991,19 +993,19 @@ sal_uInt16 SwDocShell::DoWaterCan(const OUString &rName, sal_uInt16 nFamily) switch(nFamily) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: aTemplate.aColl.pCharFormat = pStyle->GetCharFormat(); break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: aTemplate.aColl.pTextColl = pStyle->GetCollection(); break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: aTemplate.aColl.pFrameFormat = pStyle->GetFrameFormat(); break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: aTemplate.aColl.pPageDesc = const_cast<SwPageDesc*>(pStyle->GetPageDesc()); break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: aTemplate.aColl.pNumRule = const_cast<SwNumRule*>(pStyle->GetNumRule()); break; @@ -1012,7 +1014,7 @@ sal_uInt16 SwDocShell::DoWaterCan(const OUString &rName, sal_uInt16 nFamily) } } else - aTemplate.eType = 0; + aTemplate.eType = (SfxStyleFamily)0; m_pView->GetEditWin().SetApplyTemplate(aTemplate); @@ -1020,7 +1022,7 @@ sal_uInt16 SwDocShell::DoWaterCan(const OUString &rName, sal_uInt16 nFamily) } // update template -sal_uInt16 SwDocShell::UpdateStyle(const OUString &rName, sal_uInt16 nFamily, SwWrtShell* pShell) +SfxStyleFamily SwDocShell::UpdateStyle(const OUString &rName, SfxStyleFamily nFamily, SwWrtShell* pShell) { SwWrtShell* pCurrWrtShell = pShell ? pShell : GetWrtShell(); assert( pCurrWrtShell ); @@ -1033,7 +1035,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const OUString &rName, sal_uInt16 nFamily, Sw switch(nFamily) { - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: { SwTextFormatColl* pColl = pStyle->GetCollection(); if(pColl && !pColl->IsDefault()) @@ -1052,7 +1054,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const OUString &rName, sal_uInt16 nFamily, Sw } break; } - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: { SwFrameFormat* pFrame = pStyle->GetFrameFormat(); if( pCurrWrtShell->IsFrameSelected() && pFrame && !pFrame->IsDefault() ) @@ -1073,7 +1075,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const OUString &rName, sal_uInt16 nFamily, Sw } } break; - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: { SwCharFormat* pChar = pStyle->GetCharFormat(); if( pChar && !pChar->IsDefault() ) @@ -1086,7 +1088,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const OUString &rName, sal_uInt16 nFamily, Sw } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { const SwNumRule* pCurRule; if( pStyle->GetNumRule() && @@ -1100,12 +1102,13 @@ sal_uInt16 SwDocShell::UpdateStyle(const OUString &rName, sal_uInt16 nFamily, Sw } } break; + default: break; } return nFamily; } // NewByExample -sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, +SfxStyleFamily SwDocShell::MakeByExample( const OUString &rName, SfxStyleFamily nFamily, sal_uInt16 nMask, SwWrtShell* pShell ) { SwWrtShell* pCurrWrtShell = pShell ? pShell : GetWrtShell(); @@ -1126,7 +1129,7 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, switch(nFamily) { - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: { SwTextFormatColl* pColl = pStyle->GetCollection(); if(pColl && !pColl->IsDefault()) @@ -1166,7 +1169,7 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, } } break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: { SwFrameFormat* pFrame = pStyle->GetFrameFormat(); if(pCurrWrtShell->IsFrameSelected() && pFrame && !pFrame->IsDefault()) @@ -1186,7 +1189,7 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, } } break; - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: { SwCharFormat* pChar = pStyle->GetCharFormat(); if(pChar && !pChar->IsDefault()) @@ -1201,7 +1204,7 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, } break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: { pCurrWrtShell->StartAllAction(); size_t nPgDsc = pCurrWrtShell->GetCurPageDesc(); @@ -1226,7 +1229,7 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { const SwNumRule* pCurRule = pCurrWrtShell->GetNumRuleAtCurrCursorPos(); @@ -1247,6 +1250,7 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, } } break; + default: break; } return nFamily; } @@ -1317,7 +1321,7 @@ void SwDocShell::FormatPage( const OString& rPageId, SwWrtShell& rActShell ) { - Edit( rPage, aEmptyOUStr, SFX_STYLE_FAMILY_PAGE, 0, false, rPageId, &rActShell); + Edit( rPage, aEmptyOUStr, SfxStyleFamily::Page, 0, false, rPageId, &rActShell); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index 52e9380c2b49..d948c5d29906 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -306,19 +306,19 @@ sal_uInt32 SwStyleSheetIterator::SwPoolFormatList::FindName(SfxStyleFamily eFam, sal_Unicode cStyle(0); switch( eFam ) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: cStyle = cCHAR; break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: cStyle = cPARA; break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: cStyle = cFRAME; break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: cStyle = cPAGE; break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: cStyle = cNUMRULE; break; default: @@ -455,7 +455,7 @@ void SwDocStyleSheet::SetGrabBagItem(const uno::Any& rVal) SwFormat* pFormat = nullptr; switch (nFamily) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: pFormat = rDoc.FindCharFormatByName(aName); if (pFormat) { @@ -463,7 +463,7 @@ void SwDocStyleSheet::SetGrabBagItem(const uno::Any& rVal) bChg = true; } break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: pFormat = rDoc.FindTextFormatCollByName(aName); if (pFormat) { @@ -471,7 +471,7 @@ void SwDocStyleSheet::SetGrabBagItem(const uno::Any& rVal) bChg = true; } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { SwNumRule* pRule = rDoc.FindNumRulePtr(aName); if (pRule) @@ -500,17 +500,17 @@ void SwDocStyleSheet::GetGrabBagItem(uno::Any& rVal) const SwFormat* pFormat = nullptr; switch (nFamily) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: pFormat = rDoc.FindCharFormatByName(aName); if (pFormat) pFormat->GetGrabBagItem(rVal); break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: pFormat = rDoc.FindTextFormatCollByName(aName); if (pFormat) pFormat->GetGrabBagItem(rVal); break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { SwNumRule* pRule = rDoc.FindNumRulePtr(aName); if (pRule) @@ -531,7 +531,7 @@ void SwDocStyleSheet::SetHidden( bool bValue ) SwFormat* pFormat = nullptr; switch(nFamily) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: pFormat = rDoc.FindCharFormatByName( aName ); if ( pFormat ) { @@ -540,7 +540,7 @@ void SwDocStyleSheet::SetHidden( bool bValue ) } break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: pFormat = rDoc.FindTextFormatCollByName( aName ); if ( pFormat ) { @@ -549,7 +549,7 @@ void SwDocStyleSheet::SetHidden( bool bValue ) } break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: pFormat = rDoc.FindFrameFormatByName( aName ); if ( pFormat ) { @@ -558,7 +558,7 @@ void SwDocStyleSheet::SetHidden( bool bValue ) } break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: { SwPageDesc* pPgDesc = rDoc.FindPageDesc(aName); if ( pPgDesc ) @@ -569,7 +569,7 @@ void SwDocStyleSheet::SetHidden( bool bValue ) } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { SwNumRule* pRule = rDoc.FindNumRulePtr( aName ); if ( pRule ) @@ -599,28 +599,28 @@ bool SwDocStyleSheet::IsHidden( ) const SwFormat* pFormat = nullptr; switch(nFamily) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: pFormat = rDoc.FindCharFormatByName( aName ); bRet = pFormat && pFormat->IsHidden( ); break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: pFormat = rDoc.FindTextFormatCollByName( aName ); bRet = pFormat && pFormat->IsHidden( ); break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: pFormat = rDoc.FindFrameFormatByName( aName ); bRet = pFormat && pFormat->IsHidden( ); break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: { SwPageDesc* pPgDesc = rDoc.FindPageDesc(aName); bRet = pPgDesc && pPgDesc->IsHidden( ); } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { SwNumRule* pRule = rDoc.FindNumRulePtr( aName ); bRet = pRule && pRule->IsHidden( ); @@ -640,23 +640,23 @@ const OUString& SwDocStyleSheet::GetParent() const SwGetPoolIdFromName eGetType; switch(nFamily) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: pFormat = rDoc.FindCharFormatByName( aName ); eGetType = nsSwGetPoolIdFromName::GET_POOLID_CHRFMT; break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: pFormat = rDoc.FindTextFormatCollByName( aName ); eGetType = nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL; break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: pFormat = rDoc.FindFrameFormatByName( aName ); eGetType = nsSwGetPoolIdFromName::GET_POOLID_FRMFMT; break; - case SFX_STYLE_FAMILY_PAGE: - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Page: + case SfxStyleFamily::Pseudo: default: return aEmptyOUStr; // there's no parent } @@ -697,11 +697,11 @@ bool SwDocStyleSheet::HasFollowSupport() const { switch(nFamily) { - case SFX_STYLE_FAMILY_PARA : - case SFX_STYLE_FAMILY_PAGE : return true; - case SFX_STYLE_FAMILY_FRAME: - case SFX_STYLE_FAMILY_CHAR : - case SFX_STYLE_FAMILY_PSEUDO: return false; + case SfxStyleFamily::Para : + case SfxStyleFamily::Page : return true; + case SfxStyleFamily::Frame: + case SfxStyleFamily::Char : + case SfxStyleFamily::Pseudo: return false; default: OSL_ENSURE(false, "unknown style family"); } @@ -714,9 +714,9 @@ bool SwDocStyleSheet::HasParentSupport() const bool bRet = false; switch(nFamily) { - case SFX_STYLE_FAMILY_CHAR : - case SFX_STYLE_FAMILY_PARA : - case SFX_STYLE_FAMILY_FRAME: bRet = true; + case SfxStyleFamily::Char : + case SfxStyleFamily::Para : + case SfxStyleFamily::Frame: bRet = true; default:; //prevent warning } return bRet; @@ -727,9 +727,9 @@ bool SwDocStyleSheet::HasClearParentSupport() const bool bRet = false; switch(nFamily) { - case SFX_STYLE_FAMILY_PARA : - case SFX_STYLE_FAMILY_CHAR : - case SFX_STYLE_FAMILY_FRAME: bRet = true; + case SfxStyleFamily::Para : + case SfxStyleFamily::Char : + case SfxStyleFamily::Frame: bRet = true; default:; //prevent warning } return bRet; @@ -741,7 +741,7 @@ OUString SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) IntlWrapper aIntlWrapper( SvtSysLocale().GetLanguageTag() ); const OUString sPlus(" + "); - if ( SFX_STYLE_FAMILY_PAGE == nFamily ) + if ( SfxStyleFamily::Page == nFamily ) { if( !pSet ) GetItemSet(); @@ -780,7 +780,7 @@ OUString SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) return aDesc; } - if ( SFX_STYLE_FAMILY_FRAME == nFamily || SFX_STYLE_FAMILY_PARA == nFamily) + if ( SfxStyleFamily::Frame == nFamily || SfxStyleFamily::Para == nFamily) { if( !pSet ) GetItemSet(); @@ -929,7 +929,7 @@ OUString SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) return aDesc; } - if( SFX_STYLE_FAMILY_PSEUDO == nFamily ) + if( SfxStyleFamily::Pseudo == nFamily ) { return OUString(); } @@ -954,7 +954,7 @@ bool SwDocStyleSheet::SetName(const OUString& rStr, bool bReindexNow) bool bChg = false; switch(nFamily) { - case SFX_STYLE_FAMILY_CHAR : + case SfxStyleFamily::Char : { OSL_ENSURE(pCharFormat, "SwCharFormat missing!"); if( pCharFormat && pCharFormat->GetName() != rStr ) @@ -968,7 +968,7 @@ bool SwDocStyleSheet::SetName(const OUString& rStr, bool bReindexNow) } break; } - case SFX_STYLE_FAMILY_PARA : + case SfxStyleFamily::Para : { OSL_ENSURE(pColl, "Collection missing!"); if( pColl && pColl->GetName() != rStr ) @@ -982,7 +982,7 @@ bool SwDocStyleSheet::SetName(const OUString& rStr, bool bReindexNow) } break; } - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: { OSL_ENSURE(pFrameFormat, "FrameFormat missing!"); if( pFrameFormat && pFrameFormat->GetName() != rStr ) @@ -996,7 +996,7 @@ bool SwDocStyleSheet::SetName(const OUString& rStr, bool bReindexNow) } break; } - case SFX_STYLE_FAMILY_PAGE : + case SfxStyleFamily::Page : OSL_ENSURE(pDesc, "PageDesc missing!"); if( pDesc && pDesc->GetName() != rStr ) { @@ -1017,7 +1017,7 @@ bool SwDocStyleSheet::SetName(const OUString& rStr, bool bReindexNow) bChg = true; } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: OSL_ENSURE(pNumRule, "NumRule missing!"); if (pNumRule) @@ -1068,26 +1068,26 @@ bool SwDocStyleSheet::SetParent( const OUString& rStr) SwFormat* pFormat = nullptr, *pParent = nullptr; switch(nFamily) { - case SFX_STYLE_FAMILY_CHAR : + case SfxStyleFamily::Char : OSL_ENSURE( pCharFormat, "SwCharFormat missing!" ); if( nullptr != ( pFormat = pCharFormat ) && !rStr.isEmpty() ) pParent = lcl_FindCharFormat(rDoc, rStr); break; - case SFX_STYLE_FAMILY_PARA : + case SfxStyleFamily::Para : OSL_ENSURE( pColl, "Collection missing!"); if( nullptr != ( pFormat = pColl ) && !rStr.isEmpty() ) pParent = lcl_FindParaFormat( rDoc, rStr ); break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: OSL_ENSURE(pFrameFormat, "FrameFormat missing!"); if( nullptr != ( pFormat = pFrameFormat ) && !rStr.isEmpty() ) pParent = lcl_FindFrameFormat( rDoc, rStr ); break; - case SFX_STYLE_FAMILY_PAGE: - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Page: + case SfxStyleFamily::Pseudo: break; default: OSL_ENSURE(false, "unknown style family"); @@ -1122,7 +1122,7 @@ bool SwDocStyleSheet::SetFollow( const OUString& rStr) SwImplShellAction aTmpSh( rDoc ); switch(nFamily) { - case SFX_STYLE_FAMILY_PARA : + case SfxStyleFamily::Para : { OSL_ENSURE(pColl, "Collection missing!"); if( pColl ) @@ -1135,7 +1135,7 @@ bool SwDocStyleSheet::SetFollow( const OUString& rStr) } break; } - case SFX_STYLE_FAMILY_PAGE : + case SfxStyleFamily::Page : { OSL_ENSURE(pDesc, "PageDesc missing!"); if( pDesc ) @@ -1154,9 +1154,9 @@ bool SwDocStyleSheet::SetFollow( const OUString& rStr) } break; } - case SFX_STYLE_FAMILY_CHAR: - case SFX_STYLE_FAMILY_FRAME: - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Char: + case SfxStyleFamily::Frame: + case SfxStyleFamily::Pseudo: break; default: OSL_ENSURE(false, "unknown style family"); @@ -1188,7 +1188,7 @@ std::unique_ptr<SfxItemSet> lcl_SwFormatToFlatItemSet(SwFormat *const pFormat) std::unique_ptr<SfxItemSet> SwDocStyleSheet::GetItemSetForPreview() { - if (SFX_STYLE_FAMILY_PAGE == nFamily || SFX_STYLE_FAMILY_PSEUDO == nFamily) + if (SfxStyleFamily::Page == nFamily || SfxStyleFamily::Pseudo == nFamily) { SAL_WARN("sw.ui", "GetItemSetForPreview not implemented for page or number style"); return std::unique_ptr<SfxItemSet>(); @@ -1208,11 +1208,11 @@ std::unique_ptr<SfxItemSet> SwDocStyleSheet::GetItemSetForPreview() { switch (nFamily) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: return lcl_SwFormatToFlatItemSet(pCharFormat); - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: return lcl_SwFormatToFlatItemSet(pColl); - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: return lcl_SwFormatToFlatItemSet(pFrameFormat); default: std::abort(); @@ -1229,9 +1229,9 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() switch(nFamily) { - case SFX_STYLE_FAMILY_CHAR: - case SFX_STYLE_FAMILY_PARA: - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Char: + case SfxStyleFamily::Para: + case SfxStyleFamily::Frame: { SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aBoxInfo.SetTable( false ); @@ -1241,7 +1241,7 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() // Single lines can only have DontCare-Status in tables aBoxInfo.SetValid( SvxBoxInfoItemValidFlags::DISABLE ); - if( nFamily == SFX_STYLE_FAMILY_CHAR ) + if( nFamily == SfxStyleFamily::Char ) { SAL_WARN_IF(!pCharFormat, "sw.ui", "Where's SwCharFormat"); aCoreSet.Put(pCharFormat->GetAttrSet()); @@ -1250,7 +1250,7 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() if(pCharFormat->DerivedFrom()) aCoreSet.SetParent(&pCharFormat->DerivedFrom()->GetAttrSet()); } - else if ( nFamily == SFX_STYLE_FAMILY_PARA ) + else if ( nFamily == SfxStyleFamily::Para ) { OSL_ENSURE(pColl, "Where's Collection"); aCoreSet.Put(pColl->GetAttrSet()); @@ -1282,7 +1282,7 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() } break; - case SFX_STYLE_FAMILY_PAGE : + case SfxStyleFamily::Page : { //UUUU set correct parent to get the drawing::FillStyle_NONE FillStyle as needed if(!aCoreSet.GetParent()) @@ -1295,7 +1295,7 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { OSL_ENSURE(pNumRule, "No NumRule"); SvxNumRule aRule = pNumRule->MakeSvxNumRule(); @@ -1314,7 +1314,7 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() void SwDocStyleSheet::MergeIndentAttrsOfListStyle( SfxItemSet& rSet ) { - if ( nFamily != SFX_STYLE_FAMILY_PARA ) + if ( nFamily != SfxStyleFamily::Para ) { return; } @@ -1368,14 +1368,14 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, switch(nFamily) { - case SFX_STYLE_FAMILY_CHAR : + case SfxStyleFamily::Char : { OSL_ENSURE(pCharFormat, "Where's CharFormat"); pFormat = pCharFormat; } break; - case SFX_STYLE_FAMILY_PARA : + case SfxStyleFamily::Para : { OSL_ENSURE(pColl, "Where's Collection"); const SfxPoolItem* pAutoUpdate; @@ -1500,7 +1500,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, pColl->SetPoolFormatId( nId ); break; } - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: { OSL_ENSURE(pFrameFormat, "Where's FrameFormat"); const SfxPoolItem* pAutoUpdate; @@ -1512,7 +1512,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, } break; - case SFX_STYLE_FAMILY_PAGE : + case SfxStyleFamily::Page : { OSL_ENSURE(pDesc, "Where's PageDescriptor"); @@ -1529,7 +1529,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { OSL_ENSURE(pNumRule, "Where's NumRule"); @@ -1588,7 +1588,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, SfxItemSet aSet(rSet); aSet.ClearInvalidItems(); - if(SFX_STYLE_FAMILY_FRAME == nFamily) + if(SfxStyleFamily::Frame == nFamily) { //UUUU Need to check for unique item for DrawingLayer items of type NameOrIndex // and evtl. correct that item to ensure unique names for that type. This call may @@ -1625,11 +1625,11 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, } } -static void lcl_SaveStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& rDoc ) +static void lcl_SaveStyles( SfxStyleFamily nFamily, std::vector<void*>& rArr, SwDoc& rDoc ) { switch( nFamily ) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: { const SwCharFormats& rTable = *rDoc.GetCharFormats(); for( size_t n = 0, nCnt = rTable.size(); n < nCnt; ++n ) @@ -1638,7 +1638,7 @@ static void lcl_SaveStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& } } break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: { const SwTextFormatColls& rTable = *rDoc.GetTextFormatColls(); for( size_t n = 0, nCnt = rTable.size(); n < nCnt; ++n ) @@ -1647,7 +1647,7 @@ static void lcl_SaveStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& } } break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: { const SwFrameFormats& rTable = *rDoc.GetFrameFormats(); for( size_t n = 0, nCnt = rTable.size(); n < nCnt; ++n ) @@ -1657,7 +1657,7 @@ static void lcl_SaveStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& } break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: { for( size_t n = 0, nCnt = rDoc.GetPageDescCnt(); n < nCnt; ++n ) { @@ -1666,7 +1666,7 @@ static void lcl_SaveStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { const SwNumRuleTable& rTable = rDoc.GetNumRuleTable(); for( size_t n = 0, nCnt = rTable.size(); n < nCnt; ++n ) @@ -1675,6 +1675,7 @@ static void lcl_SaveStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& } } break; + default: break; } } @@ -1683,12 +1684,12 @@ static bool lcl_Contains(const std::vector<void*>& rArr, const void* p) return std::find( rArr.begin(), rArr.end(), p ) != rArr.end(); } -static void lcl_DeleteInfoStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& rDoc ) +static void lcl_DeleteInfoStyles( SfxStyleFamily nFamily, std::vector<void*>& rArr, SwDoc& rDoc ) { size_t n, nCnt; switch( nFamily ) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: { std::deque<sal_uInt16> aDelArr; const SwCharFormats& rTable = *rDoc.GetCharFormats(); @@ -1702,7 +1703,7 @@ static void lcl_DeleteInfoStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, } break; - case SFX_STYLE_FAMILY_PARA : + case SfxStyleFamily::Para : { std::deque<sal_uInt16> aDelArr; const SwTextFormatColls& rTable = *rDoc.GetTextFormatColls(); @@ -1716,7 +1717,7 @@ static void lcl_DeleteInfoStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, } break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: { std::deque<SwFrameFormat*> aDelArr; const SwFrameFormats& rTable = *rDoc.GetFrameFormats(); @@ -1730,7 +1731,7 @@ static void lcl_DeleteInfoStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, } break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: { std::deque<size_t> aDelArr; for( n = 0, nCnt = rDoc.GetPageDescCnt(); n < nCnt; ++n ) @@ -1743,7 +1744,7 @@ static void lcl_DeleteInfoStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { std::deque<SwNumRule*> aDelArr; const SwNumRuleTable& rTable = rDoc.GetNumRuleTable(); @@ -1756,6 +1757,7 @@ static void lcl_DeleteInfoStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, rDoc.DelNumRule( aDelArr[ n ]->GetName() ); } break; + default: break; } } @@ -1775,7 +1777,7 @@ bool SwDocStyleSheet::FillStyleSheet( switch(nFamily) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: pCharFormat = lcl_FindCharFormat(rDoc, aName, this, bCreate ); bPhysical = nullptr != pCharFormat; if( bFillOnlyInfo && !bPhysical ) @@ -1784,7 +1786,7 @@ bool SwDocStyleSheet::FillStyleSheet( // later - without affecting the undo/redo stack ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); bDeleteInfo = true; - ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); + ::lcl_SaveStyles( nFamily, aDelArr, rDoc ); pCharFormat = lcl_FindCharFormat(rDoc, aName, this ); } @@ -1804,7 +1806,7 @@ bool SwDocStyleSheet::FillStyleSheet( pCharFormat = nullptr; break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: { pColl = lcl_FindParaFormat(rDoc, aName, this, bCreate); bPhysical = nullptr != pColl; @@ -1812,7 +1814,7 @@ bool SwDocStyleSheet::FillStyleSheet( { ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); bDeleteInfo = true; - ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); + ::lcl_SaveStyles( nFamily, aDelArr, rDoc ); pColl = lcl_FindParaFormat(rDoc, aName, this ); } @@ -1829,14 +1831,14 @@ bool SwDocStyleSheet::FillStyleSheet( } break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: pFrameFormat = lcl_FindFrameFormat(rDoc, aName, this, bCreate); bPhysical = nullptr != pFrameFormat; if (bFillOnlyInfo && !bPhysical) { ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); bDeleteInfo = true; - ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); + ::lcl_SaveStyles( nFamily, aDelArr, rDoc ); pFrameFormat = lcl_FindFrameFormat(rDoc, aName, this ); } pFormat = pFrameFormat; @@ -1849,14 +1851,14 @@ bool SwDocStyleSheet::FillStyleSheet( pFrameFormat = nullptr; break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: pDesc = lcl_FindPageDesc(rDoc, aName, this, bCreate); bPhysical = nullptr != pDesc; if( bFillOnlyInfo && !pDesc ) { ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); bDeleteInfo = true; - ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); + ::lcl_SaveStyles( nFamily, aDelArr, rDoc ); pDesc = lcl_FindPageDesc( rDoc, aName, this ); } @@ -1878,14 +1880,14 @@ bool SwDocStyleSheet::FillStyleSheet( pDesc = nullptr; break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: pNumRule = lcl_FindNumRule(rDoc, aName, this, bCreate); bPhysical = nullptr != pNumRule; if( bFillOnlyInfo && !pNumRule ) { ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); bDeleteInfo = true; - ::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); + ::lcl_SaveStyles( nFamily, aDelArr, rDoc ); pNumRule = lcl_FindNumRule( rDoc, aName, this ); } @@ -1910,9 +1912,9 @@ bool SwDocStyleSheet::FillStyleSheet( default:; //prevent warning } - if( SFX_STYLE_FAMILY_CHAR == nFamily || - SFX_STYLE_FAMILY_PARA == nFamily || - SFX_STYLE_FAMILY_FRAME == nFamily ) + if( SfxStyleFamily::Char == nFamily || + SfxStyleFamily::Para == nFamily || + SfxStyleFamily::Frame == nFamily ) { if( pFormat ) nPoolId = pFormat->GetPoolFormatId(); @@ -1958,7 +1960,7 @@ bool SwDocStyleSheet::FillStyleSheet( if( bDeleteInfo && bFillOnlyInfo ) { ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo()); - ::lcl_DeleteInfoStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc ); + ::lcl_DeleteInfoStyles( nFamily, aDelArr, rDoc ); if (!isModified) { rDoc.getIDocumentState().ResetModified(); @@ -1972,7 +1974,7 @@ void SwDocStyleSheet::Create() { switch(nFamily) { - case SFX_STYLE_FAMILY_CHAR : + case SfxStyleFamily::Char : pCharFormat = lcl_FindCharFormat( rDoc, aName ); if( !pCharFormat ) pCharFormat = rDoc.MakeCharFormat(aName, @@ -1980,7 +1982,7 @@ void SwDocStyleSheet::Create() pCharFormat->SetAuto(false); break; - case SFX_STYLE_FAMILY_PARA : + case SfxStyleFamily::Para : pColl = lcl_FindParaFormat( rDoc, aName ); if( !pColl ) { @@ -1992,14 +1994,14 @@ void SwDocStyleSheet::Create() } break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: pFrameFormat = lcl_FindFrameFormat( rDoc, aName ); if( !pFrameFormat ) pFrameFormat = rDoc.MakeFrameFormat(aName, rDoc.GetDfltFrameFormat(), false, false); break; - case SFX_STYLE_FAMILY_PAGE : + case SfxStyleFamily::Page : pDesc = lcl_FindPageDesc( rDoc, aName ); if( !pDesc ) { @@ -2007,7 +2009,7 @@ void SwDocStyleSheet::Create() } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: pNumRule = lcl_FindNumRule( rDoc, aName ); if( !pNumRule ) { @@ -2072,11 +2074,11 @@ void SwDocStyleSheet::PresetNameAndFamily(const OUString& rName) { switch( rName[0] ) { - case cPARA: nFamily = SFX_STYLE_FAMILY_PARA; break; - case cFRAME: nFamily = SFX_STYLE_FAMILY_FRAME; break; - case cPAGE: nFamily = SFX_STYLE_FAMILY_PAGE; break; - case cNUMRULE: nFamily = SFX_STYLE_FAMILY_PSEUDO; break; - default: nFamily = SFX_STYLE_FAMILY_CHAR; break; + case cPARA: nFamily = SfxStyleFamily::Para; break; + case cFRAME: nFamily = SfxStyleFamily::Frame; break; + case cPAGE: nFamily = SfxStyleFamily::Page; break; + case cNUMRULE: nFamily = SfxStyleFamily::Pseudo; break; + default: nFamily = SfxStyleFamily::Char; break; } aName = rName.copy(1); } @@ -2116,12 +2118,12 @@ bool SwDocStyleSheet::IsUsed() const const SwModify* pMod; switch( nFamily ) { - case SFX_STYLE_FAMILY_CHAR : pMod = pCharFormat; break; - case SFX_STYLE_FAMILY_PARA : pMod = pColl; break; - case SFX_STYLE_FAMILY_FRAME: pMod = pFrameFormat; break; - case SFX_STYLE_FAMILY_PAGE : pMod = pDesc; break; + case SfxStyleFamily::Char : pMod = pCharFormat; break; + case SfxStyleFamily::Para : pMod = pColl; break; + case SfxStyleFamily::Frame: pMod = pFrameFormat; break; + case SfxStyleFamily::Page : pMod = pDesc; break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: return pNumRule && SwDoc::IsUsed( *pNumRule ); default: @@ -2142,7 +2144,7 @@ sal_uLong SwDocStyleSheet::GetHelpId( OUString& rFile ) const SwFormat* pTmpFormat = nullptr; switch( nFamily ) { - case SFX_STYLE_FAMILY_CHAR : + case SfxStyleFamily::Char : if( !pCharFormat && nullptr == (pCharFormat = lcl_FindCharFormat( rDoc, aName, nullptr, false )) ) { @@ -2152,7 +2154,7 @@ sal_uLong SwDocStyleSheet::GetHelpId( OUString& rFile ) pTmpFormat = pCharFormat; break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: if( !pColl && nullptr == ( pColl = lcl_FindParaFormat( rDoc, aName, nullptr, false )) ) { @@ -2162,7 +2164,7 @@ sal_uLong SwDocStyleSheet::GetHelpId( OUString& rFile ) pTmpFormat = pColl; break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: if( !pFrameFormat && nullptr == ( pFrameFormat = lcl_FindFrameFormat( rDoc, aName, nullptr, false ) ) ) { @@ -2172,7 +2174,7 @@ sal_uLong SwDocStyleSheet::GetHelpId( OUString& rFile ) pTmpFormat = pFrameFormat; break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: if( !pDesc && nullptr == ( pDesc = lcl_FindPageDesc( rDoc, aName, nullptr, false ) ) ) { @@ -2185,7 +2187,7 @@ sal_uLong SwDocStyleSheet::GetHelpId( OUString& rFile ) nPoolId = pDesc->GetPoolFormatId(); break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: if( !pNumRule && nullptr == ( pNumRule = lcl_FindNumRule( rDoc, aName, nullptr, false ) ) ) { @@ -2238,15 +2240,15 @@ void SwDocStyleSheet::SetHelpId( const OUString& r, sal_uLong nId ) SwFormat* pTmpFormat = nullptr; switch( nFamily ) { - case SFX_STYLE_FAMILY_CHAR : pTmpFormat = pCharFormat; break; - case SFX_STYLE_FAMILY_PARA : pTmpFormat = pColl; break; - case SFX_STYLE_FAMILY_FRAME: pTmpFormat = pFrameFormat; break; - case SFX_STYLE_FAMILY_PAGE : + case SfxStyleFamily::Char : pTmpFormat = pCharFormat; break; + case SfxStyleFamily::Para : pTmpFormat = pColl; break; + case SfxStyleFamily::Frame: pTmpFormat = pFrameFormat; break; + case SfxStyleFamily::Page : const_cast<SwPageDesc*>(pDesc)->SetPoolHelpId( nHId ); const_cast<SwPageDesc*>(pDesc)->SetPoolHlpFileId( nFileId ); break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: const_cast<SwNumRule*>(pNumRule)->SetPoolHelpId( nHId ); const_cast<SwNumRule*>(pNumRule)->SetPoolHlpFileId( nFileId ); break; @@ -2265,7 +2267,7 @@ void SwDocStyleSheet::SetHelpId( const OUString& r, sal_uLong nId ) // methods for DocStyleSheetPool SwDocStyleSheetPool::SwDocStyleSheetPool( SwDoc& rDocument, bool bOrg ) : SfxStyleSheetBasePool( rDocument.GetAttrPool() ) -, mxStyleSheet( new SwDocStyleSheet( rDocument, OUString(), this, SFX_STYLE_FAMILY_CHAR ) ) +, mxStyleSheet( new SwDocStyleSheet( rDocument, OUString(), this, SfxStyleFamily::Char ) ) , rDoc( rDocument ) { bOrganizer = bOrg; @@ -2333,34 +2335,34 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* pStyle) const OUString sName = pStyle->GetName(); switch( pStyle->GetFamily() ) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: { SwCharFormat* pFormat = lcl_FindCharFormat(rDoc, sName, nullptr, false ); if(pFormat) rDoc.DelCharFormat(pFormat); } break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: { SwTextFormatColl* pColl = lcl_FindParaFormat(rDoc, sName, nullptr, false ); if(pColl) rDoc.DelTextFormatColl(pColl); } break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: { SwFrameFormat* pFormat = lcl_FindFrameFormat(rDoc, sName, nullptr, false ); if(pFormat) rDoc.DelFrameFormat(pFormat); } break; - case SFX_STYLE_FAMILY_PAGE : + case SfxStyleFamily::Page : { rDoc.DelPageDesc(sName); } break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { if( !rDoc.DelNumRule( sName ) ) // Only send Broadcast, when something was deleted @@ -2383,23 +2385,23 @@ bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, SwFormat* pFormat = nullptr, *pParent = nullptr; switch( eFam ) { - case SFX_STYLE_FAMILY_CHAR : + case SfxStyleFamily::Char : if( nullptr != ( pFormat = lcl_FindCharFormat( rDoc, rStyle ) ) && !rParent.isEmpty() ) pParent = lcl_FindCharFormat(rDoc, rParent ); break; - case SFX_STYLE_FAMILY_PARA : + case SfxStyleFamily::Para : if( nullptr != ( pFormat = lcl_FindParaFormat( rDoc, rStyle ) ) && !rParent.isEmpty() ) pParent = lcl_FindParaFormat( rDoc, rParent ); break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: if( nullptr != ( pFormat = lcl_FindFrameFormat( rDoc, rStyle ) ) && !rParent.isEmpty() ) pParent = lcl_FindFrameFormat( rDoc, rParent ); break; - case SFX_STYLE_FAMILY_PAGE: - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Page: + case SfxStyleFamily::Pseudo: break; default: @@ -2420,7 +2422,7 @@ bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, // only for Broadcasting mxStyleSheet->PresetName( rStyle ); mxStyleSheet->PresetParent( rParent ); - if( SFX_STYLE_FAMILY_PARA == eFam ) + if( SfxStyleFamily::Para == eFam ) mxStyleSheet->PresetFollow( static_cast<SwTextFormatColl*>(pFormat)-> GetNextTextFormatColl().GetName() ); else @@ -2438,7 +2440,7 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const OUString& rName, SfxStyleFamily eFam, sal_uInt16 n ) { sal_uInt16 nSMask = n; - if( SFX_STYLE_FAMILY_PARA == eFam && rDoc.getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE) ) + if( SfxStyleFamily::Para == eFam && rDoc.getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE) ) { // then only HTML-Templates are of interest if( USHRT_MAX == nSMask ) @@ -2462,23 +2464,23 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const OUString& rName, { switch( eFam ) { - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: pMod = mxStyleSheet->GetCharFormat(); break; - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: pMod = mxStyleSheet->GetCollection(); break; - case SFX_STYLE_FAMILY_FRAME: + case SfxStyleFamily::Frame: pMod = mxStyleSheet->GetFrameFormat(); break; - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: pMod = mxStyleSheet->GetPageDesc(); break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: { const SwNumRule* pRule = mxStyleSheet->GetNumRule(); if( pRule && @@ -2499,7 +2501,7 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const OUString& rName, // then evaluate the mask: if( pMod && !bSearchUsed ) { - const sal_uInt16 nId = SFX_STYLE_FAMILY_PAGE == eFam + const sal_uInt16 nId = SfxStyleFamily::Page == eFam ? static_cast<const SwPageDesc*>(pMod)->GetPoolFormatId() : static_cast<const SwFormat*>(pMod)->GetPoolFormatId(); @@ -2515,8 +2517,8 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const OUString& rName, SwStyleSheetIterator::SwStyleSheetIterator( SwDocStyleSheetPool* pBase, SfxStyleFamily eFam, sal_uInt16 n ) : SfxStyleSheetIterator( pBase, eFam, n ), - mxIterSheet( new SwDocStyleSheet( pBase->GetDoc(), OUString(), pBase, SFX_STYLE_FAMILY_CHAR ) ), - mxStyleSheet( new SwDocStyleSheet( pBase->GetDoc(), OUString(), pBase, SFX_STYLE_FAMILY_CHAR ) ) + mxIterSheet( new SwDocStyleSheet( pBase->GetDoc(), OUString(), pBase, SfxStyleFamily::Char ) ), + mxStyleSheet( new SwDocStyleSheet( pBase->GetDoc(), OUString(), pBase, SfxStyleFamily::Char ) ) { bFirstCalled = false; nLastPos = 0; @@ -2568,8 +2570,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() const bool bOrganizer = static_cast<SwDocStyleSheetPool*>(pBasePool)->IsOrganizerMode(); bool bAll = ( nSrchMask & SFXSTYLEBIT_ALL_VISIBLE ) == SFXSTYLEBIT_ALL_VISIBLE; - if( nSearchFamily == SFX_STYLE_FAMILY_CHAR - || nSearchFamily == SFX_STYLE_FAMILY_ALL ) + if( nSearchFamily == SfxStyleFamily::Char + || nSearchFamily == SfxStyleFamily::All ) { const size_t nArrLen = rDoc.GetCharFormats()->size(); for( size_t i = 0; i < nArrLen; i++ ) @@ -2637,8 +2639,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() } } - if( nSearchFamily == SFX_STYLE_FAMILY_PARA || - nSearchFamily == SFX_STYLE_FAMILY_ALL ) + if( nSearchFamily == SfxStyleFamily::Para || + nSearchFamily == SfxStyleFamily::All ) { sal_uInt16 nSMask = nSrchMask; if( rDoc.getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE) ) @@ -2797,8 +2799,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() } } - if( nSearchFamily == SFX_STYLE_FAMILY_FRAME || - nSearchFamily == SFX_STYLE_FAMILY_ALL ) + if( nSearchFamily == SfxStyleFamily::Frame || + nSearchFamily == SfxStyleFamily::All ) { const size_t nArrLen = rDoc.GetFrameFormats()->size(); for( size_t i = 0; i < nArrLen; i++ ) @@ -2833,8 +2835,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() bIsSearchUsed, bSearchHidden, bOnlyHidden, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, cFRAME); } - if( nSearchFamily == SFX_STYLE_FAMILY_PAGE || - nSearchFamily == SFX_STYLE_FAMILY_ALL ) + if( nSearchFamily == SfxStyleFamily::Page || + nSearchFamily == SfxStyleFamily::All ) { const size_t nCount = rDoc.GetPageDescCnt(); for(size_t i = 0; i < nCount; ++i) @@ -2862,8 +2864,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() bIsSearchUsed, bSearchHidden, bOnlyHidden, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, cPAGE); } - if( nSearchFamily == SFX_STYLE_FAMILY_PSEUDO || - nSearchFamily == SFX_STYLE_FAMILY_ALL ) + if( nSearchFamily == SfxStyleFamily::Pseudo || + nSearchFamily == SfxStyleFamily::All ) { const SwNumRuleTable& rNumTable = rDoc.GetNumRuleTable(); for(size_t i = 0; i < rNumTable.size(); ++i) diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 5420d3a9ef7f..adcb440ff0c5 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -374,7 +374,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) if( m_pApplyTempl->m_pFormatClipboard ) bFrameIsValidTarget = m_pApplyTempl->m_pFormatClipboard->HasContentForThisType( nsSelectionType::SEL_FRM ); else if( !m_pApplyTempl->nColor ) - bFrameIsValidTarget = ( m_pApplyTempl->eType == SFX_STYLE_FAMILY_FRAME ); + bFrameIsValidTarget = ( m_pApplyTempl->eType == SfxStyleFamily::Frame ); if( bFrameIsValidTarget && nullptr !=(pFormat = rSh.GetFormatFromObj( rLPt, &pRect )) && @@ -4869,7 +4869,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) OUString aStyleName; switch ( m_pApplyTempl->eType ) { - case SFX_STYLE_FAMILY_PARA: + case SfxStyleFamily::Para: if( (( nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL ) & eSelection ) && !rSh.HasReadonlySel() ) { @@ -4881,7 +4881,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) aStyleName = m_pApplyTempl->aColl.pTextColl->GetName(); } break; - case SFX_STYLE_FAMILY_CHAR: + case SfxStyleFamily::Char: if( (( nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL ) & eSelection ) && !rSh.HasReadonlySel() ) { @@ -4896,7 +4896,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) aStyleName = m_pApplyTempl->aColl.pCharFormat->GetName(); } break; - case SFX_STYLE_FAMILY_FRAME : + case SfxStyleFamily::Frame : { const SwFrameFormat* pFormat = rSh.GetFormatFromObj( aDocPt ); if(dynamic_cast<const SwFlyFrameFormat*>( pFormat) ) @@ -4910,7 +4910,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) } break; } - case SFX_STYLE_FAMILY_PAGE: + case SfxStyleFamily::Page: // no Undo with page templates rSh.ChgCurPageDesc( *m_pApplyTempl->aColl.pPageDesc ); if ( m_pApplyTempl->aColl.pPageDesc ) @@ -4919,7 +4919,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) std::min(m_pApplyTempl->nUndo, rSh.GetDoc()->GetIDocumentUndoRedo().GetUndoActionCount()); bCallBase = false; break; - case SFX_STYLE_FAMILY_PSEUDO: + case SfxStyleFamily::Pseudo: if( !rSh.HasReadonlySel() ) { rSh.SetCurNumRule( *m_pApplyTempl->aColl.pNumRule, @@ -4932,6 +4932,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) aStyleName = m_pApplyTempl->aColl.pNumRule->GetName(); } break; + default: break; } uno::Reference< frame::XDispatchRecorder > xRecorder = @@ -5008,7 +5009,7 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl) bIdle = rSh.GetViewOptions()->IsIdle(); rSh.GetViewOptions()->SetIdle( false ); } - else if( rTempl.eType ) + else if( rTempl.eType != SfxStyleFamily::None ) { m_pApplyTempl = new SwApplyTemplate( rTempl ); m_pApplyTempl->nUndo = rSh.GetDoc()->GetIDocumentUndoRedo().GetUndoActionCount(); diff --git a/sw/source/uibase/inc/numpara.hxx b/sw/source/uibase/inc/numpara.hxx index daa0b8917c11..9ba30dab241c 100644 --- a/sw/source/uibase/inc/numpara.hxx +++ b/sw/source/uibase/inc/numpara.hxx @@ -63,7 +63,7 @@ class SwParagraphNumTabPage : public SfxTabPage protected: static bool ExecuteEditNumStyle_Impl( sal_uInt16 nId, const OUString& rStr, const OUString& rRefStr, - sal_uInt16 nFamily, sal_uInt16 nMask = 0 ); + SfxStyleFamily nFamily, sal_uInt16 nMask = 0 ); public: SwParagraphNumTabPage(vcl::Window* pParent, const SfxItemSet& rSet ); diff --git a/sw/source/uibase/inc/tmpdlg.hxx b/sw/source/uibase/inc/tmpdlg.hxx index b339757b7554..72bbda23b4af 100644 --- a/sw/source/uibase/inc/tmpdlg.hxx +++ b/sw/source/uibase/inc/tmpdlg.hxx @@ -28,7 +28,7 @@ class SwWrtShell; class SwTemplateDlg: public SfxStyleDialog { - sal_uInt16 nType; + SfxStyleFamily nType; sal_uInt16 nHtmlMode; SwWrtShell* pWrtShell; bool bNewStyle; @@ -71,7 +71,7 @@ public: /// Identifies name of page to open at by default SwTemplateDlg( vcl::Window* pParent, SfxStyleSheetBase& rBase, - sal_uInt16 nRegion, + SfxStyleFamily nRegion, const OString& sPage = OString(), SwWrtShell* pActShell = nullptr, bool bNew = false ); diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx index 0ab4728b559f..68005354adce 100644 --- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx +++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx @@ -48,7 +48,7 @@ namespace { void renderPreview(sfx2::StyleManager* pStyleManager, OutputDevice& aOutputDevice, OUString const & sName, sal_Int32 nHeight, Rectangle& aRect) { - SfxStyleSheetBase* pStyleSheet = pStyleManager->Search(sName, SFX_STYLE_FAMILY_PARA); + SfxStyleSheetBase* pStyleSheet = pStyleManager->Search(sName, SfxStyleFamily::Para); if (pStyleSheet) { diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx index 2047c2aab5cb..8be3911e478d 100644 --- a/sw/source/uibase/sidebar/ThemePanel.cxx +++ b/sw/source/uibase/sidebar/ThemePanel.cxx @@ -359,7 +359,7 @@ void applyTheme(SfxStyleSheetBasePool* pPool, const OUString& sFontSetName, cons svx::ColorSet aColorSet = rColorSets.getColorSet(sColorSetName); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PARA); + pPool->SetSearchMask(SfxStyleFamily::Para); pStyle = static_cast<SwDocStyleSheet*>(pPool->First()); while (pStyle) @@ -378,7 +378,7 @@ void applyTheme(SfxStyleSheetBasePool* pPool, const OUString& sFontSetName, cons pStyle = static_cast<SwDocStyleSheet*>(pPool->Next()); } - pPool->SetSearchMask(SFX_STYLE_FAMILY_CHAR); + pPool->SetSearchMask(SfxStyleFamily::Char); pStyle = static_cast<SwDocStyleSheet*>(pPool->First()); while (pStyle) diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx index 8f4117809a2b..8ded8620e9dd 100644 --- a/sw/source/uibase/uiview/formatclipboard.cxx +++ b/sw/source/uibase/uiview/formatclipboard.cxx @@ -473,7 +473,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo if(!m_aCharStyle.isEmpty() && !bNoCharacterFormats ) { // look for the named text format in the pool - SwDocStyleSheet* pStyle = static_cast<SwDocStyleSheet*>(pPool->Find(m_aCharStyle, SFX_STYLE_FAMILY_CHAR)); + SwDocStyleSheet* pStyle = static_cast<SwDocStyleSheet*>(pPool->Find(m_aCharStyle, SfxStyleFamily::Char)); // if the style is found if( pStyle ) @@ -492,7 +492,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo if(!m_aParaStyle.isEmpty() && !bNoParagraphFormats ) { // look for the named pragraph format in the pool - SwDocStyleSheet* pStyle = static_cast<SwDocStyleSheet*>(pPool->Find(m_aParaStyle, SFX_STYLE_FAMILY_PARA)); + SwDocStyleSheet* pStyle = static_cast<SwDocStyleSheet*>(pPool->Find(m_aParaStyle, SfxStyleFamily::Para)); if( pStyle ) { // store the attributes from this style in aItemVector in order diff --git a/sw/source/uibase/uiview/viewcoll.cxx b/sw/source/uibase/uiview/viewcoll.cxx index 0dd49becfe7f..4380835251e5 100644 --- a/sw/source/uibase/uiview/viewcoll.cxx +++ b/sw/source/uibase/uiview/viewcoll.cxx @@ -55,7 +55,7 @@ void SwView::ExecColl(SfxRequest &rReq) SfxStringItem aName(SID_STYLE_APPLY, static_cast<const SfxStringItem*>(pItem)->GetValue()); SfxUInt16Item aFamItem( SID_STYLE_FAMILY, - SFX_STYLE_FAMILY_PAGE); + (sal_uInt16) SfxStyleFamily::Page); SwPtrItem aShell(FN_PARAM_WRTSHELL, GetWrtShellPtr()); SfxRequest aReq(SID_STYLE_APPLY, SfxCallMode::SLOT, GetPool()); aReq.AppendItem(aName); diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index 58012322104b..974999f9bc2e 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -914,7 +914,7 @@ void SwView::StateSearch(SfxItemSet &rSet) if ( !m_pSrchItem ) { m_pSrchItem = new SvxSearchItem( SID_SEARCH_ITEM ); - m_pSrchItem->SetFamily(SFX_STYLE_FAMILY_PARA); + m_pSrchItem->SetFamily(SfxStyleFamily::Para); m_pSrchItem->SetSearchString( m_pWrtShell->GetSelText() ); } diff --git a/sw/source/uibase/utlui/tmplctrl.cxx b/sw/source/uibase/utlui/tmplctrl.cxx index cb847c2243c5..6790276b5c57 100644 --- a/sw/source/uibase/utlui/tmplctrl.cxx +++ b/sw/source/uibase/utlui/tmplctrl.cxx @@ -104,7 +104,7 @@ void SwTemplateControl::Command( const CommandEvent& rCEvt ) { SfxStyleSheetBasePool* pPool = pView->GetDocShell()-> GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PAGE); + pPool->SetSearchMask(SfxStyleFamily::Page); if( pPool->Count() > 1 ) { sal_uInt16 nCount = 0; diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index 476cef8be0b2..fe0d61b004c8 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -707,7 +707,7 @@ void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, bool bSorted, bo { const sal_Int32 nOffset = rToFill.GetEntryCount() > 0 ? 1 : 0; SfxStyleSheetBasePool* pPool = pDocSh->GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_CHAR); + pPool->SetSearchMask(SfxStyleFamily::Char); SwDoc* pDoc = pDocSh->GetDoc(); const SfxStyleSheetBase* pBase = pPool->First(); OUString sStandard; diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index a31ca4e4cabf..56a5c1fdcf50 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -101,9 +101,9 @@ void SvXMLStyleContext::SetAttribute( sal_uInt16 nPrefixKey, if( IsXMLToken( rLocalName, XML_FAMILY ) ) { if( IsXMLToken( rValue, XML_PARAGRAPH ) ) - mnFamily = (sal_uInt16)SFX_STYLE_FAMILY_PARA; + mnFamily = (sal_uInt16)SfxStyleFamily::Para; else if( IsXMLToken( rValue, XML_TEXT ) ) - mnFamily = (sal_uInt16)SFX_STYLE_FAMILY_CHAR; + mnFamily = (sal_uInt16)SfxStyleFamily::Char; } else if( IsXMLToken( rLocalName, XML_NAME ) ) { |