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 /svx | |
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
Diffstat (limited to 'svx')
-rw-r--r-- | svx/qa/unit/svdraw/test_SdrTextObject.cxx | 10 | ||||
-rwxr-xr-x | svx/source/dialog/srchdlg.cxx | 10 | ||||
-rw-r--r-- | svx/source/sdr/properties/attributeproperties.cxx | 2 | ||||
-rw-r--r-- | svx/source/styles/CommonStylePreviewRenderer.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/cell.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/tablecontroller.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 14 |
8 files changed, 22 insertions, 22 deletions
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, |