Kaydet (Commit) 69c29c9f authored tarafından Noel Grandin's avatar Noel Grandin

convert eNBOType constants to scoped enum

and remove unused constants, which means we can remove the
GraphicBulletsTypeMgr and MixBulletsTypeMgr classes

Change-Id: I395691b48987543355379708e2c60d0de438d72c
üst 594c2b98
...@@ -30,15 +30,10 @@ namespace svx { namespace sidebar { ...@@ -30,15 +30,10 @@ namespace svx { namespace sidebar {
#define DEFAULT_NUM_VALUSET_COUNT 8 #define DEFAULT_NUM_VALUSET_COUNT 8
#define DEFAULT_NUMBERING_CACHE_FORMAT_VERSION 0x10 #define DEFAULT_NUMBERING_CACHE_FORMAT_VERSION 0x10
typedef sal_uInt16 NBOType; enum class NBOType
namespace eNBOType
{ {
const NBOType BULLETS = 0x01; Bullets = 1, Numbering, Outline
const NBOType GRAPHICBULLETS = 0x02; };
const NBOType NUMBERING = 0x03;
const NBOType OUTLINE = 0x04;
const NBOType MIXBULLETS = 0x05;
}
enum class NBType enum class NBType
{ {
...@@ -240,48 +235,6 @@ class SVX_DLLPUBLIC BulletsTypeMgr: public NBOTypeMgrBase ...@@ -240,48 +235,6 @@ class SVX_DLLPUBLIC BulletsTypeMgr: public NBOTypeMgrBase
static BulletsTypeMgr& GetInstance(); static BulletsTypeMgr& GetInstance();
}; };
class SVX_DLLPUBLIC GraphicBulletsTypeMgr: public NBOTypeMgrBase
{
friend class OutlineTypeMgr;
friend class NumberingTypeMgr;
private:
GraphicBulletsTypeMgr(const GraphicBulletsTypeMgr&) = delete;
public:
typedef std::vector<GrfBulDataRelation*> ListType;
ListType aGrfDataLst;
public:
GraphicBulletsTypeMgr();
virtual ~GraphicBulletsTypeMgr() override;
virtual void Init() override;
virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) override;
virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel) override;
virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override;
virtual OUString GetDescription(sal_uInt16 nIndex,bool isDefault=false) override;
virtual bool IsCustomized(sal_uInt16 nIndex) override;
OUString GetGrfName(sal_uInt16 nIndex);
static GraphicBulletsTypeMgr& GetInstance();
};
class SVX_DLLPUBLIC MixBulletsTypeMgr: public NBOTypeMgrBase
{
friend class OutlineTypeMgr;
friend class NumberingTypeMgr;
private:
MixBulletsTypeMgr(const MixBulletsTypeMgr&) = delete;
public:
static MixBulletsSettings_Impl* pActualBullets[DEFAULT_BULLET_TYPES];
static MixBulletsSettings_Impl* pDefaultActualBullets[DEFAULT_BULLET_TYPES];
public:
MixBulletsTypeMgr();
virtual ~MixBulletsTypeMgr() override {}
virtual void Init() override;
virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) override;
virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel) override;
virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override;
virtual OUString GetDescription(sal_uInt16 nIndex,bool isDefault=false) override;
virtual bool IsCustomized(sal_uInt16 nIndex) override;
static MixBulletsTypeMgr& GetInstance();
};
class SVX_DLLPUBLIC NumberingTypeMgr: public NBOTypeMgrBase class SVX_DLLPUBLIC NumberingTypeMgr: public NBOTypeMgrBase
{ {
......
...@@ -199,7 +199,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq) ...@@ -199,7 +199,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq)
// get numbering rule corresponding to <nIdx> and apply the needed number formats to <pNumRule> // get numbering rule corresponding to <nIdx> and apply the needed number formats to <pNumRule>
NBOTypeMgrBase* pNumRuleMgr = NBOTypeMgrBase* pNumRuleMgr =
NBOutlineTypeMgrFact::CreateInstance( NBOutlineTypeMgrFact::CreateInstance(
nSId == FN_SVX_SET_BULLET ? eNBOType::BULLETS : eNBOType::NUMBERING ); nSId == FN_SVX_SET_BULLET ? NBOType::Bullets : NBOType::Numbering );
if ( pNumRuleMgr ) if ( pNumRuleMgr )
{ {
sal_uInt16 nActNumLvl = (sal_uInt16)0xFFFF; sal_uInt16 nActNumLvl = (sal_uInt16)0xFFFF;
......
...@@ -618,7 +618,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) ...@@ -618,7 +618,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,(sal_uInt16)0xFFFF)); rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,(sal_uInt16)0xFFFF));
if ( bBullets ) if ( bBullets )
{ {
NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(eNBOType::BULLETS); NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(NBOType::Bullets);
if ( pBullets ) if ( pBullets )
{ {
sal_uInt16 nBulIndex = pBullets->GetNBOIndexForNumRule(*pNumRule,nActNumLvl); sal_uInt16 nBulIndex = pBullets->GetNBOIndexForNumRule(*pNumRule,nActNumLvl);
...@@ -626,7 +626,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) ...@@ -626,7 +626,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
} }
}else }else
{ {
NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(eNBOType::NUMBERING); NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(NBOType::Numbering);
if ( pNumbering ) if ( pNumbering )
{ {
sal_uInt16 nBulIndex = pNumbering->GetNBOIndexForNumRule(*pNumRule,nActNumLvl); sal_uInt16 nBulIndex = pNumbering->GetNBOIndexForNumRule(*pNumRule,nActNumLvl);
......
This diff is collapsed.
...@@ -23,24 +23,15 @@ namespace svx { namespace sidebar { namespace NBOutlineTypeMgrFact { ...@@ -23,24 +23,15 @@ namespace svx { namespace sidebar { namespace NBOutlineTypeMgrFact {
NBOTypeMgrBase* CreateInstance(const NBOType aType) NBOTypeMgrBase* CreateInstance(const NBOType aType)
{ {
//NBOTypeMgrBase* pRet= 0; if ( aType == NBOType::Bullets )
if ( aType == eNBOType::BULLETS )
{ {
return &BulletsTypeMgr::GetInstance(); return &BulletsTypeMgr::GetInstance();
} }
else if ( aType == eNBOType::GRAPHICBULLETS ) else if ( aType == NBOType::Numbering )
{
return &GraphicBulletsTypeMgr::GetInstance();
}
else if ( aType == eNBOType::MIXBULLETS )
{
return &MixBulletsTypeMgr::GetInstance();
}
else if ( aType == eNBOType::NUMBERING )
{ {
return &NumberingTypeMgr::GetInstance(); return &NumberingTypeMgr::GetInstance();
} }
else if ( aType == eNBOType::OUTLINE ) else if ( aType == NBOType::Outline )
{ {
return &OutlineTypeMgr::GetInstance(); return &OutlineTypeMgr::GetInstance();
} }
......
...@@ -1844,7 +1844,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) ...@@ -1844,7 +1844,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
{ {
rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX, USHRT_MAX)); rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX, USHRT_MAX));
rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX, USHRT_MAX)); rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX, USHRT_MAX));
NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(eNBOType::BULLETS); NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(NBOType::Bullets);
if ( pBullets ) if ( pBullets )
{ {
const sal_uInt16 nBulIndex = pBullets->GetNBOIndexForNumRule(aSvxRule,nActNumLvl); const sal_uInt16 nBulIndex = pBullets->GetNBOIndexForNumRule(aSvxRule,nActNumLvl);
...@@ -1854,7 +1854,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) ...@@ -1854,7 +1854,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
{ {
rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX, USHRT_MAX)); rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX, USHRT_MAX));
rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX, USHRT_MAX)); rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX, USHRT_MAX));
NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(eNBOType::NUMBERING); NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(NBOType::Numbering);
if ( pNumbering ) if ( pNumbering )
{ {
const sal_uInt16 nBulIndex = pNumbering->GetNBOIndexForNumRule(aSvxRule,nActNumLvl); const sal_uInt16 nBulIndex = pNumbering->GetNBOIndexForNumRule(aSvxRule,nActNumLvl);
...@@ -1865,7 +1865,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) ...@@ -1865,7 +1865,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
if ( nWhich == FN_OUTLINE_RULE_INDEX ) if ( nWhich == FN_OUTLINE_RULE_INDEX )
{ {
rSet.Put(SfxUInt16Item(FN_OUTLINE_RULE_INDEX, USHRT_MAX)); rSet.Put(SfxUInt16Item(FN_OUTLINE_RULE_INDEX, USHRT_MAX));
NBOTypeMgrBase* pOutline = NBOutlineTypeMgrFact::CreateInstance(eNBOType::OUTLINE); NBOTypeMgrBase* pOutline = NBOutlineTypeMgrFact::CreateInstance(NBOType::Outline);
if ( pOutline ) if ( pOutline )
{ {
const sal_uInt16 nIndex = pOutline->GetNBOIndexForNumRule(aSvxRule,nActNumLvl); const sal_uInt16 nIndex = pOutline->GetNBOIndexForNumRule(aSvxRule,nActNumLvl);
......
...@@ -252,11 +252,11 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq) ...@@ -252,11 +252,11 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq)
if ( pItem != nullptr ) if ( pItem != nullptr )
{ {
const sal_uInt16 nChoosenItemIdx = pItem->GetValue(); const sal_uInt16 nChoosenItemIdx = pItem->GetValue();
sal_uInt16 nNBOType = svx::sidebar::eNBOType::BULLETS; svx::sidebar::NBOType nNBOType = svx::sidebar::NBOType::Bullets;
if ( nSlot == FN_SVX_SET_NUMBER ) if ( nSlot == FN_SVX_SET_NUMBER )
nNBOType = svx::sidebar::eNBOType::NUMBERING; nNBOType = svx::sidebar::NBOType::Numbering;
else if ( nSlot == FN_SVX_SET_OUTLINE ) else if ( nSlot == FN_SVX_SET_OUTLINE )
nNBOType = svx::sidebar::eNBOType::OUTLINE; nNBOType = svx::sidebar::NBOType::Outline;
svx::sidebar::NBOTypeMgrBase* pNBOTypeMgr = svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( nNBOType ); svx::sidebar::NBOTypeMgrBase* pNBOTypeMgr = svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( nNBOType );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment