summaryrefslogtreecommitdiff
path: root/svl/source/items
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-04 11:31:33 +0200
committerNoel Grandin <noel@peralex.com>2016-05-09 10:17:13 +0200
commitbcb41235deaf4b7ca90522bda3ba21a686819e6e (patch)
tree29f397deeb5c776b290b782847a4f9ec8487adb2 /svl/source/items
parentb55b7a057f19521ad88fc6a274fcf071b798eb3e (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
Diffstat (limited to 'svl/source/items')
-rw-r--r--svl/source/items/IndexedStyleSheets.cxx15
-rw-r--r--svl/source/items/srchitem.cxx2
-rw-r--r--svl/source/items/style.cxx8
3 files changed, 13 insertions, 12 deletions
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 ) );