summaryrefslogtreecommitdiff
path: root/include/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-18 13:03:28 +0200
committerNoel Grandin <noel@peralex.com>2015-03-19 08:25:03 +0200
commit48bb2913a7459edb17a5f62c2f6e6fbc4f1051e2 (patch)
tree7e2f09fc8998bc1016f4d2ba7fa09e3125663361 /include/comphelper
parentbdad6d0fe492a2334cb27ef54fc5d1cba17d1970 (diff)
convert SFX_FILTER_ constants to enum class
Change-Id: I7e53cfc90cefd9da7d6ecd795b09214bd44b1613
Diffstat (limited to 'include/comphelper')
-rw-r--r--include/comphelper/documentconstants.hxx57
-rw-r--r--include/comphelper/mimeconfighelper.hxx6
2 files changed, 37 insertions, 26 deletions
diff --git a/include/comphelper/documentconstants.hxx b/include/comphelper/documentconstants.hxx
index 268bf9964a3d..9cadc39ebcc0 100644
--- a/include/comphelper/documentconstants.hxx
+++ b/include/comphelper/documentconstants.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_COMPHELPER_DOCUMENTCONSTANTS_HXX
#include <rtl/ustring.hxx>
+#include <o3tl/typed_flags_set.hxx>
// formats of SO6/7
#define MIMETYPE_VND_SUN_XML_WRITER_ASCII "application/vnd.sun.xml.writer"
@@ -72,8 +73,6 @@
#define ODFVER_011_TEXT "1.1"
#define ODFVER_012_TEXT "1.2"
-#endif
-
// filter flags
// TODO/LATER: The flags should be part of the UNO specification
@@ -105,33 +104,43 @@
// in filter, and rename the obscure ones to describe their meaning
// using terms that are understandable.
-#define SFX_FILTER_IMPORT 0x00000001L
-#define SFX_FILTER_EXPORT 0x00000002L
-#define SFX_FILTER_TEMPLATE 0x00000004L
-#define SFX_FILTER_INTERNAL 0x00000008L
-#define SFX_FILTER_TEMPLATEPATH 0x00000010L
-#define SFX_FILTER_OWN 0x00000020L
-#define SFX_FILTER_ALIEN 0x00000040L
-#define SFX_FILTER_USESOPTIONS 0x00000080L
+enum class SfxFilterFlags
+{
+ IMPORT = 0x00000001L,
+ EXPORT = 0x00000002L,
+ TEMPLATE = 0x00000004L,
+ INTERNAL = 0x00000008L,
+ TEMPLATEPATH = 0x00000010L,
+ OWN = 0x00000020L,
+ ALIEN = 0x00000040L,
+ USESOPTIONS = 0x00000080L,
-#define SFX_FILTER_DEFAULT 0x00000100L
-#define SFX_FILTER_EXECUTABLE 0x00000200L
-#define SFX_FILTER_SUPPORTSSELECTION 0x00000400L
-#define SFX_FILTER_NOTINFILEDLG 0x00001000L
-#define SFX_FILTER_OPENREADONLY 0x00010000L
-#define SFX_FILTER_MUSTINSTALL 0x00020000L
-#define SFX_FILTER_CONSULTSERVICE 0x00040000L
+ DEFAULT = 0x00000100L,
+ EXECUTABLE = 0x00000200L,
+ SUPPORTSSELECTION = 0x00000400L,
+ NOTINFILEDLG = 0x00001000L,
+ OPENREADONLY = 0x00010000L,
+ MUSTINSTALL = 0x00020000L,
+ CONSULTSERVICE = 0x00040000L,
-#define SFX_FILTER_STARONEFILTER 0x00080000L
-#define SFX_FILTER_PACKED 0x00100000L
+ STARONEFILTER = 0x00080000L,
+ PACKED = 0x00100000L,
+ ENCRYPTION = 0x01000000L,
+ PASSWORDTOMODIFY = 0x02000000L,
-#define SFX_FILTER_ENCRYPTION 0x01000000L
-#define SFX_FILTER_PASSWORDTOMODIFY 0x02000000L
+ PREFERED = 0x10000000L,
-#define SFX_FILTER_PREFERED 0x10000000L
+ STARTPRESENTATION = 0x20000000L,
-#define SFX_FILTER_VERSION_NONE 0
-#define SFX_FILTER_NOTINSTALLED SFX_FILTER_MUSTINSTALL | SFX_FILTER_CONSULTSERVICE
+ NONE = 0
+};
+namespace o3tl
+{
+ template<> struct typed_flags<SfxFilterFlags> : is_typed_flags<SfxFilterFlags, 0x331f17ffL> {};
+}
+#define SFX_FILTER_NOTINSTALLED (SfxFilterFlags::MUSTINSTALL | SfxFilterFlags::CONSULTSERVICE)
+
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/mimeconfighelper.hxx b/include/comphelper/mimeconfighelper.hxx
index 1203c2b6847e..9f9d9fdb53e7 100644
--- a/include/comphelper/mimeconfighelper.hxx
+++ b/include/comphelper/mimeconfighelper.hxx
@@ -32,6 +32,8 @@
#include <comphelper/comphelperdllapi.h>
+enum class SfxFilterFlags;
+
namespace comphelper {
class COMPHELPER_DLLPUBLIC MimeConfigurationHelper
@@ -124,8 +126,8 @@ public:
static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SearchForFilter(
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery >& xFilterQuery,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aSearchRequest,
- sal_Int32 nMustFlags,
- sal_Int32 nDontFlags );
+ SfxFilterFlags nMustFlags,
+ SfxFilterFlags nDontFlags );
static bool ClassIDsEqual( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID1,
const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID2 );