summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-07 14:39:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-08 09:04:30 +0000
commit9cacb6ad9f5a012bc892cf9893cd8d37a2a5f304 (patch)
tree2823ae9c68c743ed658cae8b064fa91f9772007d /sw/source/uibase
parent145accd9a5b55070959d40c9314d870dffa5e4bc (diff)
convert SvxCaseMap to scoped enum
Change-Id: Iea77ddc21e9b2d5a021c08e323da9ccabf9d46bd Reviewed-on: https://gerrit.libreoffice.org/34963 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/config/modcfg.cxx19
-rw-r--r--sw/source/uibase/shells/txtattr.cxx12
2 files changed, 16 insertions, 15 deletions
diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx
index 1eb1cfb16617..5c96d41c2b9d 100644
--- a/sw/source/uibase/config/modcfg.cxx
+++ b/sw/source/uibase/config/modcfg.cxx
@@ -275,12 +275,13 @@ static sal_Int32 lcl_ConvertAttrToCfg(const AuthorCharAttr& rAttr)
case SID_ATTR_CHAR_STRIKEOUT: nRet = 3; break;
case SID_ATTR_CHAR_CASEMAP:
{
- switch(rAttr.nAttr)
+ switch((SvxCaseMap)rAttr.nAttr)
{
- case SVX_CASEMAP_VERSALIEN : nRet = 5;break;
- case SVX_CASEMAP_GEMEINE : nRet = 6;break;
- case SVX_CASEMAP_KAPITAELCHEN: nRet = 7;break;
- case SVX_CASEMAP_TITEL : nRet = 8;break;
+ case SvxCaseMap::Uppercase : nRet = 5;break;
+ case SvxCaseMap::Lowercase : nRet = 6;break;
+ case SvxCaseMap::SmallCaps : nRet = 7;break;
+ case SvxCaseMap::Capitalize: nRet = 8;break;
+ default: break;
}
}
break;
@@ -335,10 +336,10 @@ static void lcl_ConvertCfgToAttr(sal_Int32 nVal, AuthorCharAttr& rAttr, bool bDe
}
break;
case 4: rAttr.nItemId = SID_ATTR_CHAR_UNDERLINE;rAttr.nAttr = LINESTYLE_DOUBLE ; break;
- case 5: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = SVX_CASEMAP_VERSALIEN ; break;
- case 6: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = SVX_CASEMAP_GEMEINE ; break;
- case 7: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = SVX_CASEMAP_KAPITAELCHEN ; break;
- case 8: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = SVX_CASEMAP_TITEL ; break;
+ case 5: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = (sal_uInt16)SvxCaseMap::Uppercase; break;
+ case 6: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = (sal_uInt16)SvxCaseMap::Lowercase; break;
+ case 7: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = (sal_uInt16)SvxCaseMap::SmallCaps; break;
+ case 8: rAttr.nItemId = SID_ATTR_CHAR_CASEMAP; rAttr.nAttr = (sal_uInt16)SvxCaseMap::Capitalize; break;
case 9: rAttr.nItemId = SID_ATTR_BRUSH; break;
}
}
diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx
index 8ac5b0f90841..1de085853431 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -133,21 +133,21 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq)
case FN_SET_SMALL_CAPS:
{
- SvxCaseMap eCaseMap = SVX_CASEMAP_KAPITAELCHEN;
+ SvxCaseMap eCaseMap = SvxCaseMap::SmallCaps;
switch (eState)
{
case STATE_TOGGLE:
{
SvxCaseMap eTmpCaseMap = static_cast<const SvxCaseMapItem&>(aSet.Get(RES_CHRATR_CASEMAP)).GetCaseMap();
- if (eTmpCaseMap == SVX_CASEMAP_KAPITAELCHEN)
- eCaseMap = SVX_CASEMAP_NOT_MAPPED;
+ if (eTmpCaseMap == SvxCaseMap::SmallCaps)
+ eCaseMap = SvxCaseMap::NotMapped;
}
break;
case STATE_ON:
// Nothing to do, already set.
break;
case STATE_OFF:
- eCaseMap = SVX_CASEMAP_NOT_MAPPED;
+ eCaseMap = SvxCaseMap::NotMapped;
break;
}
SvxCaseMapItem aCaseMap(eCaseMap, RES_CHRATR_CASEMAP);
@@ -581,7 +581,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
nLineSpace = static_cast<const SvxLineSpacingItem* >(pItem)->GetPropLineSpace();
}
- SvxCaseMap eCaseMap = SVX_CASEMAP_NOT_MAPPED;
+ SvxCaseMap eCaseMap = SvxCaseMap::NotMapped;
eState = aCoreSet.GetItemState(RES_CHRATR_CASEMAP, false, &pItem);
if (eState == SfxItemState::DEFAULT)
pItem = &rPool.GetDefaultItem(RES_CHRATR_CASEMAP);
@@ -599,7 +599,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
bFlag = 0 > nEsc;
break;
case FN_SET_SMALL_CAPS:
- bFlag = eCaseMap == SVX_CASEMAP_KAPITAELCHEN;
+ bFlag = eCaseMap == SvxCaseMap::SmallCaps;
break;
case SID_ATTR_PARA_ADJUST_LEFT:
if (!bAdjustGood)