diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/hdft.cxx | 57 | ||||
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 34 |
2 files changed, 42 insertions, 49 deletions
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 1189cab8ae55..0cd7e9102abd 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -202,30 +202,25 @@ bool SvxHFPage::FillItemSet( SfxItemSet* rSet ) const sal_uInt16 nWBoxInfo = GetWhich(SID_ATTR_BORDER_INNER); const sal_uInt16 nWShadow = GetWhich(SID_ATTR_BORDER_SHADOW); - const sal_uInt16 aWhichTab[] = { - nWSize, nWSize, - nWLRSpace, nWLRSpace, - nWULSpace, nWULSpace, - nWOn, nWOn, - nWDynamic, nWDynamic, - nWShared, nWShared, - nWSharedFirst, nWSharedFirst, - nWBrush, nWBrush, - nWBoxInfo, nWBoxInfo, - nWBox, nWBox, - nWShadow, nWShadow, - nWDynSpacing, nWDynSpacing, - - // take over DrawingLayer FillStyles - XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014 - - 0, 0}; - const SfxItemSet& rOldSet = GetItemSet(); SfxItemPool* pPool = rOldSet.GetPool(); DBG_ASSERT(pPool,"no pool :-("); MapUnit eUnit = pPool->GetMetric(nWSize); - SfxItemSet aSet(*pPool,aWhichTab); + // take over DrawingLayer FillStyles + SfxItemSet aSet(*pPool, svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); + // Keep it valid + aSet.MergeRange(nWSize, nWSize); + aSet.MergeRange(nWLRSpace, nWLRSpace); + aSet.MergeRange(nWULSpace, nWULSpace); + aSet.MergeRange(nWOn, nWOn); + aSet.MergeRange(nWDynamic, nWDynamic); + aSet.MergeRange(nWShared, nWShared); + aSet.MergeRange(nWSharedFirst, nWSharedFirst); + aSet.MergeRange(nWBrush, nWBrush); + aSet.MergeRange(nWBoxInfo, nWBoxInfo); + aSet.MergeRange(nWBox, nWBox); + aSet.MergeRange(nWShadow, nWShadow); + aSet.MergeRange(nWDynSpacing, nWDynSpacing); if(mbEnableDrawingLayerFillStyles) { @@ -540,11 +535,12 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button&, void) { pBBSet.reset(new SfxItemSet( *GetItemSet().GetPool(), - {{XATTR_FILL_FIRST, XATTR_FILL_LAST}, // DrawingLayer FillStyle definitions - {SID_COLOR_TABLE, SID_PATTERN_LIST}, // XPropertyLists for Color, Gradient, Hatch and Graphic fills - {nOuter, nOuter}, - {nInner, nInner}, - {nShadow, nShadow}})); + svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST, // DrawingLayer FillStyle definitions + SID_COLOR_TABLE, SID_PATTERN_LIST>{})); // XPropertyLists for Color, Gradient, Hatch and Graphic fills + // Keep it valid + pBBSet->MergeRange(nOuter, nOuter); + pBBSet->MergeRange(nInner, nInner); + pBBSet->MergeRange(nShadow, nShadow); // copy items for XPropertyList entries from the DrawModel so that // the Area TabPage can access them @@ -577,11 +573,12 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button&, void) pBBSet.reset( new SfxItemSet( *GetItemSet().GetPool(), - {{XATTR_FILL_FIRST, XATTR_FILL_LAST}, - {nBrush, nBrush}, - {nOuter, nOuter}, - {nInner, nInner}, - {nShadow, nShadow}}) ); + svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}) ); + // Keep it valid + pBBSet->MergeRange(nBrush, nBrush); + pBBSet->MergeRange(nOuter, nOuter); + pBBSet->MergeRange(nInner, nInner); + pBBSet->MergeRange(nShadow, nShadow); } const SfxPoolItem* pItem; diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index a8da538afbb4..50ac7499ee85 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -2628,25 +2628,21 @@ bool SdrObjEditView::SupportsFormatPaintbrush(SdrInventor nObjectInventor, static const sal_uInt16* GetFormatRangeImpl(bool bTextOnly) { - static const sal_uInt16 gRanges[] = { SDRATTR_SHADOW_FIRST, - SDRATTR_SHADOW_LAST, - SDRATTR_GRAF_FIRST, - SDRATTR_GRAF_LAST, - SDRATTR_TABLE_FIRST, - SDRATTR_TABLE_LAST, - XATTR_LINE_FIRST, - XATTR_LINE_LAST, - XATTR_FILL_FIRST, - XATTRSET_FILL, - EE_PARA_START, - EE_PARA_END, // text-only from here on - EE_CHAR_START, - EE_CHAR_END, - SDRATTR_MISC_FIRST, - SDRATTR_MISC_LAST, // table cell formats - 0, - 0 }; - return &gRanges[bTextOnly ? 10 : 0]; + static constexpr auto gFull + = svl::ItemsArray({ { XATTR_LINE_FIRST, XATTR_LINE_LAST }, + { XATTR_FILL_FIRST, XATTRSET_FILL }, + { SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST }, + { SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST }, // table cell formats + { SDRATTR_GRAF_FIRST, SDRATTR_GRAF_LAST }, + { SDRATTR_TABLE_FIRST, SDRATTR_TABLE_LAST }, + { EE_PARA_START, EE_PARA_END }, + { EE_CHAR_START, EE_CHAR_END } }); + + static constexpr auto gTextOnly = svl::ItemsArray({ { SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST }, + { EE_PARA_START, EE_PARA_END }, + { EE_CHAR_START, EE_CHAR_END } }); + + return bTextOnly ? gTextOnly.data() : gFull.data(); } void SdrObjEditView::TakeFormatPaintBrush(std::shared_ptr<SfxItemSet>& rFormatSet) |