summaryrefslogtreecommitdiff
path: root/sd/source
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 /sd/source
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 'sd/source')
-rw-r--r--sd/source/core/drawdoc3.cxx4
-rw-r--r--sd/source/filter/ppt/pptin.cxx2
-rw-r--r--sd/source/ui/app/res_bmp.src4
-rw-r--r--sd/source/ui/docshell/docshell.cxx2
-rw-r--r--sd/source/ui/func/futempl.cxx22
-rw-r--r--sd/source/ui/inc/DrawDocShell.hxx6
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx2
-rw-r--r--sd/source/ui/view/drviewse.cxx2
-rw-r--r--sd/source/ui/view/outlnvsh.cxx2
-rw-r--r--sd/source/ui/view/viewshe3.cxx4
10 files changed, 24 insertions, 26 deletions
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());
}
}
}