From 8b08529d6506bfcba9b5658429a1cf4f59c5fbcd Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 15 Jul 2021 21:48:57 +0200 Subject: use WhichRangesContainer in reportdesign Change-Id: I8ae7e48a1fd0bd5504d68b04ee0af3b3d51d58cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118997 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- reportdesign/source/ui/misc/UITools.cxx | 8 +++----- reportdesign/source/ui/report/ReportController.cxx | 16 ++++++---------- 2 files changed, 9 insertions(+), 15 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index a9fc081556fb..115fa2fabf59 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -721,11 +721,9 @@ bool openCharDialog( const uno::Reference& _rxRep OSL_ASSERT( pDefaults.size() == SAL_N_ELEMENTS(aItemInfos) ); - static const sal_uInt16 pRanges[] = - { - XATTR_FILL_FIRST, ITEMID_WEIGHT_COMPLEX, - 0 - }; + static const WhichRangesContainer pRanges(svl::Items< + XATTR_FILL_FIRST, ITEMID_WEIGHT_COMPLEX + >::value); rtl::Reference pPool(new SfxItemPool("ReportCharProperties", XATTR_FILL_FIRST,ITEMID_WEIGHT_COMPLEX, aItemInfos, &pDefaults)); // not needed for font height pPool->SetDefaultMetric( MapUnit::Map100thMM ); // ripped, don't understand why diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index e50c5e20fbdc..c6305dba182b 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -2363,12 +2363,10 @@ void OReportController::openPageDialog(const uno::Reference& _ MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); FieldUnit eUserMetric = MeasurementSystem::Metric == eSystem ? FieldUnit::CM : FieldUnit::INCH; - static const sal_uInt16 pRanges[] = - { + static const WhichRangesContainer pRanges(svl::Items< RPTUI_ID_LRSPACE, XATTR_FILL_LAST, - SID_ATTR_METRIC,SID_ATTR_METRIC, - 0 - }; + SID_ATTR_METRIC,SID_ATTR_METRIC + >::value); rtl::Reference pPool( new SfxItemPool("ReportPageProperties", RPTUI_ID_LRSPACE, RPTUI_ID_METRIC, aItemInfos ) ); const Graphic aNullGraphic; @@ -4214,11 +4212,9 @@ void OReportController::openZoomDialog() { new SvxZoomItem() }; - static const sal_uInt16 pRanges[] = - { - SID_ATTR_ZOOM,SID_ATTR_ZOOM, - 0 - }; + static const WhichRangesContainer pRanges(svl::Items< + SID_ATTR_ZOOM,SID_ATTR_ZOOM + >::value); rtl::Reference pPool( new SfxItemPool("ZoomProperties", SID_ATTR_ZOOM,SID_ATTR_ZOOM, aItemInfos, &pDefaults) ); pPool->SetDefaultMetric( MapUnit::Map100thMM ); // ripped, don't understand why pPool->FreezeIdRanges(); // the same -- cgit