diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-17 13:49:16 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-18 08:49:02 +0200 |
commit | 4a4c1bf4423a8b426c56c8d2b7013d6b5109309e (patch) | |
tree | 979f603a4f19373cb7e0abead4094c196010c927 | |
parent | a43de3d55bccfd8312dfcafbd387f3e8c7d1c633 (diff) |
convert XFormTextStyle to scoped enum
Change-Id: I88facbbbe262d9e26d2b45703c4f05c71bf51479
-rw-r--r-- | include/svx/xenum.hxx | 3 | ||||
-rw-r--r-- | include/svx/xtextit0.hxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/fontwork.cxx | 20 | ||||
-rw-r--r-- | svx/source/sdr/attribute/sdrformtextattribute.cxx | 2 | ||||
-rw-r--r-- | svx/source/sdr/attribute/sdrtextattribute.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdibrow.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdotextpathdecomposition.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/draw/sdpropls.cxx | 12 |
9 files changed, 27 insertions, 28 deletions
diff --git a/include/svx/xenum.hxx b/include/svx/xenum.hxx index cc5bb74e8f7d..c17551586f28 100644 --- a/include/svx/xenum.hxx +++ b/include/svx/xenum.hxx @@ -21,8 +21,7 @@ #define INCLUDED_SVX_XENUM_HXX -enum XFormTextStyle { XFT_ROTATE, XFT_UPRIGHT, XFT_SLANTX, XFT_SLANTY, - XFT_NONE }; +enum class XFormTextStyle { Rotate, Upright, SlantX, SlantY, NONE }; enum class XFormTextAdjust { Left, Right, AutoSize, Center }; enum class XFormTextShadow { NONE, Normal, Slant }; enum class XBitmapType { Import, N8x8 }; diff --git a/include/svx/xtextit0.hxx b/include/svx/xtextit0.hxx index dc9885ccba9d..5cdc3774752d 100644 --- a/include/svx/xtextit0.hxx +++ b/include/svx/xtextit0.hxx @@ -34,7 +34,7 @@ class SVX_DLLPUBLIC XFormTextStyleItem : public SfxEnumItem { public: static SfxPoolItem* CreateDefault(); - XFormTextStyleItem(XFormTextStyle = XFT_NONE); + XFormTextStyleItem(XFormTextStyle = XFormTextStyle::NONE); XFormTextStyleItem(SvStream& rIn); virtual SfxPoolItem* Clone(SfxItemPool* pPool = nullptr) const override; virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const override; diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx index 3c20641fd531..df0d257faf03 100644 --- a/svx/source/dialog/fontwork.cxx +++ b/svx/source/dialog/fontwork.cxx @@ -346,16 +346,16 @@ void SvxFontWorkDialog::SetStyle_Impl(const XFormTextStyleItem* pItem) switch ( pItem->GetValue() ) { - case XFT_ROTATE : nId = nStyleRotateId; break; - case XFT_UPRIGHT: nId = nStyleUprightId; break; - case XFT_SLANTX : nId = nStyleSlantXId; break; - case XFT_SLANTY : nId = nStyleSlantYId; break; + case XFormTextStyle::Rotate : nId = nStyleRotateId; break; + case XFormTextStyle::Upright: nId = nStyleUprightId; break; + case XFormTextStyle::SlantX : nId = nStyleSlantXId; break; + case XFormTextStyle::SlantY : nId = nStyleSlantYId; break; default: ;//prevent warning } m_pTbxStyle->Enable(); // Make sure that there is always exactly one checked toolbox item. - if ( pItem->GetValue() == XFT_NONE ) + if ( pItem->GetValue() == XFormTextStyle::NONE ) { m_pTbxStyle->CheckItem(nStyleRotateId, false); m_pTbxStyle->CheckItem(nStyleUprightId, false); @@ -642,16 +642,16 @@ IMPL_LINK_NOARG_TYPED(SvxFontWorkDialog, SelectStyleHdl_Impl, ToolBox *, void) // enabled that is.) if (nId == nStyleOffId || nId != nLastStyleTbxId ) { - XFormTextStyle eStyle = XFT_NONE; + XFormTextStyle eStyle = XFormTextStyle::NONE; if (nId == nStyleRotateId) - eStyle = XFT_ROTATE; + eStyle = XFormTextStyle::Rotate; else if (nId == nStyleUprightId) - eStyle = XFT_UPRIGHT; + eStyle = XFormTextStyle::Upright; else if (nId == nStyleSlantXId) - eStyle = XFT_SLANTX; + eStyle = XFormTextStyle::SlantX; else if (nId == nStyleSlantYId) - eStyle = XFT_SLANTY; + eStyle = XFormTextStyle::SlantY; XFormTextStyleItem aItem( eStyle ); GetBindings().GetDispatcher()->ExecuteList(SID_FORMTEXT_STYLE, diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx index 44607a05dc8c..b960efef6d8c 100644 --- a/svx/source/sdr/attribute/sdrformtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx @@ -213,7 +213,7 @@ namespace drawinglayer mnFormTextShdwXVal(0), mnFormTextShdwYVal(0), mnFormTextShdwTransp(0), - meFormTextStyle(XFT_NONE), + meFormTextStyle(XFormTextStyle::NONE), meFormTextAdjust(XFormTextAdjust::Center), meFormTextShadow(XFormTextShadow::NONE), maFormTextShdwColor(), diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index 4ff9225970ac..76f47517c365 100644 --- a/svx/source/sdr/attribute/sdrtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrtextattribute.cxx @@ -114,7 +114,7 @@ namespace drawinglayer { if(pSdrText) { - if(XFT_NONE != eFormTextStyle) + if(XFormTextStyle::NONE != eFormTextStyle) { // text on path. Create FormText attribute const SfxItemSet& rSet = pSdrText->GetItemSet(); diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 925cdbbc9187..37d8fe192c1d 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -731,7 +731,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI rIndent=1; if (ImpGetItem(*pSet,XATTR_FORMTXTSTYLE,pItem)) { XFormTextStyle eStyle=static_cast<const XFormTextStyleItem*>(pItem)->GetValue(); - if (eStyle==XFT_NONE) return true; + if (eStyle==XFormTextStyle::NONE) return true; } if ((nWhich>=XATTR_FORMTXTSHDWCOLOR && nWhich<=XATTR_FORMTXTSHDWYVAL) || nWhich>=XATTR_FORMTXTSHDWTRANSP) { rIndent=2; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 5bc0ddc922d1..42e3d6320686 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1808,7 +1808,7 @@ long SdrTextObj::GetMaxTextFrameWidth() const bool SdrTextObj::IsFontwork() const { return !bTextFrame // Default is FALSE - && static_cast<const XFormTextStyleItem&>(GetObjectItemSet().Get(XATTR_FORMTXTSTYLE)).GetValue() != XFT_NONE; + && static_cast<const XFormTextStyleItem&>(GetObjectItemSet().Get(XATTR_FORMTXTSTYLE)).GetValue() != XFormTextStyle::NONE; } bool SdrTextObj::IsHideContour() const diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index d7cba40402e6..d0bcac13ca6f 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -403,7 +403,7 @@ namespace switch(maSdrFormTextAttribute.getFormTextStyle()) { - case XFT_ROTATE : + case XFormTextStyle::Rotate : { aEndPos = basegfx::tools::getPositionAbsolute(aPolygonCandidate, fPolyStart + fPortionLength, fPolyLength); const basegfx::B2DVector aDirection(aEndPos - aStartPos); @@ -412,13 +412,13 @@ namespace break; } - case XFT_UPRIGHT : + case XFormTextStyle::Upright : { aNewTransformB.translate(aStartPos.getX() - (fPortionLength / 2.0), aStartPos.getY()); break; } - case XFT_SLANTX : + case XFormTextStyle::SlantX : { aEndPos = basegfx::tools::getPositionAbsolute(aPolygonCandidate, fPolyStart + fPortionLength, fPolyLength); const basegfx::B2DVector aDirection(aEndPos - aStartPos); @@ -436,7 +436,7 @@ namespace break; } - case XFT_SLANTY : + case XFormTextStyle::SlantY : { aEndPos = basegfx::tools::getPositionAbsolute(aPolygonCandidate, fPolyStart + fPortionLength, fPolyLength); const basegfx::B2DVector aDirection(aEndPos - aStartPos); @@ -455,7 +455,7 @@ namespace break; } - default : break; // XFT_NONE + default : break; // XFormTextStyle::NONE } // distance from path? diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index c4a96c5e98ea..adc4e424982c 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -669,11 +669,11 @@ static SvXMLEnumMapEntry const pXML_Measure_VAlign_Enum[] = // #FontWork# static SvXMLEnumMapEntry const pXML_Fontwork_Style_Enum[] = { - { XML_ROTATE, 0 }, //XFT_ROTATE, - { XML_UPRIGHT, 1 }, //XFT_UPRIGHT, - { XML_SLANT_X, 2 }, //XFT_SLANTX, - { XML_SLANT_Y, 3 }, //XFT_SLANTY, - { XML_NONE, 4 }, //XFT_NONE + { XML_ROTATE, 0 }, //XFormTextStyle::Rotate, + { XML_UPRIGHT, 1 }, //XFormTextStyle::Upright, + { XML_SLANT_X, 2 }, //XFormTextStyle::SlantX, + { XML_SLANT_Y, 3 }, //XFormTextStyle::SlantY, + { XML_NONE, 4 }, //XFormTextStyle::NONE { XML_TOKEN_INVALID,0 } }; @@ -1453,7 +1453,7 @@ void XMLShapeExportPropertyMapper::ContextFilter( if(pFontWorkStyle->maValue >>= nStyle) { - if(/*XFT_NONE*/4 == nStyle) + if(/*XFormTextStyle::NONE*/4 == nStyle) { pFontWorkStyle->mnIndex = -1; if(pFontWorkAdjust) |