diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-19 09:32:45 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-19 09:38:05 +0200 |
commit | 1e3a00f0c772a76a1dd76b8272e2c35a1802d574 (patch) | |
tree | a1eadac1680f1e46c789964200aa8a61bb659189 /svx/source/sdr | |
parent | 9fe114e78f1285397dcd2a0d2e3d6afc3024fa66 (diff) |
Make SfxItemSet ranges correct by construction: Fix static cases
...with the aid of an extended compilerplugins/clang/store/sfxitemsetrewrite.cxx
(which in turn needed a small addition to compilerplugins/clang/check.hxx).
Enable svl::detail::validGap check for the static case, but keep it disabled for
now for the dynamic case.
Change-Id: I4846ba8e99aff94a86518e2cb5044e575093386e
Diffstat (limited to 'svx/source/sdr')
-rw-r--r-- | svx/source/sdr/properties/captionproperties.cxx | 20 | ||||
-rw-r--r-- | svx/source/sdr/properties/circleproperties.cxx | 22 | ||||
-rw-r--r-- | svx/source/sdr/properties/connectorproperties.cxx | 21 | ||||
-rw-r--r-- | svx/source/sdr/properties/customshapeproperties.cxx | 30 | ||||
-rw-r--r-- | svx/source/sdr/properties/measureproperties.cxx | 22 |
5 files changed, 49 insertions, 66 deletions
diff --git a/svx/source/sdr/properties/captionproperties.cxx b/svx/source/sdr/properties/captionproperties.cxx index 2a32b8dab720..d092374003b0 100644 --- a/svx/source/sdr/properties/captionproperties.cxx +++ b/svx/source/sdr/properties/captionproperties.cxx @@ -35,18 +35,14 @@ namespace sdr // create a new itemset std::unique_ptr<SfxItemSet> CaptionProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool) { - return o3tl::make_unique<SfxItemSet>(rPool, - - // range from SdrAttrObj - svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST, - SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, - SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, - - // range from SdrCaptionObj - SDRATTR_CAPTION_FIRST, SDRATTR_CAPTION_LAST, - - // range from SdrTextObj - EE_ITEMS_START, EE_ITEMS_END>{}); + return o3tl::make_unique<SfxItemSet>( + rPool, + svl::Items< + // Ranges from SdrAttrObj, SdrCaptionObj: + SDRATTR_START, SDRATTR_MISC_LAST, + SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, + // Range from SdrTextObj: + EE_ITEMS_START, EE_ITEMS_END>{}); } CaptionProperties::CaptionProperties(SdrObject& rObj) diff --git a/svx/source/sdr/properties/circleproperties.cxx b/svx/source/sdr/properties/circleproperties.cxx index 4782128d79ff..d8eca6fc5ea2 100644 --- a/svx/source/sdr/properties/circleproperties.cxx +++ b/svx/source/sdr/properties/circleproperties.cxx @@ -37,18 +37,16 @@ namespace sdr // create a new itemset std::unique_ptr<SfxItemSet> CircleProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool) { - return o3tl::make_unique<SfxItemSet>(rPool, - - // range from SdrAttrObj - svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST, - SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, - SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, - - // range from SdrCircObj - SDRATTR_CIRC_FIRST, SDRATTR_CIRC_LAST, - - // range from SdrTextObj - EE_ITEMS_START, EE_ITEMS_END>{}); + return o3tl::make_unique<SfxItemSet>( + rPool, + svl::Items< + // Ranges from SdrAttrObj, SdrCircObj + SDRATTR_START, SDRATTR_SHADOW_LAST, + SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, + SDRATTR_CIRC_FIRST, SDRATTR_CIRC_LAST, + SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, + // Range from SdrTextObj: + EE_ITEMS_START, EE_ITEMS_END>{}); } CircleProperties::CircleProperties(SdrObject& rObj) diff --git a/svx/source/sdr/properties/connectorproperties.cxx b/svx/source/sdr/properties/connectorproperties.cxx index fc7b278fdb77..c8f825a5f013 100644 --- a/svx/source/sdr/properties/connectorproperties.cxx +++ b/svx/source/sdr/properties/connectorproperties.cxx @@ -35,18 +35,15 @@ namespace sdr // create a new itemset std::unique_ptr<SfxItemSet> ConnectorProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool) { - return o3tl::make_unique<SfxItemSet>(rPool, - - // range from SdrAttrObj - svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST, - SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, - SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, - - // range from SdrEdgeObj - SDRATTR_EDGE_FIRST, SDRATTR_EDGE_LAST, - - // range from SdrTextObj - EE_ITEMS_START, EE_ITEMS_END>{}); + return o3tl::make_unique<SfxItemSet>( + rPool, + svl::Items< + // Ranges from SdrAttrObj, SdrEdgeObj: + SDRATTR_START, SDRATTR_SHADOW_LAST, + SDRATTR_MISC_FIRST, SDRATTR_EDGE_LAST, + SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, + // Range from SdrTextObj: + EE_ITEMS_START, EE_ITEMS_END>{}); } ConnectorProperties::ConnectorProperties(SdrObject& rObj) diff --git a/svx/source/sdr/properties/customshapeproperties.cxx b/svx/source/sdr/properties/customshapeproperties.cxx index 05e28368f529..24633ee82f99 100644 --- a/svx/source/sdr/properties/customshapeproperties.cxx +++ b/svx/source/sdr/properties/customshapeproperties.cxx @@ -64,24 +64,18 @@ namespace sdr std::unique_ptr<SfxItemSet> CustomShapeProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool) { - return o3tl::make_unique<SfxItemSet>(rPool, - - // ranges from SdrAttrObj - svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST, - SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, - SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, - - // Graphic Attributes - SDRATTR_GRAF_FIRST, SDRATTR_GRAF_LAST, - - // 3d Properties - SDRATTR_3D_FIRST, SDRATTR_3D_LAST, - - // CustomShape properties - SDRATTR_CUSTOMSHAPE_FIRST, SDRATTR_CUSTOMSHAPE_LAST, - - // range from SdrTextObj - EE_ITEMS_START, EE_ITEMS_END>{}); + return o3tl::make_unique<SfxItemSet>( + rPool, + svl::Items< + // Ranges from SdrAttrObj: + SDRATTR_START, SDRATTR_SHADOW_LAST, + SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, + SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, + // Graphic attributes, 3D properties, CustomShape + // properties: + SDRATTR_GRAF_FIRST, SDRATTR_CUSTOMSHAPE_LAST, + // Range from SdrTextObj: + EE_ITEMS_START, EE_ITEMS_END>{}); } bool CustomShapeProperties::AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem ) const diff --git a/svx/source/sdr/properties/measureproperties.cxx b/svx/source/sdr/properties/measureproperties.cxx index 3b1ae3ee3fda..f000080a27d9 100644 --- a/svx/source/sdr/properties/measureproperties.cxx +++ b/svx/source/sdr/properties/measureproperties.cxx @@ -41,18 +41,16 @@ namespace sdr // create a new itemset std::unique_ptr<SfxItemSet> MeasureProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool) { - return o3tl::make_unique<SfxItemSet>(rPool, - - // range from SdrAttrObj - svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST, - SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, - SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, - - // range from SdrMeasureObj - SDRATTR_MEASURE_FIRST, SDRATTR_MEASURE_LAST, - - // range from SdrTextObj - EE_ITEMS_START, EE_ITEMS_END>{}); + return o3tl::make_unique<SfxItemSet>( + rPool, + svl::Items< + // Ranges from SdrAttrObj, SdrMeasureObj: + SDRATTR_START, SDRATTR_SHADOW_LAST, + SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, + SDRATTR_MEASURE_FIRST, SDRATTR_MEASURE_LAST, + SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, + // Range from SdrTextObj: + EE_ITEMS_START, EE_ITEMS_END>{}); } MeasureProperties::MeasureProperties(SdrObject& rObj) |