diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-18 12:14:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-19 08:35:42 +0200 |
commit | 0035573ee7798cdf54ef44a54306a0515eeb90a7 (patch) | |
tree | 29f89470e725120dbb6378a64ab0bf01970ecf89 /sd | |
parent | 694f3ed0825d75bf855a74b2294ba0ff370afbb6 (diff) |
convert SFXSTYLEBIT to scoped enum
drop SFXSTYLEBIT_HIERARCHY because it has no overlap with these values,
it's used an extra bit in
SfxCommonTemplateDialog_Impl::LoadFactoryStyleFilter
Change-Id: I8ee5ecb9b5f8d2087d8eedd1f5526260ec1e4018
Reviewed-on: https://gerrit.libreoffice.org/53089
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/inc/family.hrc | 20 | ||||
-rw-r--r-- | sd/inc/stlpool.hxx | 2 | ||||
-rw-r--r-- | sd/inc/stlsheet.hxx | 2 | ||||
-rw-r--r-- | sd/qa/unit/misc-tests.cxx | 4 | ||||
-rw-r--r-- | sd/source/core/drawdoc4.cxx | 6 | ||||
-rw-r--r-- | sd/source/core/stlpool.cxx | 6 | ||||
-rw-r--r-- | sd/source/core/stlsheet.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/func/futempl.cxx | 14 |
8 files changed, 31 insertions, 31 deletions
diff --git a/sd/inc/family.hrc b/sd/inc/family.hrc index b89c241af0a6..2d10e42b7305 100644 --- a/sd/inc/family.hrc +++ b/sd/inc/family.hrc @@ -24,20 +24,20 @@ #define NC_(Context, String) (Context "\004" u8##String) -const std::pair<const char*, int> RID_GRAPHICSTYLEFAMILY[] = +const std::pair<const char*, SfxStyleSearchBits> RID_GRAPHICSTYLEFAMILY[] = { - { NC_("RID_GRAPHICSTYLEFAMILY", "All Styles") , SFXSTYLEBIT_ALL_VISIBLE }, - { NC_("RID_GRAPHICSTYLEFAMILY", "Hidden Styles") , SFXSTYLEBIT_HIDDEN }, - { NC_("RID_GRAPHICSTYLEFAMILY", "Applied Styles") , SFXSTYLEBIT_USED }, - { NC_("RID_GRAPHICSTYLEFAMILY", "Custom Styles") , SFXSTYLEBIT_USERDEF }, - { nullptr, 0 } + { NC_("RID_GRAPHICSTYLEFAMILY", "All Styles") , SfxStyleSearchBits::AllVisible }, + { NC_("RID_GRAPHICSTYLEFAMILY", "Hidden Styles") , SfxStyleSearchBits::Hidden }, + { NC_("RID_GRAPHICSTYLEFAMILY", "Applied Styles") , SfxStyleSearchBits::Used }, + { NC_("RID_GRAPHICSTYLEFAMILY", "Custom Styles") , SfxStyleSearchBits::UserDefined }, + { nullptr, SfxStyleSearchBits::Auto } }; -const std::pair<const char*, int> RID_PRESENTATIONSTYLEFAMILY[] = +const std::pair<const char*, SfxStyleSearchBits> RID_PRESENTATIONSTYLEFAMILY[] = { - { NC_("RID_PRESENTATIONSTYLEFAMILY", "All Styles") , SFXSTYLEBIT_ALL_VISIBLE }, - { NC_("RID_PRESENTATIONSTYLEFAMILY", "Hidden Styles") , SFXSTYLEBIT_HIDDEN }, - { nullptr, 0 } + { NC_("RID_PRESENTATIONSTYLEFAMILY", "All Styles") , SfxStyleSearchBits::AllVisible }, + { NC_("RID_PRESENTATIONSTYLEFAMILY", "Hidden Styles") , SfxStyleSearchBits::Hidden }, + { nullptr, SfxStyleSearchBits::Auto } }; #endif diff --git a/sd/inc/stlpool.hxx b/sd/inc/stlpool.hxx index b46748615b90..506d4d47eb11 100644 --- a/sd/inc/stlpool.hxx +++ b/sd/inc/stlpool.hxx @@ -126,7 +126,7 @@ private: void CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, SdStyleSheetVector& rCreatedSheets ); void CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily, SdStyleSheetVector& rCreatedSheets, const OUString &rRenameSuffix ); - virtual SfxStyleSheetBase* Create(const OUString& rName, SfxStyleFamily eFamily, sal_uInt16 nMask) override; + virtual SfxStyleSheetBase* Create(const OUString& rName, SfxStyleFamily eFamily, SfxStyleSearchBits nMask) override; using SfxStyleSheetPool::Create; virtual ~SdStyleSheetPool() override; diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx index 314818a21b3e..b6b1d599a71c 100644 --- a/sd/inc/stlsheet.hxx +++ b/sd/inc/stlsheet.hxx @@ -53,7 +53,7 @@ typedef cppu::ImplInheritanceHelper< SfxUnoStyleSheet, class SdStyleSheet final : public SdStyleSheetBase, private ::cppu::BaseMutex { public: - SdStyleSheet( const OUString& rDisplayName, SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily, sal_uInt16 nMask ); + SdStyleSheet( const OUString& rDisplayName, SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily, SfxStyleSearchBits nMask ); virtual bool SetParent (const OUString& rParentName) override; virtual SfxItemSet& GetItemSet() override; diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx index 1e2645cd05a8..9125f2306bad 100644 --- a/sd/qa/unit/misc-tests.cxx +++ b/sd/qa/unit/misc-tests.cxx @@ -309,11 +309,11 @@ void SdMiscTest::testTdf44774() SfxStyleSheetBasePool* pSSPool = xDocShRef->GetStyleSheetPool(); // Create a new style with an empty name, like what happens in UI when creating a new style - SfxStyleSheetBase& rStyleA = pSSPool->Make("", SfxStyleFamily::Para, SFXSTYLEBIT_USERDEF); + SfxStyleSheetBase& rStyleA = pSSPool->Make("", SfxStyleFamily::Para, SfxStyleSearchBits::UserDefined); // Assign a new name, which does not yet set its ApiName rStyleA.SetName("StyleA"); // Create another style - SfxStyleSheetBase& rStyleB = pSSPool->Make("StyleB", SfxStyleFamily::Para, SFXSTYLEBIT_USERDEF); + SfxStyleSheetBase& rStyleB = pSSPool->Make("StyleB", SfxStyleFamily::Para, SfxStyleSearchBits::UserDefined); // ... and set its parent to the first one rStyleB.SetParent("StyleA"); diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 72109415af6d..6f6e7ada56ac 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -130,7 +130,7 @@ void SdDrawDocument::CreateLayoutTemplates() // Default style - sal_uInt16 nMask = SFXSTYLEBIT_AUTO; + SfxStyleSearchBits nMask = SfxStyleSearchBits::Auto; OUString aName(aStdName); pSheet = &(pSSPool->Make(aName, SfxStyleFamily::Para, nMask)); @@ -492,7 +492,7 @@ void SdDrawDocument::CreateLayoutTemplates() static Any implMakeSolidCellStyle( SdStyleSheetPool* pSSPool, const OUString& rName, const OUString& rParent, const Color& rColor ) { - SfxStyleSheetBase* pSheet = &(pSSPool->Make(rName, SfxStyleFamily::Frame, SFXSTYLEBIT_AUTO)); + SfxStyleSheetBase* pSheet = &(pSSPool->Make(rName, SfxStyleFamily::Frame, SfxStyleSearchBits::Auto)); pSheet->SetParent(rParent); SfxItemSet* pISet = &pSheet->GetItemSet(); pISet->Put(XFillStyleItem(drawing::FillStyle_SOLID)); @@ -537,7 +537,7 @@ void SdDrawDocument::CreateDefaultCellStyles() OUString aDefaultCellStyleName( "default" ); - pSheet = &(pSSPool->Make(aDefaultCellStyleName, SfxStyleFamily::Frame, SFXSTYLEBIT_AUTO)); + pSheet = &(pSSPool->Make(aDefaultCellStyleName, SfxStyleFamily::Frame, SfxStyleSearchBits::Auto)); pSheet->SetHelpId( OUString(), HID_SD_CELL_STYLE_DEFAULT ); SfxItemSet& rISet = pSheet->GetItemSet(); diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 6a25bb423751..8580b10f82ee 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -135,7 +135,7 @@ SdStyleSheetPool::~SdStyleSheetPool() DBG_ASSERT( mpDoc == nullptr, "sd::SdStyleSheetPool::~SdStyleSheetPool(), dispose me first!" ); } -SfxStyleSheetBase* SdStyleSheetPool::Create(const OUString& rName, SfxStyleFamily eFamily, sal_uInt16 _nMask ) +SfxStyleSheetBase* SdStyleSheetPool::Create(const OUString& rName, SfxStyleFamily eFamily, SfxStyleSearchBits _nMask ) { return new SdStyleSheet(rName, *this, eFamily, _nMask); } @@ -180,7 +180,7 @@ void SdStyleSheetPool::CreateOutlineSheetList (const OUString& rLayoutName, std: void SdStyleSheetPool::CreateLayoutStyleSheets(const OUString& rLayoutName, bool bCheck /*= sal_False*/ ) { - const sal_uInt16 nUsedMask = SFXSTYLEBIT_ALL & ~SFXSTYLEBIT_USERDEF; + const SfxStyleSearchBits nUsedMask = SfxStyleSearchBits::All & ~SfxStyleSearchBits::UserDefined; bool bCreated = false; @@ -840,7 +840,7 @@ void SdStyleSheetPool::CreatePseudosIfNecessary() SfxStyleSheetBase* pSheet = nullptr; SfxStyleSheetBase* pParent = nullptr; - sal_uInt16 nUsedMask = SFXSTYLEBIT_USED; + SfxStyleSearchBits nUsedMask = SfxStyleSearchBits::Used; aName = SdResId(STR_PSEUDOSHEET_TITLE); if( (pSheet = Find(aName, SfxStyleFamily::Pseudo)) == nullptr ) diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 012546b6b7e2..428f70b1c952 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -129,7 +129,7 @@ void ModifyListenerForewarder::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& /* mpStyleSheet->notifyModifyListener(); } -SdStyleSheet::SdStyleSheet(const OUString& rDisplayName, SfxStyleSheetBasePool& _rPool, SfxStyleFamily eFamily, sal_uInt16 _nMask) +SdStyleSheet::SdStyleSheet(const OUString& rDisplayName, SfxStyleSheetBasePool& _rPool, SfxStyleFamily eFamily, SfxStyleSearchBits _nMask) : SdStyleSheetBase( rDisplayName, _rPool, eFamily, _nMask) , ::cppu::BaseMutex() , msApiName( rDisplayName ) @@ -162,10 +162,10 @@ void SdStyleSheet::Load (SvStream& rIn, sal_uInt16 nVersion) SfxStyleSheetBase::Load(rIn, nVersion); /* previously, the default mask was 0xAFFE. The needed flags were masked - from this mask. Now the flag SFXSTYLEBIT_READONLY was introduced and with + from this mask. Now the flag SfxStyleSearchBits::ReadOnly was introduced and with this, all style sheets are read only. Since no style sheet should be read only in Draw, we reset the flag here. */ - nMask &= ~SFXSTYLEBIT_READONLY; + nMask &= ~SfxStyleSearchBits::ReadOnly; } bool SdStyleSheet::SetParent(const OUString& rParentName) @@ -661,7 +661,7 @@ SdStyleSheet* SdStyleSheet::CreateEmptyUserStyle( SfxStyleSheetBasePool& rPool, } while( rPool.Find( aName, eFamily ) != nullptr ); - return new SdStyleSheet(aName, rPool, eFamily, SFXSTYLEBIT_USERDEF); + return new SdStyleSheet(aName, rPool, eFamily, SfxStyleSearchBits::UserDefined); } // XInterface diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index 4264391a78e6..7402a939c813 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -119,7 +119,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) } OUString aStyleName; - sal_uInt16 nRetMask = SFXSTYLEBIT_ALL; + sal_uInt16 nRetMask = static_cast<sal_uInt16>(SfxStyleSearchBits::All); switch( nSId ) { @@ -167,7 +167,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) pSSPool->Remove(p); p = nullptr; } - pStyleSheet = &pSSPool->Make( aStyleName, nFamily, SFXSTYLEBIT_USERDEF ); + pStyleSheet = &pSSPool->Make( aStyleName, nFamily, SfxStyleSearchBits::UserDefined ); if (pArgs && pArgs->GetItemState(SID_STYLE_REFERENCE) == SfxItemState::SET) { @@ -190,7 +190,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) pSSPool->Remove(p); p = nullptr; } - pStyleSheet = &pSSPool->Make( aStyleName, nFamily, SFXSTYLEBIT_USERDEF ); + pStyleSheet = &pSSPool->Make( aStyleName, nFamily, SfxStyleSearchBits::UserDefined ); pStyleSheet->SetParent(SdResId(STR_STANDARD_STYLESHEET_NAME)); } break; @@ -382,7 +382,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) { case RET_OK: { - nRetMask = pStyleSheet->GetMask(); + nRetMask = static_cast<sal_uInt16>(pStyleSheet->GetMask()); if (eFamily == SfxStyleFamily::Pseudo) { @@ -568,7 +568,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) { if( pStyleSheet ) { - nRetMask = pStyleSheet->GetMask(); + nRetMask = static_cast<sal_uInt16>(pStyleSheet->GetMask()); SfxItemSet aCoreSet( mpDoc->GetPool() ); mpView->GetAttributes( aCoreSet, true ); @@ -612,7 +612,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if( pStyleSheet ) { - nRetMask = pStyleSheet->GetMask(); + nRetMask = static_cast<sal_uInt16>(pStyleSheet->GetMask()); SfxItemSet aCoreSet( mpDoc->GetPool() ); mpView->GetAttributes( aCoreSet ); @@ -630,7 +630,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) break; } - if( nRetMask != SFXSTYLEBIT_ALL ) + if( nRetMask != static_cast<sal_uInt16>(SfxStyleSearchBits::All) ) rReq.SetReturnValue( SfxUInt16Item( nSId, nRetMask ) ); } |