create a macro to tidy up the declaration sites of o3tl::typed_flags_set
Change-Id: Ifb8fd4fd5128188420f1dfda6b6f695160d5e77a Reviewed-on: https://gerrit.libreoffice.org/15865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
This commit is contained in:
parent
e1b123896d
commit
e51fa14358
@ -317,6 +317,15 @@ inline typename o3tl::typed_flags<E>::Self operator ^=(
|
|||||||
return lhs;
|
return lhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make the declaration sites a little less verbose
|
||||||
|
*/
|
||||||
|
#define DECLARE_TYPED_FLAGS(T,V) \
|
||||||
|
namespace o3tl \
|
||||||
|
{ \
|
||||||
|
template<> struct typed_flags<T> : is_typed_flags<T,V> {}; \
|
||||||
|
} \
|
||||||
|
|
||||||
#endif /* INCLUDED_O3TL_TYPED_FLAGS_SET_HXX */
|
#endif /* INCLUDED_O3TL_TYPED_FLAGS_SET_HXX */
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@ -61,10 +61,8 @@ enum class XMLShapeExportFlags {
|
|||||||
// When setting the flag below a callout shape is exported as office:annotation
|
// When setting the flag below a callout shape is exported as office:annotation
|
||||||
ANNOTATION = 0x0040,
|
ANNOTATION = 0x0040,
|
||||||
};
|
};
|
||||||
namespace o3tl
|
DECLARE_TYPED_FLAGS(XMLShapeExportFlags, 0x007f)
|
||||||
{
|
|
||||||
template<> struct typed_flags<XMLShapeExportFlags> : is_typed_flags<XMLShapeExportFlags, 0x7f> {};
|
|
||||||
}
|
|
||||||
|
|
||||||
#define SEF_DEFAULT XMLShapeExportFlags::POSITION|XMLShapeExportFlags::SIZE
|
#define SEF_DEFAULT XMLShapeExportFlags::POSITION|XMLShapeExportFlags::SIZE
|
||||||
|
|
||||||
|
@ -81,11 +81,7 @@ enum class SvXMLErrorFlags {
|
|||||||
ERROR_OCCURRED = 0x0002,
|
ERROR_OCCURRED = 0x0002,
|
||||||
WARNING_OCCURRED = 0x0004,
|
WARNING_OCCURRED = 0x0004,
|
||||||
};
|
};
|
||||||
|
DECLARE_TYPED_FLAGS(SvXMLErrorFlags, 0x0007)
|
||||||
namespace o3tl
|
|
||||||
{
|
|
||||||
template<> struct typed_flags<SvXMLErrorFlags> : is_typed_flags<SvXMLErrorFlags, 0x7> {};
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace com { namespace sun { namespace star {
|
namespace com { namespace sun { namespace star {
|
||||||
namespace uno { template<class X> class Sequence; }
|
namespace uno { template<class X> class Sequence; }
|
||||||
|
@ -102,10 +102,7 @@ enum class SvXMLExportFlags {
|
|||||||
OASIS = 0x8000,
|
OASIS = 0x8000,
|
||||||
ALL = 0x0fff
|
ALL = 0x0fff
|
||||||
};
|
};
|
||||||
namespace o3tl
|
DECLARE_TYPED_FLAGS(SvXMLExportFlags, 0x8fff)
|
||||||
{
|
|
||||||
template<> struct typed_flags<SvXMLExportFlags> : is_typed_flags<SvXMLExportFlags, 0x8fff> {};
|
|
||||||
}
|
|
||||||
|
|
||||||
class XMLOFF_DLLPUBLIC SvXMLExport : public ::cppu::WeakImplHelper6<
|
class XMLOFF_DLLPUBLIC SvXMLExport : public ::cppu::WeakImplHelper6<
|
||||||
::com::sun::star::document::XFilter,
|
::com::sun::star::document::XFilter,
|
||||||
|
@ -38,10 +38,7 @@ enum class SvXmlExportFlags {
|
|||||||
// even if its empty
|
// even if its empty
|
||||||
IGN_WS = 0x0008
|
IGN_WS = 0x0008
|
||||||
};
|
};
|
||||||
namespace o3tl
|
DECLARE_TYPED_FLAGS(SvXmlExportFlags, 0x000f)
|
||||||
{
|
|
||||||
template<> struct typed_flags<SvXmlExportFlags> : is_typed_flags<SvXmlExportFlags, 0xf> {};
|
|
||||||
}
|
|
||||||
|
|
||||||
class SvXMLUnitConverter;
|
class SvXMLUnitConverter;
|
||||||
class SvXMLAttributeList;
|
class SvXMLAttributeList;
|
||||||
|
@ -97,10 +97,7 @@ enum class SvXMLImportFlags {
|
|||||||
EMBEDDED = 0x0100,
|
EMBEDDED = 0x0100,
|
||||||
ALL = 0xffff
|
ALL = 0xffff
|
||||||
};
|
};
|
||||||
namespace o3tl
|
DECLARE_TYPED_FLAGS(SvXMLImportFlags, 0xffff)
|
||||||
{
|
|
||||||
template<> struct typed_flags<SvXMLImportFlags> : is_typed_flags<SvXMLImportFlags, 0xffff> {};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper7<
|
class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper7<
|
||||||
|
@ -18,10 +18,7 @@ using namespace ::o3tl;
|
|||||||
|
|
||||||
enum class ConfigurationChangedHint { NONE, ONE, TWO };
|
enum class ConfigurationChangedHint { NONE, ONE, TWO };
|
||||||
|
|
||||||
namespace o3tl
|
DECLARE_TYPED_FLAGS(ConfigurationChangedHint, 0xff)
|
||||||
{
|
|
||||||
template<> struct typed_flags< ConfigurationChangedHint> : is_typed_flags< ConfigurationChangedHint, 0xFF> {};
|
|
||||||
}
|
|
||||||
|
|
||||||
class typed_flags_test : public CppUnit::TestFixture
|
class typed_flags_test : public CppUnit::TestFixture
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user