diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-16 15:51:26 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-17 08:45:15 +0200 |
commit | 48cb92cb1671bfdef3fcf43978455f19b26ca7bd (patch) | |
tree | c50dec2c019daff055e253d1b8230d8d00b8b369 /include | |
parent | 430b93f7f3c9f5aeb89db634447cb554acd125aa (diff) |
convert XPropertyListType to scoped enum
Change-Id: I071c0d17c7c5982af47bccd92580bbac62bdf7b3
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/svdmodel.hxx | 17 | ||||
-rw-r--r-- | include/svx/xtable.hxx | 26 |
2 files changed, 22 insertions, 21 deletions
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 3d1c7533ee99..ac1f82f83849 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -33,6 +33,7 @@ #include <tools/fract.hxx> #include <svl/hint.hxx> #include <o3tl/typed_flags_set.hxx> +#include <o3tl/enumarray.hxx> #include <svl/style.hxx> #include <svx/xtable.hxx> @@ -214,7 +215,7 @@ public: bool mbInDestruction; // Color, Dash, Line-End, Hatch, Gradient, Bitmap property lists ... - XPropertyListRef maProperties[XPROPERTY_LIST_COUNT]; + o3tl::enumarray<XPropertyListType, XPropertyListRef> maProperties; // New src638: NumberFormatter for drawing layer and // method for getting it. It is constructed on demand @@ -505,13 +506,13 @@ public: void SetPropertyList( XPropertyListRef const & p ) { maProperties[ p->Type() ] = p; } // friendlier helpers - XDashListRef GetDashList() const { return XPropertyList::AsDashList(GetPropertyList( XDASH_LIST )); } - XHatchListRef GetHatchList() const { return XPropertyList::AsHatchList(GetPropertyList( XHATCH_LIST )); } - XColorListRef GetColorList() const { return XPropertyList::AsColorList(GetPropertyList( XCOLOR_LIST )); } - XBitmapListRef GetBitmapList() const { return XPropertyList::AsBitmapList(GetPropertyList( XBITMAP_LIST )); } - XPatternListRef GetPatternList() const { return XPropertyList::AsPatternList(GetPropertyList( XPATTERN_LIST )); } - XLineEndListRef GetLineEndList() const { return XPropertyList::AsLineEndList(GetPropertyList( XLINE_END_LIST )); } - XGradientListRef GetGradientList() const { return XPropertyList::AsGradientList(GetPropertyList( XGRADIENT_LIST )); } + XDashListRef GetDashList() const { return XPropertyList::AsDashList(GetPropertyList( XPropertyListType::Dash )); } + XHatchListRef GetHatchList() const { return XPropertyList::AsHatchList(GetPropertyList( XPropertyListType::Hatch )); } + XColorListRef GetColorList() const { return XPropertyList::AsColorList(GetPropertyList( XPropertyListType::Color )); } + XBitmapListRef GetBitmapList() const { return XPropertyList::AsBitmapList(GetPropertyList( XPropertyListType::Bitmap )); } + XPatternListRef GetPatternList() const { return XPropertyList::AsPatternList(GetPropertyList( XPropertyListType::Pattern )); } + XLineEndListRef GetLineEndList() const { return XPropertyList::AsLineEndList(GetPropertyList( XPropertyListType::LineEnd )); } + XGradientListRef GetGradientList() const { return XPropertyList::AsGradientList(GetPropertyList( XPropertyListType::Gradient )); } // The DrawingEngine only references the StyleSheetPool, whoever // made it needs to delete it. diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx index 021627167449..18474537fa2b 100644 --- a/include/svx/xtable.hxx +++ b/include/svx/xtable.hxx @@ -144,16 +144,16 @@ public: } }; -enum XPropertyListType { - UNKNOWN_XPROPERTYLISTTYPE = -1, - XCOLOR_LIST, - XLINE_END_LIST, - XDASH_LIST, - XHATCH_LIST, - XGRADIENT_LIST, - XBITMAP_LIST, - XPATTERN_LIST, - XPROPERTY_LIST_COUNT +enum class XPropertyListType { + Unknown = -1, + Color, + LineEnd, + Dash, + Hatch, + Gradient, + Bitmap, + Pattern, + LAST }; typedef rtl::Reference< class XPropertyList > XPropertyListRef; @@ -265,7 +265,7 @@ protected: public: XColorList(const OUString& rPath, const OUString& rReferer) - : XPropertyList(XCOLOR_LIST, rPath, rReferer) {} + : XPropertyList(XPropertyListType::Color, rPath, rReferer) {} void Replace(long nIndex, std::unique_ptr<XColorEntry> pEntry); XColorEntry* GetColor(long nIndex) const; @@ -371,7 +371,7 @@ protected: public: XBitmapList(const OUString& rPath, const OUString& rReferer) - : XPropertyList(XBITMAP_LIST, rPath, rReferer) {} + : XPropertyList(XPropertyListType::Bitmap, rPath, rReferer) {} XBitmapEntry* GetBitmap(long nIndex) const; Bitmap GetBitmapForPreview(long nIndex, const Size& rSize); @@ -390,7 +390,7 @@ protected: public: XPatternList(const OUString& rPath, const OUString& rReferer) - : XPropertyList(XPATTERN_LIST, rPath, rReferer) {} + : XPropertyList(XPropertyListType::Pattern, rPath, rReferer) {} XBitmapEntry* GetBitmap(long nIndex) const; Bitmap GetBitmapForPreview(long nIndex, const Size& rSize); |