[Libreoffice-commits] core.git: 2 commits - reportdesign/source sc/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 16 06:03:32 UTC 2021


 reportdesign/source/ui/misc/UITools.cxx            |    8 +++-----
 reportdesign/source/ui/report/ReportController.cxx |   16 ++++++----------
 sc/source/ui/dbgui/validate.cxx                    |    8 +++-----
 sc/source/ui/inc/validate.hxx                      |    4 ++--
 4 files changed, 14 insertions(+), 22 deletions(-)

New commits:
commit 2f8095a1b412f8f57d02a9b1c2e2dcd382585143
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jul 15 21:49:32 2021 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Jul 16 08:03:08 2021 +0200

    use WhichRangesContainer in sc
    
    Change-Id: Ie14250245aa2a8618b3ad6b7a355942621b40833
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118998
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 0946c1163f11..a3fca1d8822f 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -75,12 +75,10 @@
 
 namespace ValidListType = css::sheet::TableValidationVisibility;
 
-const sal_uInt16 ScTPValidationValue::pValueRanges[] =
-{
+const WhichRangesContainer ScTPValidationValue::pValueRanges(svl::Items<
     FID_VALID_LISTTYPE, FID_VALID_LISTTYPE,
-    FID_VALID_MODE, FID_VALID_ERRTEXT,
-    0
-};
+    FID_VALID_MODE, FID_VALID_ERRTEXT
+>::value);
 
 ScValidationDlg::ScValidationDlg(weld::Window* pParent, const SfxItemSet* pArgSet,
     ScTabViewShell *pTabViewSh)
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 495a6ea5ad72..6117e87b7984 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -75,13 +75,13 @@ class ScValidationDlg;
 /** The tab page "Criteria" from the Validation dialog. */
 class ScTPValidationValue : public ScRefHandlerCaller, public SfxTabPage
 {
-    static const sal_uInt16 pValueRanges[];
+    static const WhichRangesContainer pValueRanges;
 public:
     explicit                    ScTPValidationValue(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rArgSet);
     static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rArgSet );
     virtual                     ~ScTPValidationValue() override;
 
-    static const sal_uInt16*    GetRanges() { return pValueRanges; }
+    static const WhichRangesContainer& GetRanges() { return pValueRanges; }
 
     virtual bool                FillItemSet( SfxItemSet* rArgSet ) override;
     virtual void                Reset( const SfxItemSet* rArgSet ) override;
commit 8b08529d6506bfcba9b5658429a1cf4f59c5fbcd
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jul 15 21:48:57 2021 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Jul 16 08:02:56 2021 +0200

    use WhichRangesContainer in reportdesign
    
    Change-Id: I8ae7e48a1fd0bd5504d68b04ee0af3b3d51d58cd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118997
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

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<report::XReportControlFormat >& _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<SfxItemPool> 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<report::XSection>& _
 
     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<SfxItemPool> 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<SfxItemPool> 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


More information about the Libreoffice-commits mailing list