From 48cb92cb1671bfdef3fcf43978455f19b26ca7bd Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 16 Aug 2016 15:51:26 +0200 Subject: convert XPropertyListType to scoped enum Change-Id: I071c0d17c7c5982af47bccd92580bbac62bdf7b3 --- include/svx/svdmodel.hxx | 17 +++++++++-------- include/svx/xtable.hxx | 26 +++++++++++++------------- 2 files changed, 22 insertions(+), 21 deletions(-) (limited to 'include/svx') 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 #include #include +#include #include #include @@ -214,7 +215,7 @@ public: bool mbInDestruction; // Color, Dash, Line-End, Hatch, Gradient, Bitmap property lists ... - XPropertyListRef maProperties[XPROPERTY_LIST_COUNT]; + o3tl::enumarray 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 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); -- cgit