Kaydet (Commit) 7d2cf760 authored tarafından Noel Grandin's avatar Noel Grandin

convert XFormTextShadow to scoped enum

Change-Id: I1ff9d2f4aec60f050d9dde8e4c0e991169f585cd
üst 6e81c582
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
enum XFormTextStyle { XFT_ROTATE, XFT_UPRIGHT, XFT_SLANTX, XFT_SLANTY, enum XFormTextStyle { XFT_ROTATE, XFT_UPRIGHT, XFT_SLANTX, XFT_SLANTY,
XFT_NONE }; XFT_NONE };
enum XFormTextAdjust { XFT_LEFT, XFT_RIGHT, XFT_AUTOSIZE, XFT_CENTER }; enum XFormTextAdjust { XFT_LEFT, XFT_RIGHT, XFT_AUTOSIZE, XFT_CENTER };
enum XFormTextShadow { XFTSHADOW_NONE, XFTSHADOW_NORMAL, XFTSHADOW_SLANT}; enum class XFormTextShadow { NONE, Normal, Slant};
enum class XBitmapType { Import, N8x8 }; enum class XBitmapType { Import, N8x8 };
#endif // INCLUDED_SVX_XENUM_HXX #endif // INCLUDED_SVX_XENUM_HXX
......
...@@ -35,7 +35,7 @@ class SVX_DLLPUBLIC XFormTextShadowItem : public SfxEnumItem ...@@ -35,7 +35,7 @@ class SVX_DLLPUBLIC XFormTextShadowItem : public SfxEnumItem
public: public:
static SfxPoolItem* CreateDefault(); static SfxPoolItem* CreateDefault();
XFormTextShadowItem(XFormTextShadow = XFTSHADOW_NONE); XFormTextShadowItem(XFormTextShadow = XFormTextShadow::NONE);
XFormTextShadowItem(SvStream& rIn); XFormTextShadowItem(SvStream& rIn);
virtual SfxPoolItem* Clone(SfxItemPool* pPool = nullptr) const override; virtual SfxPoolItem* Clone(SfxItemPool* pPool = nullptr) const override;
virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const override; virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const override;
......
...@@ -471,7 +471,7 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem, ...@@ -471,7 +471,7 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
m_pTbxShadow->Enable(); m_pTbxShadow->Enable();
if ( pItem->GetValue() == XFTSHADOW_NONE ) if ( pItem->GetValue() == XFormTextShadow::NONE )
{ {
nId = nShadowOffId; nId = nShadowOffId;
m_pFbShadowX->Hide(); m_pFbShadowX->Hide();
...@@ -488,7 +488,7 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem, ...@@ -488,7 +488,7 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
m_pMtrFldShadowY->Enable(); m_pMtrFldShadowY->Enable();
m_pShadowColorLB->Enable(); m_pShadowColorLB->Enable();
if ( pItem->GetValue() == XFTSHADOW_NORMAL ) if ( pItem->GetValue() == XFormTextShadow::Normal )
{ {
nId = nShadowNormalId; nId = nShadowNormalId;
const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit(); const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit();
...@@ -708,7 +708,7 @@ IMPL_LINK_NOARG_TYPED(SvxFontWorkDialog, SelectShadowHdl_Impl, ToolBox *, void) ...@@ -708,7 +708,7 @@ IMPL_LINK_NOARG_TYPED(SvxFontWorkDialog, SelectShadowHdl_Impl, ToolBox *, void)
} }
else if (nId != nLastShadowTbxId) else if (nId != nLastShadowTbxId)
{ {
XFormTextShadow eShadow = XFTSHADOW_NONE; XFormTextShadow eShadow = XFormTextShadow::NONE;
if (nLastShadowTbxId == nShadowNormalId) if (nLastShadowTbxId == nShadowNormalId)
{ {
...@@ -722,8 +722,8 @@ IMPL_LINK_NOARG_TYPED(SvxFontWorkDialog, SelectShadowHdl_Impl, ToolBox *, void) ...@@ -722,8 +722,8 @@ IMPL_LINK_NOARG_TYPED(SvxFontWorkDialog, SelectShadowHdl_Impl, ToolBox *, void)
} }
nLastShadowTbxId = nId; nLastShadowTbxId = nId;
if ( nId == nShadowNormalId) eShadow = XFTSHADOW_NORMAL; if ( nId == nShadowNormalId) eShadow = XFormTextShadow::Normal;
else if (nId == nShadowSlantId) eShadow = XFTSHADOW_SLANT; else if (nId == nShadowSlantId) eShadow = XFormTextShadow::Slant;
XFormTextShadowItem aItem(eShadow); XFormTextShadowItem aItem(eShadow);
GetBindings().GetDispatcher()->ExecuteList(SID_FORMTEXT_SHADOW, GetBindings().GetDispatcher()->ExecuteList(SID_FORMTEXT_SHADOW,
......
...@@ -159,7 +159,7 @@ namespace drawinglayer ...@@ -159,7 +159,7 @@ namespace drawinglayer
Color maFormTextShdwColor; // shadow color Color maFormTextShdwColor; // shadow color
// outline attributes; used when getFormTextOutline() is true and (for // outline attributes; used when getFormTextOutline() is true and (for
// shadow) when getFormTextShadow() != XFTSHADOW_NONE // shadow) when getFormTextShadow() != XFormTextShadow::NONE
SdrFormTextOutlineAttribute maOutline; SdrFormTextOutlineAttribute maOutline;
SdrFormTextOutlineAttribute maShadowOutline; SdrFormTextOutlineAttribute maShadowOutline;
...@@ -195,7 +195,7 @@ namespace drawinglayer ...@@ -195,7 +195,7 @@ namespace drawinglayer
aLineAttribute, aStrokeAttribute, nTransparence); aLineAttribute, aStrokeAttribute, nTransparence);
} }
if(XFTSHADOW_NONE != getFormTextShadow()) if(XFormTextShadow::NONE != getFormTextShadow())
{ {
// also need to prepare attributes for shadow outlines // also need to prepare attributes for shadow outlines
const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet)); const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet));
...@@ -215,7 +215,7 @@ namespace drawinglayer ...@@ -215,7 +215,7 @@ namespace drawinglayer
mnFormTextShdwTransp(0), mnFormTextShdwTransp(0),
meFormTextStyle(XFT_NONE), meFormTextStyle(XFT_NONE),
meFormTextAdjust(XFT_CENTER), meFormTextAdjust(XFT_CENTER),
meFormTextShadow(XFTSHADOW_NONE), meFormTextShadow(XFormTextShadow::NONE),
maFormTextShdwColor(), maFormTextShdwColor(),
maOutline(), maOutline(),
maShadowOutline(), maShadowOutline(),
......
...@@ -737,7 +737,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI ...@@ -737,7 +737,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI
rIndent=2; rIndent=2;
if (ImpGetItem(*pSet,XATTR_FORMTXTSHADOW,pItem)) { if (ImpGetItem(*pSet,XATTR_FORMTXTSHADOW,pItem)) {
XFormTextShadow eShadow=static_cast<const XFormTextShadowItem*>(pItem)->GetValue(); XFormTextShadow eShadow=static_cast<const XFormTextShadowItem*>(pItem)->GetValue();
if (eShadow==XFTSHADOW_NONE) return true; if (eShadow==XFormTextShadow::NONE) return true;
} }
} }
} break; } break;
......
...@@ -380,17 +380,17 @@ namespace ...@@ -380,17 +380,17 @@ namespace
} }
// eventually create shadow primitives from aDecomposition and add to rDecomposition // eventually create shadow primitives from aDecomposition and add to rDecomposition
const bool bShadow(XFTSHADOW_NONE != maSdrFormTextAttribute.getFormTextShadow()); const bool bShadow(XFormTextShadow::NONE != maSdrFormTextAttribute.getFormTextShadow());
if(bShadow) if(bShadow)
{ {
if(XFTSHADOW_NORMAL == maSdrFormTextAttribute.getFormTextShadow()) if(XFormTextShadow::Normal == maSdrFormTextAttribute.getFormTextShadow())
{ {
aNewShadowTransform.translate( aNewShadowTransform.translate(
maSdrFormTextAttribute.getFormTextShdwXVal(), maSdrFormTextAttribute.getFormTextShdwXVal(),
-maSdrFormTextAttribute.getFormTextShdwYVal()); -maSdrFormTextAttribute.getFormTextShdwYVal());
} }
else // XFTSHADOW_SLANT else // XFormTextShadow::Slant
{ {
double fScaleValue(maSdrFormTextAttribute.getFormTextShdwYVal() / 100.0); double fScaleValue(maSdrFormTextAttribute.getFormTextShdwYVal() / 100.0);
double fShearValue(-maSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800); double fShearValue(-maSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800);
......
...@@ -688,9 +688,9 @@ static SvXMLEnumMapEntry const pXML_Fontwork_Adjust_Enum[] = ...@@ -688,9 +688,9 @@ static SvXMLEnumMapEntry const pXML_Fontwork_Adjust_Enum[] =
static SvXMLEnumMapEntry const pXML_Fontwork_Shadow_Enum[] = static SvXMLEnumMapEntry const pXML_Fontwork_Shadow_Enum[] =
{ {
{ XML_NORMAL, 0 }, //XFTSHADOW_NORMAL, { XML_NORMAL, 0 }, //XFormTextShadow::Normal,
{ XML_SLANT, 1 }, //XFTSHADOW_SLANT, { XML_SLANT, 1 }, //XFormTextShadow::Slant,
{ XML_NONE, 2 }, //XFTSHADOW_NONE { XML_NONE, 2 }, //XFormTextShadow::NONE
{ XML_TOKEN_INVALID,0 } { XML_TOKEN_INVALID,0 }
}; };
......
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