summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-18 08:55:06 +0200
committerEike Rathke <erack@redhat.com>2016-05-24 13:14:25 +0000
commit2bc173abb63b2146c05fdea79c239b82c1bc5daf (patch)
treed2267e4529c0f689eb78b1347f5ad068b7f99321
parentd31935043f7b4ce44811cd6de51f64eb207a6b3a (diff)
convert PIVOT_FUNC to scoped enum
Change-Id: I6d50ad6fa0dbe7b21ad73e14dc2df3c854d08153 Reviewed-on: https://gerrit.libreoffice.org/25076 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/inc/dapiuno.hxx4
-rw-r--r--sc/inc/dpglobal.hxx34
-rw-r--r--sc/inc/pivot.hxx8
-rw-r--r--sc/inc/scabstdlg.hxx4
-rw-r--r--sc/source/core/data/dpobject.cxx18
-rw-r--r--sc/source/core/data/pivot2.cxx6
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx4
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx4
-rw-r--r--sc/source/ui/dbgui/PivotLayoutDialog.cxx2
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeListData.cxx32
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx50
-rw-r--r--sc/source/ui/inc/PivotLayoutDialog.hxx2
-rw-r--r--sc/source/ui/inc/pvfundlg.hxx8
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx56
14 files changed, 120 insertions, 112 deletions
diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx
index 8d7b324fee8f..b4b8d6e26837 100644
--- a/sc/inc/dapiuno.hxx
+++ b/sc/inc/dapiuno.hxx
@@ -70,8 +70,8 @@ class ScDataPilotItemObj;
class ScDataPilotConversion
{
public:
- static css::sheet::GeneralFunction FirstFunc( sal_uInt16 nBits );
- static sal_uInt16 FunctionBit( css::sheet::GeneralFunction eFunc );
+ static css::sheet::GeneralFunction FirstFunc( PivotFunc nBits );
+ static PivotFunc FunctionBit( css::sheet::GeneralFunction eFunc );
static void FillGroupInfo(
css::sheet::DataPilotFieldGroupInfo& rInfo,
diff --git a/sc/inc/dpglobal.hxx b/sc/inc/dpglobal.hxx
index 3bbaeab2548c..e6ca2c2ea838 100644
--- a/sc/inc/dpglobal.hxx
+++ b/sc/inc/dpglobal.hxx
@@ -20,20 +20,28 @@
#ifndef INCLUDED_SC_INC_DPGLOBAL_HXX
#define INCLUDED_SC_INC_DPGLOBAL_HXX
+#include <o3tl/typed_flags_set.hxx>
+
#define PIVOT_MAXFUNC 11
-#define PIVOT_FUNC_NONE 0x0000
-#define PIVOT_FUNC_SUM 0x0001
-#define PIVOT_FUNC_COUNT 0x0002
-#define PIVOT_FUNC_AVERAGE 0x0004
-#define PIVOT_FUNC_MAX 0x0008
-#define PIVOT_FUNC_MIN 0x0010
-#define PIVOT_FUNC_PRODUCT 0x0020
-#define PIVOT_FUNC_COUNT_NUM 0x0040
-#define PIVOT_FUNC_STD_DEV 0x0080
-#define PIVOT_FUNC_STD_DEVP 0x0100
-#define PIVOT_FUNC_STD_VAR 0x0200
-#define PIVOT_FUNC_STD_VARP 0x0400
-#define PIVOT_FUNC_AUTO 0x1000
+
+enum class PivotFunc {
+ NONE = 0x0000,
+ Sum = 0x0001,
+ Count = 0x0002,
+ Average = 0x0004,
+ Max = 0x0008,
+ Min = 0x0010,
+ Product = 0x0020,
+ CountNum = 0x0040,
+ StdDev = 0x0080,
+ StdDevP = 0x0100,
+ StdVar = 0x0200,
+ StdVarP = 0x0400,
+ Auto = 0x1000
+};
+namespace o3tl {
+ template<> struct typed_flags<PivotFunc> : is_typed_flags<PivotFunc, 0x17ff> {};
+}
struct ScDPValue
{
diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx
index c0c21cca1860..ae3fdd5a9167 100644
--- a/sc/inc/pivot.hxx
+++ b/sc/inc/pivot.hxx
@@ -69,7 +69,7 @@ struct ScDPLabelData
OUString maSubtotalName;
SCCOL mnCol; ///< 0-based field index (not the source column index)
long mnOriginalDim; ///< original dimension index (>= 0 for duplicated dimension)
- sal_uInt16 mnFuncMask; ///< Page/Column/Row subtotal function.
+ PivotFunc mnFuncMask; ///< Page/Column/Row subtotal function.
sal_Int32 mnUsedHier; ///< Used hierarchy.
sal_Int32 mnFlags; ///< Flags from the DataPilotSource dimension
sal_uInt8 mnDupCount;
@@ -115,7 +115,7 @@ struct ScPivotField
{
SCCOL nCol; ///< 0-based dimension index (not source column index)
long mnOriginalDim; ///< >= 0 for duplicated field.
- sal_uInt16 nFuncMask;
+ PivotFunc nFuncMask;
sal_uInt8 mnDupCount;
css::sheet::DataPilotFieldReference maFieldRef;
@@ -157,12 +157,12 @@ struct ScPivotFuncData
{
SCCOL mnCol;
long mnOriginalDim;
- sal_uInt16 mnFuncMask;
+ PivotFunc mnFuncMask;
sal_uInt8 mnDupCount;
css::sheet::DataPilotFieldReference maFieldRef;
- explicit ScPivotFuncData( SCCOL nCol, sal_uInt16 nFuncMask );
+ explicit ScPivotFuncData( SCCOL nCol, PivotFunc nFuncMask );
#if DEBUG_PIVOT_TABLE
void Dump() const;
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index 050672a45bc0..8c6c6c50677f 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -240,14 +240,14 @@ public:
class AbstractScDPFunctionDlg : public VclAbstractDialog
{
public:
- virtual sal_uInt16 GetFuncMask() const = 0;
+ virtual PivotFunc GetFuncMask() const = 0;
virtual css::sheet::DataPilotFieldReference GetFieldRef() const = 0;
};
class AbstractScDPSubtotalDlg : public VclAbstractDialog
{
public:
- virtual sal_uInt16 GetFuncMask() const = 0;
+ virtual PivotFunc GetFuncMask() const = 0;
virtual void FillLabelData( ScDPLabelData& rLabelData ) const = 0;
};
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 23bfd0e767f4..5b4e9d6fb35e 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -1991,7 +1991,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb
}
}
-static sal_uInt16 lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimProp ) // PIVOT_FUNC mask
+static PivotFunc lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimProp ) // PIVOT_FUNC mask
{
uno::Reference<sheet::XHierarchiesSupplier> xDimSupp( xDimProp, uno::UNO_QUERY );
if ( xDimProp.is() && xDimSupp.is() )
@@ -2024,7 +2024,7 @@ static sal_uInt16 lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>&
uno::Sequence<sheet::GeneralFunction> aSeq;
if ( aSubAny >>= aSeq )
{
- sal_uInt16 nMask = 0;
+ PivotFunc nMask = PivotFunc::NONE;
const sheet::GeneralFunction* pArray = aSeq.getConstArray();
long nCount = aSeq.getLength();
for (long i=0; i<nCount; i++)
@@ -2036,7 +2036,7 @@ static sal_uInt16 lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>&
}
OSL_FAIL("FirstSubTotal: NULL");
- return 0;
+ return PivotFunc::NONE;
}
namespace {
@@ -2044,9 +2044,9 @@ namespace {
class FindByColumn : public std::unary_function<ScPivotField, bool>
{
SCsCOL mnCol;
- sal_uInt16 mnMask;
+ PivotFunc mnMask;
public:
- FindByColumn(SCsCOL nCol, sal_uInt16 nMask) : mnCol(nCol), mnMask(nMask) {}
+ FindByColumn(SCsCOL nCol, PivotFunc nMask) : mnCol(nCol), mnMask(nMask) {}
bool operator() (const ScPivotField& r) const
{
return r.nCol == mnCol && r.nFuncMask == mnMask;
@@ -2090,7 +2090,7 @@ void lcl_FillOldFields( ScPivotFieldVector& rFields,
// Let's take this dimension.
// function mask.
- sal_uInt16 nMask = 0;
+ PivotFunc nMask = PivotFunc::NONE;
if ( nOrient == sheet::DataPilotFieldOrientation_DATA )
{
sheet::GeneralFunction eFunc = (sheet::GeneralFunction)ScUnoHelpFunctions::GetEnumProperty(
@@ -2540,7 +2540,7 @@ void ScDPObject::ConvertOrientation(
const ScPivotField& rField = *itr;
long nCol = rField.getOriginalDim();
- sal_uInt16 nFuncs = rField.nFuncMask;
+ PivotFunc nFuncs = rField.nFuncMask;
const sheet::DataPilotFieldReference& rFieldRef = rField.maFieldRef;
ScDPSaveDimension* pDim = nullptr;
@@ -2601,8 +2601,8 @@ void ScDPObject::ConvertOrientation(
sal_uInt16 nMask = 1;
for (sal_uInt16 nBit=0; nBit<16; nBit++)
{
- if ( nFuncs & nMask )
- nFuncArray[nFuncCount++] = sal::static_int_cast<sal_uInt16>(ScDataPilotConversion::FirstFunc( nMask ));
+ if ( nFuncs & (PivotFunc)nMask )
+ nFuncArray[nFuncCount++] = sal::static_int_cast<sal_uInt16>(ScDataPilotConversion::FirstFunc( (PivotFunc)nMask ));
nMask *= 2;
}
pDim->SetSubTotals( nFuncCount, nFuncArray );
diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx
index 4a1ba34d9dd8..62a2f3b508f0 100644
--- a/sc/source/core/data/pivot2.cxx
+++ b/sc/source/core/data/pivot2.cxx
@@ -73,7 +73,7 @@ OUString ScDPLabelData::Member::getDisplayName() const
ScDPLabelData::ScDPLabelData() :
mnCol(-1),
mnOriginalDim(-1),
- mnFuncMask(PIVOT_FUNC_NONE),
+ mnFuncMask(PivotFunc::NONE),
mnUsedHier(0),
mnFlags(0),
mnDupCount(0),
@@ -96,7 +96,7 @@ OUString ScDPLabelData::getDisplayName() const
ScPivotField::ScPivotField(SCCOL nNewCol) :
nCol(nNewCol),
mnOriginalDim(-1),
- nFuncMask(0),
+ nFuncMask(PivotFunc::NONE),
mnDupCount(0)
{}
@@ -171,7 +171,7 @@ ScPivotParam& ScPivotParam::operator=( const ScPivotParam& rPivotParam )
// ScPivotFuncData
-ScPivotFuncData::ScPivotFuncData( SCCOL nCol, sal_uInt16 nFuncMask ) :
+ScPivotFuncData::ScPivotFuncData( SCCOL nCol, PivotFunc nFuncMask ) :
mnCol( nCol ),
mnOriginalDim(-1),
mnFuncMask(nFuncMask),
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 178e589a8eda..5b26fecc6330 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -488,7 +488,7 @@ const ScQueryItem& AbstractScPivotFilterDlg_Impl::GetOutputItem()
return pDlg->GetOutputItem();
}
-sal_uInt16 AbstractScDPFunctionDlg_Impl::GetFuncMask() const
+PivotFunc AbstractScDPFunctionDlg_Impl::GetFuncMask() const
{
return pDlg->GetFuncMask();
}
@@ -498,7 +498,7 @@ css::sheet::DataPilotFieldReference AbstractScDPFunctionDlg_Impl::GetFieldRef()
return pDlg->GetFieldRef();
}
-sal_uInt16 AbstractScDPSubtotalDlg_Impl::GetFuncMask() const
+PivotFunc AbstractScDPSubtotalDlg_Impl::GetFuncMask() const
{
return pDlg->GetFuncMask();
}
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 0ec96c0682f8..d2d3626e44f1 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -292,14 +292,14 @@ class AbstractScPivotFilterDlg_Impl : public AbstractScPivotFilterDlg
class AbstractScDPFunctionDlg_Impl : public AbstractScDPFunctionDlg
{
DECL_ABSTDLG_BASE( AbstractScDPFunctionDlg_Impl, ScDPFunctionDlg)
- virtual sal_uInt16 GetFuncMask() const override;
+ virtual PivotFunc GetFuncMask() const override;
virtual css::sheet::DataPilotFieldReference GetFieldRef() const override;
};
class AbstractScDPSubtotalDlg_Impl : public AbstractScDPSubtotalDlg
{
DECL_ABSTDLG_BASE( AbstractScDPSubtotalDlg_Impl, ScDPSubtotalDlg)
- virtual sal_uInt16 GetFuncMask() const override;
+ virtual PivotFunc GetFuncMask() const override;
virtual void FillLabelData( ScDPLabelData& rLabelData ) const override;
};
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 2d538d98f7fe..dd8ef5d6c150 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -27,7 +27,7 @@
using namespace css::uno;
using namespace css::sheet;
-ScItemValue::ScItemValue(OUString const & aName, SCCOL nColumn, sal_uInt16 nFunctionMask) :
+ScItemValue::ScItemValue(OUString const & aName, SCCOL nColumn, PivotFunc nFunctionMask) :
maName(aName),
maFunctionData(nColumn, nFunctionMask),
mpOriginalItemValue(this)
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
index 32b069177a1c..dc24b8079b1b 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
@@ -26,28 +26,28 @@ VCL_BUILDER_FACTORY_ARGS(ScPivotLayoutTreeListData,
namespace
{
-OUString lclGetFunctionMaskName(const sal_uInt16 nFunctionMask)
+OUString lclGetFunctionMaskName(const PivotFunc nFunctionMask)
{
switch (nFunctionMask)
{
- case PIVOT_FUNC_SUM: return OUString("Sum");
- case PIVOT_FUNC_COUNT: return OUString("Count");
- case PIVOT_FUNC_AVERAGE: return OUString("Mean");
- case PIVOT_FUNC_MAX: return OUString("Max");
- case PIVOT_FUNC_MIN: return OUString("Min");
- case PIVOT_FUNC_PRODUCT: return OUString("Product");
- case PIVOT_FUNC_COUNT_NUM: return OUString("Count");
- case PIVOT_FUNC_STD_DEV: return OUString("StDev");
- case PIVOT_FUNC_STD_DEVP: return OUString("StDevP");
- case PIVOT_FUNC_STD_VAR: return OUString("Var");
- case PIVOT_FUNC_STD_VARP: return OUString("VarP");
+ case PivotFunc::Sum: return OUString("Sum");
+ case PivotFunc::Count: return OUString("Count");
+ case PivotFunc::Average: return OUString("Mean");
+ case PivotFunc::Max: return OUString("Max");
+ case PivotFunc::Min: return OUString("Min");
+ case PivotFunc::Product: return OUString("Product");
+ case PivotFunc::CountNum: return OUString("Count");
+ case PivotFunc::StdDev: return OUString("StDev");
+ case PivotFunc::StdDevP: return OUString("StDevP");
+ case PivotFunc::StdVar: return OUString("Var");
+ case PivotFunc::StdVarP: return OUString("VarP");
default:
break;
}
return OUString();
}
-OUString lclCreateDataItemName(const sal_uInt16 nFunctionMask, const OUString& rName, const sal_uInt8 nDuplicationCount)
+OUString lclCreateDataItemName(const PivotFunc nFunctionMask, const OUString& rName, const sal_uInt8 nDuplicationCount)
{
OUString aBuffer = lclGetFunctionMaskName(nFunctionMask) + " - " + rName;
if(nDuplicationCount > 0)
@@ -192,10 +192,10 @@ void ScPivotLayoutTreeListData::InsertEntryForItem(ScItemValue* pItemValue, sal_
ScPivotFuncData& rFunctionData = pDataItemValue->maFunctionData;
- if (rFunctionData.mnFuncMask == PIVOT_FUNC_NONE ||
- rFunctionData.mnFuncMask == PIVOT_FUNC_AUTO)
+ if (rFunctionData.mnFuncMask == PivotFunc::NONE ||
+ rFunctionData.mnFuncMask == PivotFunc::Auto)
{
- rFunctionData.mnFuncMask = PIVOT_FUNC_SUM;
+ rFunctionData.mnFuncMask = PivotFunc::Sum;
}
AdjustDuplicateCount(pDataItemValue);
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index c60169414bfb..45a503829223 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -95,19 +95,19 @@ bool lclFillListBox( ListBoxType& rLBox, const vector<ScDPLabelData::Member>& rM
}
/** This table represents the order of the strings in the resource string array. */
-static const sal_uInt16 spnFunctions[] =
-{
- PIVOT_FUNC_SUM,
- PIVOT_FUNC_COUNT,
- PIVOT_FUNC_AVERAGE,
- PIVOT_FUNC_MAX,
- PIVOT_FUNC_MIN,
- PIVOT_FUNC_PRODUCT,
- PIVOT_FUNC_COUNT_NUM,
- PIVOT_FUNC_STD_DEV,
- PIVOT_FUNC_STD_DEVP,
- PIVOT_FUNC_STD_VAR,
- PIVOT_FUNC_STD_VARP
+static const PivotFunc spnFunctions[] =
+{
+ PivotFunc::Sum,
+ PivotFunc::Count,
+ PivotFunc::Average,
+ PivotFunc::Max,
+ PivotFunc::Min,
+ PivotFunc::Product,
+ PivotFunc::CountNum,
+ PivotFunc::StdDev,
+ PivotFunc::StdDevP,
+ PivotFunc::StdVar,
+ PivotFunc::StdVarP
};
const sal_uInt16 SC_BASEITEM_PREV_POS = 0;
@@ -165,18 +165,18 @@ VCL_BUILDER_DECL_FACTORY(ScDPFunctionListBox)
rRet = VclPtr<ScDPFunctionListBox>::Create(pParent, nWinStyle);
}
-void ScDPFunctionListBox::SetSelection( sal_uInt16 nFuncMask )
+void ScDPFunctionListBox::SetSelection( PivotFunc nFuncMask )
{
- if( (nFuncMask == PIVOT_FUNC_NONE) || (nFuncMask == PIVOT_FUNC_AUTO) )
+ if( (nFuncMask == PivotFunc::NONE) || (nFuncMask == PivotFunc::Auto) )
SetNoSelection();
else
for( sal_Int32 nEntry = 0, nCount = GetEntryCount(); nEntry < nCount; ++nEntry )
- SelectEntryPos( nEntry, (nFuncMask & spnFunctions[ nEntry ]) != 0 );
+ SelectEntryPos( nEntry, bool(nFuncMask & spnFunctions[ nEntry ]) );
}
-sal_uInt16 ScDPFunctionListBox::GetSelection() const
+PivotFunc ScDPFunctionListBox::GetSelection() const
{
- sal_uInt16 nFuncMask = PIVOT_FUNC_NONE;
+ PivotFunc nFuncMask = PivotFunc::NONE;
for( sal_Int32 nSel = 0, nCount = GetSelectEntryCount(); nSel < nCount; ++nSel )
nFuncMask |= spnFunctions[ GetSelectEntryPos( nSel ) ];
return nFuncMask;
@@ -232,7 +232,7 @@ void ScDPFunctionDlg::dispose()
}
-sal_uInt16 ScDPFunctionDlg::GetFuncMask() const
+PivotFunc ScDPFunctionDlg::GetFuncMask() const
{
return mpLbFunc->GetSelection();
}
@@ -267,7 +267,7 @@ DataPilotFieldReference ScDPFunctionDlg::GetFieldRef() const
void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData )
{
// list box
- sal_uInt16 nFuncMask = (rFuncData.mnFuncMask == PIVOT_FUNC_NONE) ? PIVOT_FUNC_SUM : rFuncData.mnFuncMask;
+ PivotFunc nFuncMask = (rFuncData.mnFuncMask == PivotFunc::NONE) ? PivotFunc::Sum : rFuncData.mnFuncMask;
mpLbFunc->SetSelection( nFuncMask );
// field name
@@ -465,12 +465,12 @@ void ScDPSubtotalDlg::dispose()
ModalDialog::dispose();
}
-sal_uInt16 ScDPSubtotalDlg::GetFuncMask() const
+PivotFunc ScDPSubtotalDlg::GetFuncMask() const
{
- sal_uInt16 nFuncMask = PIVOT_FUNC_NONE;
+ PivotFunc nFuncMask = PivotFunc::NONE;
if( mpRbAuto->IsChecked() )
- nFuncMask = PIVOT_FUNC_AUTO;
+ nFuncMask = PivotFunc::Auto;
else if( mpRbUser->IsChecked() )
nFuncMask = mpLbFunc->GetSelection();
@@ -502,8 +502,8 @@ void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa
RadioButton* pRBtn = nullptr;
switch( rFuncData.mnFuncMask )
{
- case PIVOT_FUNC_NONE: pRBtn = mpRbNone; break;
- case PIVOT_FUNC_AUTO: pRBtn = mpRbAuto; break;
+ case PivotFunc::NONE: pRBtn = mpRbNone; break;
+ case PivotFunc::Auto: pRBtn = mpRbAuto; break;
default: pRBtn = mpRbUser;
}
pRBtn->Check();
diff --git a/sc/source/ui/inc/PivotLayoutDialog.hxx b/sc/source/ui/inc/PivotLayoutDialog.hxx
index 0ca732efb1cd..0d354e608a32 100644
--- a/sc/source/ui/inc/PivotLayoutDialog.hxx
+++ b/sc/source/ui/inc/PivotLayoutDialog.hxx
@@ -31,7 +31,7 @@ public:
ScPivotFuncData maFunctionData;
ScItemValue* mpOriginalItemValue;
- ScItemValue(OUString const & aName, SCCOL nColumn, sal_uInt16 nFunctionMask);
+ ScItemValue(OUString const & aName, SCCOL nColumn, PivotFunc nFunctionMask);
ScItemValue(ScItemValue* pInputItemValue);
virtual ~ScItemValue();
diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx
index 9a364c99c91e..bd0a4cf34ea5 100644
--- a/sc/source/ui/inc/pvfundlg.hxx
+++ b/sc/source/ui/inc/pvfundlg.hxx
@@ -47,8 +47,8 @@ class ScDPFunctionListBox : public ListBox
public:
ScDPFunctionListBox(vcl::Window* pParent, WinBits nStyle);
- void SetSelection( sal_uInt16 nFuncMask );
- sal_uInt16 GetSelection() const;
+ void SetSelection( PivotFunc nFuncMask );
+ PivotFunc GetSelection() const;
private:
void FillFunctionNames();
@@ -62,7 +62,7 @@ public:
const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData );
virtual ~ScDPFunctionDlg();
virtual void dispose() override;
- sal_uInt16 GetFuncMask() const;
+ PivotFunc GetFuncMask() const;
css::sheet::DataPilotFieldReference GetFieldRef() const;
private:
@@ -104,7 +104,7 @@ public:
const ScDPNameVec& rDataFields, bool bEnableLayout );
virtual ~ScDPSubtotalDlg();
virtual void dispose() override;
- sal_uInt16 GetFuncMask() const;
+ PivotFunc GetFuncMask() const;
void FillLabelData( ScDPLabelData& rLabelData ) const;
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 646ddace83fb..32f43a3784c1 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -178,40 +178,40 @@ SC_SIMPLE_SERVICE_INFO( ScDataPilotFieldGroupItemObj, "ScDataPilotFieldGroupItem
// name that is used in the API for the data layout field
#define SC_DATALAYOUT_NAME "Data"
-GeneralFunction ScDataPilotConversion::FirstFunc( sal_uInt16 nBits )
-{
- if ( nBits & PIVOT_FUNC_SUM ) return GeneralFunction_SUM;
- if ( nBits & PIVOT_FUNC_COUNT ) return GeneralFunction_COUNT;
- if ( nBits & PIVOT_FUNC_AVERAGE ) return GeneralFunction_AVERAGE;
- if ( nBits & PIVOT_FUNC_MAX ) return GeneralFunction_MAX;
- if ( nBits & PIVOT_FUNC_MIN ) return GeneralFunction_MIN;
- if ( nBits & PIVOT_FUNC_PRODUCT ) return GeneralFunction_PRODUCT;
- if ( nBits & PIVOT_FUNC_COUNT_NUM ) return GeneralFunction_COUNTNUMS;
- if ( nBits & PIVOT_FUNC_STD_DEV ) return GeneralFunction_STDEV;
- if ( nBits & PIVOT_FUNC_STD_DEVP ) return GeneralFunction_STDEVP;
- if ( nBits & PIVOT_FUNC_STD_VAR ) return GeneralFunction_VAR;
- if ( nBits & PIVOT_FUNC_STD_VARP ) return GeneralFunction_VARP;
- if ( nBits & PIVOT_FUNC_AUTO ) return GeneralFunction_AUTO;
+GeneralFunction ScDataPilotConversion::FirstFunc( PivotFunc nBits )
+{
+ if ( nBits & PivotFunc::Sum ) return GeneralFunction_SUM;
+ if ( nBits & PivotFunc::Count ) return GeneralFunction_COUNT;
+ if ( nBits & PivotFunc::Average ) return GeneralFunction_AVERAGE;
+ if ( nBits & PivotFunc::Max ) return GeneralFunction_MAX;
+ if ( nBits & PivotFunc::Min ) return GeneralFunction_MIN;
+ if ( nBits & PivotFunc::Product ) return GeneralFunction_PRODUCT;
+ if ( nBits & PivotFunc::CountNum ) return GeneralFunction_COUNTNUMS;
+ if ( nBits & PivotFunc::StdDev ) return GeneralFunction_STDEV;
+ if ( nBits & PivotFunc::StdDevP ) return GeneralFunction_STDEVP;
+ if ( nBits & PivotFunc::StdVar ) return GeneralFunction_VAR;
+ if ( nBits & PivotFunc::StdVarP ) return GeneralFunction_VARP;
+ if ( nBits & PivotFunc::Auto ) return GeneralFunction_AUTO;
return GeneralFunction_NONE;
}
-sal_uInt16 ScDataPilotConversion::FunctionBit( GeneralFunction eFunc )
+PivotFunc ScDataPilotConversion::FunctionBit( GeneralFunction eFunc )
{
- sal_uInt16 nRet = PIVOT_FUNC_NONE; // 0
+ PivotFunc nRet = PivotFunc::NONE; // 0
switch (eFunc)
{
- case GeneralFunction_SUM: nRet = PIVOT_FUNC_SUM; break;
- case GeneralFunction_COUNT: nRet = PIVOT_FUNC_COUNT; break;
- case GeneralFunction_AVERAGE: nRet = PIVOT_FUNC_AVERAGE; break;
- case GeneralFunction_MAX: nRet = PIVOT_FUNC_MAX; break;
- case GeneralFunction_MIN: nRet = PIVOT_FUNC_MIN; break;
- case GeneralFunction_PRODUCT: nRet = PIVOT_FUNC_PRODUCT; break;
- case GeneralFunction_COUNTNUMS: nRet = PIVOT_FUNC_COUNT_NUM; break;
- case GeneralFunction_STDEV: nRet = PIVOT_FUNC_STD_DEV; break;
- case GeneralFunction_STDEVP: nRet = PIVOT_FUNC_STD_DEVP; break;
- case GeneralFunction_VAR: nRet = PIVOT_FUNC_STD_VAR; break;
- case GeneralFunction_VARP: nRet = PIVOT_FUNC_STD_VARP; break;
- case GeneralFunction_AUTO: nRet = PIVOT_FUNC_AUTO; break;
+ case GeneralFunction_SUM: nRet = PivotFunc::Sum; break;
+ case GeneralFunction_COUNT: nRet = PivotFunc::Count; break;
+ case GeneralFunction_AVERAGE: nRet = PivotFunc::Average; break;
+ case GeneralFunction_MAX: nRet = PivotFunc::Max; break;
+ case GeneralFunction_MIN: nRet = PivotFunc::Min; break;
+ case GeneralFunction_PRODUCT: nRet = PivotFunc::Product; break;
+ case GeneralFunction_COUNTNUMS: nRet = PivotFunc::CountNum; break;
+ case GeneralFunction_STDEV: nRet = PivotFunc::StdDev; break;
+ case GeneralFunction_STDEVP: nRet = PivotFunc::StdDevP; break;
+ case GeneralFunction_VAR: nRet = PivotFunc::StdVar; break;
+ case GeneralFunction_VARP: nRet = PivotFunc::StdVarP; break;
+ case GeneralFunction_AUTO: nRet = PivotFunc::Auto; break;
default:
{
// added to avoid warnings