diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-07-16 01:03:06 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-07-16 03:46:26 +0200 |
commit | 01c0cf63be7155531e1240d79e3936f8c4600864 (patch) | |
tree | 774a3476e298a2aac68cea7359f87efc33e635da /cui | |
parent | da13b76e07231131cb951868a314ee6f51c0f254 (diff) |
Move validity check to svl::Items, to avoid invalid WhichRangesContainer
This uncovered lots of pre-existing invalid ranges, e.g. introduced
in commit 6dbfbebad37fd84208e4c336f0864d26019db153, or in much older
commit 46952138c938730afcc3607e1a524bb590b0e30e.
Also this makes the static in svl::Items to be array of WhichPair,
to avoid questionable reinterpret_cast in WhichRangesContainer ctor.
Change-Id: I86030b2a2ac0a6d98870f8f7f5cc83e071c6597c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119003
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/align.cxx | 6 | ||||
-rw-r--r-- | cui/source/tabpages/numfmt.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/swpossizetabpage.cxx | 3 | ||||
-rw-r--r-- | cui/source/tabpages/tpshadow.cxx | 7 | ||||
-rw-r--r-- | cui/source/tabpages/tptrans.cxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 10 |
6 files changed, 14 insertions, 18 deletions
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index b178630ab61e..4c9b43454c74 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -41,15 +41,15 @@ namespace svx { const WhichRangesContainer AlignmentTabPage::s_pRanges( svl::Items< - SID_ATTR_ALIGN_HOR_JUSTIFY, SID_ATTR_ALIGN_VER_JUSTIFY, SID_ATTR_ALIGN_STACKED, SID_ATTR_ALIGN_LINEBREAK, SID_ATTR_ALIGN_INDENT, SID_ATTR_ALIGN_INDENT, SID_ATTR_ALIGN_DEGREES, SID_ATTR_ALIGN_DEGREES, SID_ATTR_ALIGN_LOCKPOS, SID_ATTR_ALIGN_LOCKPOS, SID_ATTR_ALIGN_HYPHENATION, SID_ATTR_ALIGN_HYPHENATION, - SID_ATTR_ALIGN_ASIANVERTICAL, SID_ATTR_ALIGN_ASIANVERTICAL, SID_ATTR_FRAMEDIRECTION, SID_ATTR_FRAMEDIRECTION, - SID_ATTR_ALIGN_SHRINKTOFIT, SID_ATTR_ALIGN_SHRINKTOFIT>::value); + SID_ATTR_ALIGN_ASIANVERTICAL, SID_ATTR_ALIGN_ASIANVERTICAL, + SID_ATTR_ALIGN_SHRINKTOFIT, SID_ATTR_ALIGN_SHRINKTOFIT, + SID_ATTR_ALIGN_HOR_JUSTIFY, SID_ATTR_ALIGN_VER_JUSTIFY>::value); namespace { diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index 6f889f747517..f1560168b16a 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -57,8 +57,8 @@ using ::com::sun::star::uno::UNO_QUERY; const WhichRangesContainer SvxNumberFormatTabPage::pRanges( svl::Items< SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO, - SID_ATTR_NUMBERFORMAT_NOLANGUAGE, SID_ATTR_NUMBERFORMAT_NOLANGUAGE, SID_ATTR_NUMBERFORMAT_ONE_AREA, SID_ATTR_NUMBERFORMAT_ONE_AREA, + SID_ATTR_NUMBERFORMAT_NOLANGUAGE, SID_ATTR_NUMBERFORMAT_NOLANGUAGE, SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE>::value); /************************************************************************* diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index ac9a0da25866..fc0e3d90ef92 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -723,9 +723,6 @@ WhichRangesContainer SvxSwPosSizeTabPage::GetRanges() { static const WhichRangesContainer ranges(svl::Items< SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_POS_Y, - SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_PROTECT_POS, - SID_ATTR_TRANSFORM_INTERN, SID_ATTR_TRANSFORM_INTERN, - SID_ATTR_TRANSFORM_ANCHOR, SID_ATTR_TRANSFORM_VERT_ORIENT, SID_ATTR_TRANSFORM_WIDTH, SID_ATTR_TRANSFORM_SIZE_POINT, SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_INTERN, SID_ATTR_TRANSFORM_AUTOWIDTH, SID_ATTR_TRANSFORM_VERT_ORIENT, diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx index 8e0c86eaea59..3169b723e37d 100644 --- a/cui/source/tabpages/tpshadow.cxx +++ b/cui/source/tabpages/tpshadow.cxx @@ -43,9 +43,10 @@ using namespace com::sun::star; const WhichRangesContainer SvxShadowTabPage::pShadowRanges(svl::Items< SDRATTR_SHADOWCOLOR, SDRATTR_SHADOWTRANSPARENCE, - SDRATTR_SHADOWBLUR, SID_ATTR_FILL_SHADOW, - SID_ATTR_FILL_SHADOW, SID_ATTR_SHADOW_TRANSPARENCE, - SID_ATTR_SHADOW_BLUR, SID_ATTR_SHADOW_YDISTANCE + SDRATTR_SHADOWBLUR, SDRATTR_SHADOWBLUR, + SID_ATTR_FILL_SHADOW, SID_ATTR_FILL_SHADOW, + SID_ATTR_SHADOW_BLUR, SID_ATTR_SHADOW_BLUR, + SID_ATTR_SHADOW_TRANSPARENCE, SID_ATTR_SHADOW_YDISTANCE >::value); SvxShadowTabPage::SvxShadowTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs) diff --git a/cui/source/tabpages/tptrans.cxx b/cui/source/tabpages/tptrans.cxx index 594a41ecf704..c50d6728c544 100644 --- a/cui/source/tabpages/tptrans.cxx +++ b/cui/source/tabpages/tptrans.cxx @@ -35,8 +35,8 @@ using namespace com::sun::star; const WhichRangesContainer SvxTransparenceTabPage::pTransparenceRanges(svl::Items< XATTR_FILLTRANSPARENCE, XATTR_FILLTRANSPARENCE, - SDRATTR_SHADOWTRANSPARENCE, SDRATTR_SHADOWTRANSPARENCE, - XATTR_FILLFLOATTRANSPARENCE, XATTR_FILLFLOATTRANSPARENCE + XATTR_FILLFLOATTRANSPARENCE, XATTR_FILLFLOATTRANSPARENCE, + SDRATTR_SHADOWTRANSPARENCE, SDRATTR_SHADOWTRANSPARENCE >::value); /************************************************************************* diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 6737aba40f67..eec4b1e87566 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -45,12 +45,10 @@ const WhichRangesContainer SvxPositionSizeTabPage::pPosSizeRanges(svl::Items< SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_POS_Y, - SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_PROTECT_POS, - SID_ATTR_TRANSFORM_INTERN, SID_ATTR_TRANSFORM_INTERN, - SID_ATTR_TRANSFORM_ANCHOR, SID_ATTR_TRANSFORM_VERT_ORIENT, SID_ATTR_TRANSFORM_WIDTH, SID_ATTR_TRANSFORM_SIZE_POINT, SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_INTERN, - SID_ATTR_TRANSFORM_AUTOWIDTH, SID_ATTR_TRANSFORM_AUTOHEIGHT + SID_ATTR_TRANSFORM_AUTOWIDTH, SID_ATTR_TRANSFORM_AUTOHEIGHT, + SID_ATTR_TRANSFORM_ANCHOR, SID_ATTR_TRANSFORM_VERT_ORIENT >::value); const WhichRangesContainer SvxAngleTabPage::pAngleRanges(svl::Items< @@ -60,8 +58,8 @@ const WhichRangesContainer SvxAngleTabPage::pAngleRanges(svl::Items< const WhichRangesContainer SvxSlantTabPage::pSlantRanges(svl::Items< SDRATTR_CORNER_RADIUS, SDRATTR_CORNER_RADIUS, - SID_ATTR_TRANSFORM_SHEAR, SID_ATTR_TRANSFORM_SHEAR_VERTICAL, - SID_ATTR_TRANSFORM_INTERN, SID_ATTR_TRANSFORM_INTERN + SID_ATTR_TRANSFORM_INTERN, SID_ATTR_TRANSFORM_INTERN, + SID_ATTR_TRANSFORM_SHEAR, SID_ATTR_TRANSFORM_SHEAR_VERTICAL >::value); /************************************************************************* |