summaryrefslogtreecommitdiff
path: root/include/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-31 09:11:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-01 12:34:37 +0100
commitae5f89fdcccb2cf74256b04771249fc8afca8794 (patch)
tree7b9235188fbfc8fb74edf7be3e4c2c351638c8a3 /include/comphelper
parente02efb621fe672aa52e56caa916cf5c3fd0a9cb8 (diff)
split out SFX_METRIC_ITEM into separate field
instead of overloading the nMemberId field and thus fix various places that were effectively setting the METRIC flag and causing a warning in SvxUnoConvertToMM And fix bug in sw/source/core/unocore/unomap.cxx where the PropertyAttribute::READONLY was in the wrong place, ever since commit 84a3db80b4fd66c6854b3135b5f69b61fd828e62 Date: Mon Sep 18 23:08:29 2000 +0000 initial import Change-Id: Ifc2bf56709f19aea75300b2fda62ce551efc26af Reviewed-on: https://gerrit.libreoffice.org/48950 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/comphelper')
-rw-r--r--include/comphelper/propertysetinfo.hxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/comphelper/propertysetinfo.hxx b/include/comphelper/propertysetinfo.hxx
index 7d3359370106..84a9a28d18ab 100644
--- a/include/comphelper/propertysetinfo.hxx
+++ b/include/comphelper/propertysetinfo.hxx
@@ -27,8 +27,17 @@
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <cppuhelper/implbase.hxx>
#include <comphelper/comphelperdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
#include <memory>
+enum class PropertyMoreFlags : sal_uInt8 {
+ NONE = 0x00,
+ METRIC_ITEM = 0x01,
+};
+namespace o3tl {
+ template<> struct typed_flags<PropertyMoreFlags> : is_typed_flags<PropertyMoreFlags, 0x1> {};
+}
+
namespace comphelper
{
@@ -37,8 +46,33 @@ struct PropertyMapEntry
OUString maName;
sal_Int32 mnHandle;
css::uno::Type maType;
+ /// flag bitmap, @see css::beans::PropertyAttribute
sal_Int16 mnAttributes;
sal_uInt8 mnMemberId;
+ PropertyMoreFlags mnMoreFlags;
+
+ PropertyMapEntry(OUString _aName, sal_Int32 _nHandle, css::uno::Type const & _rType,
+ sal_Int16 _nAttributes, sal_uInt8 _nMemberId, PropertyMoreFlags _nMoreFlags = PropertyMoreFlags::NONE)
+ : maName( _aName )
+ , mnHandle( _nHandle )
+ , maType( _rType )
+ , mnAttributes( _nAttributes )
+ , mnMemberId( _nMemberId )
+ , mnMoreFlags( _nMoreFlags )
+ {
+ assert(mnAttributes <= 0x1ff );
+ assert( (_nMemberId & 0x40) == 0 );
+ // Verify that if METRIC_ITEM is set, we are one of the types supported by
+ // SvxUnoConvertToMM.
+ assert(!(_nMoreFlags & PropertyMoreFlags::METRIC_ITEM) ||
+ ( (maType.getTypeClass() == css::uno::TypeClass_BYTE)
+ || (maType.getTypeClass() == css::uno::TypeClass_SHORT)
+ || (maType.getTypeClass() == css::uno::TypeClass_UNSIGNED_SHORT)
+ || (maType.getTypeClass() == css::uno::TypeClass_LONG)
+ || (maType.getTypeClass() == css::uno::TypeClass_UNSIGNED_LONG)
+ ) );
+ }
+ PropertyMapEntry() = default;
};
typedef std::map<OUString, PropertyMapEntry const *> PropertyMap;