summaryrefslogtreecommitdiff
path: root/sw/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 /sw/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 'sw/source')
-rw-r--r--sw/source/core/doc/docdesc.cxx4
-rw-r--r--sw/source/core/doc/docfmt.cxx22
-rw-r--r--sw/source/core/doc/docnum.cxx6
-rw-r--r--sw/source/core/txtnode/fntcache.cxx2
-rw-r--r--sw/source/core/unocore/SwXTextDefaults.cxx2
-rw-r--r--sw/source/core/unocore/unocoll.cxx12
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx4
-rw-r--r--sw/source/core/unocore/unoframe.cxx6
-rw-r--r--sw/source/core/unocore/unoobj.cxx6
-rw-r--r--sw/source/core/unocore/unosett.cxx8
-rw-r--r--sw/source/core/unocore/unostyle.cxx128
-rw-r--r--sw/source/filter/xml/swxml.cxx8
-rw-r--r--sw/source/filter/xml/xmlfmt.cxx14
-rw-r--r--sw/source/filter/xml/xmlimp.cxx18
-rw-r--r--sw/source/filter/xml/xmlimp.hxx14
-rw-r--r--sw/source/ui/app/app.src10
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx6
-rw-r--r--sw/source/ui/chrdlg/pardlg.cxx4
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx6
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx2
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx2
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx2
-rw-r--r--sw/source/ui/fmtui/tmpdlg.cxx38
-rw-r--r--sw/source/ui/index/cnttab.cxx4
-rw-r--r--sw/source/ui/misc/docfnote.cxx6
-rw-r--r--sw/source/ui/misc/linenum.cxx8
-rw-r--r--sw/source/ui/misc/outline.cxx4
-rw-r--r--sw/source/uibase/app/docst.cxx160
-rw-r--r--sw/source/uibase/app/docstyle.cxx312
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx15
-rw-r--r--sw/source/uibase/inc/numpara.hxx2
-rw-r--r--sw/source/uibase/inc/tmpdlg.hxx4
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.cxx2
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.cxx4
-rw-r--r--sw/source/uibase/uiview/formatclipboard.cxx4
-rw-r--r--sw/source/uibase/uiview/viewcoll.cxx2
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx2
-rw-r--r--sw/source/uibase/utlui/tmplctrl.cxx2
-rw-r--r--sw/source/uibase/utlui/uitool.cxx2
39 files changed, 436 insertions, 421 deletions
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;