diff options
author | Noel Grandin <noel@peralex.com> | 2014-12-28 15:07:40 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-06 10:59:42 +0200 |
commit | 8447eeb192acf7e3255f7fdf92977470b28a18f9 (patch) | |
tree | 2743aaf5eefe97bc534cd655247f69eb91715bd8 /include/xmloff | |
parent | c29657e0d6bb707345584ac7a7f5ae5016f37297 (diff) |
fdo#84938: convert ERROR_ #defines to 'enum class'
Change-Id: Ie76bac6b91a9faa4f9ff7dbdf2b455ea9016cf72
Diffstat (limited to 'include/xmloff')
-rw-r--r-- | include/xmloff/xmlerror.hxx | 16 | ||||
-rw-r--r-- | include/xmloff/xmlexp.hxx | 5 | ||||
-rw-r--r-- | include/xmloff/xmlimp.hxx | 5 |
3 files changed, 17 insertions, 9 deletions
diff --git a/include/xmloff/xmlerror.hxx b/include/xmloff/xmlerror.hxx index 8b621192a821..3726eb23a19d 100644 --- a/include/xmloff/xmlerror.hxx +++ b/include/xmloff/xmlerror.hxx @@ -22,6 +22,7 @@ #include <com/sun/star/xml/sax/SAXParseException.hpp> #include <sal/types.h> +#include <o3tl/typed_flags_set.hxx> #include <vector> @@ -79,11 +80,16 @@ // 16bit error flag constants for use in the // SvXMLExport/SvXMLImport error flags -#define ERROR_NO 0x0000 -#define ERROR_DO_NOTHING 0x0001 -#define ERROR_ERROR_OCCURRED 0x0002 -#define ERROR_WARNING_OCCURRED 0x0004 - +enum class SvXMLErrorFlags { + NO = 0x0000, + DO_NOTHING = 0x0001, + ERROR_OCCURRED = 0x0002, + WARNING_OCCURRED = 0x0004, +}; +namespace o3tl +{ + template<> struct typed_flags<SvXMLErrorFlags> : is_typed_flags<SvXMLErrorFlags, 0x7> {}; +} diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index d53983ec62c7..747594250fa0 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -73,6 +73,7 @@ class XMLSettingsExportHelper; class XMLImageMapExport; class XMLErrors; class LanguageTag; +enum class SvXMLErrorFlags; // Shapes in Writer cannot be named via context menu (#i51726#) #include <unotools/moduleoptions.hxx> @@ -158,7 +159,7 @@ class XMLOFF_DLLPUBLIC SvXMLExport : public ::cppu::WeakImplHelper6< SAL_DLLPRIVATE void _InitCtor(); SvXMLExportFlags mnExportFlags; - sal_uInt16 mnErrorFlags; + SvXMLErrorFlags mnErrorFlags; public: @@ -545,7 +546,7 @@ public: const ::com::sun::star::uno::Sequence< OUString> & rMsgParams); /** return current error flags (logical 'or' of all error flags so far) */ - sal_uInt16 GetErrorFlags() { return mnErrorFlags; } + SvXMLErrorFlags GetErrorFlags() { return mnErrorFlags; } virtual void DisposingModel(); diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 87eecf52d9cf..cc08bfcbd6b5 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -74,6 +74,7 @@ class XMLFontStylesContext; class XMLEventImportHelper; class XMLErrors; class StyleMap; +enum class SvXMLErrorFlags; typedef std::vector<SvXMLImportContext *> SvXMLImportContexts_Impl; typedef std::vector< ::css::uno::Reference< ::css::xml::sax::XFastContextHandler>> @@ -157,7 +158,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper7< SAL_DLLPRIVATE void _InitCtor(); SvXMLImportFlags mnImportFlags; - sal_uInt16 mnErrorFlags; + SvXMLErrorFlags mnErrorFlags; std::set< OUString > embeddedFontUrlsKnown; protected: @@ -415,7 +416,7 @@ public: const OUString& rMsg2 ); /** return current error flags */ - sal_uInt16 GetErrorFlags() { return mnErrorFlags; } + SvXMLErrorFlags GetErrorFlags() { return mnErrorFlags; } virtual void DisposingModel(); |