diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-31 13:07:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-03 06:22:40 +0000 |
commit | fcad02149f3a9964f36522d97faaf303fc321788 (patch) | |
tree | 86f2ba2af66bf02c93f78759667a836955fd6d3d | |
parent | 74917d23782413aa0f129bcf9e6bf5a1c496d23b (diff) |
use actual UNO enums in sc
Change-Id: I51dbe623178e3c463dc4c941f23edac04fbfe349
Reviewed-on: https://gerrit.libreoffice.org/35968
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
40 files changed, 146 insertions, 123 deletions
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index 277078c4aac1..bba11bc12378 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -31,6 +31,7 @@ #include <svl/broadcast.hxx> #include <comphelper/stl_types.hxx> +#include <com/sun/star/sheet/ConditionOperator.hpp> #include <rtl/math.hxx> #include <tools/date.hxx> @@ -270,7 +271,7 @@ public: virtual ScFormatEntry* Clone(ScDocument* pDoc) const override; - static ScConditionMode GetModeFromApi(sal_Int32 nOperator); + static ScConditionMode GetModeFromApi(css::sheet::ConditionOperator nOperator); virtual void endRendering() override; virtual void startRendering() override; diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 1b3031f662bc..2baea36b7654 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -173,10 +173,10 @@ public: bool IsDuplicated( long nDim ); long GetDimCount(); void GetHeaderPositionData(const ScAddress& rPos, css::sheet::DataPilotTableHeaderData& rData); - long GetHeaderDim( const ScAddress& rPos, sal_uInt16& rOrient ); + long GetHeaderDim( const ScAddress& rPos, css::sheet::DataPilotFieldOrientation& rOrient ); bool GetHeaderDrag( const ScAddress& rPos, bool bMouseLeft, bool bMouseTop, long nDragDim, - tools::Rectangle& rPosRect, sal_uInt16& rOrient, long& rDimPos ); + tools::Rectangle& rPosRect, css::sheet::DataPilotFieldOrientation& rOrient, long& rDimPos ); bool IsFilterButton( const ScAddress& rPos ); double GetPivotData( @@ -241,14 +241,14 @@ public: static void ConvertOrientation( ScDPSaveData& rSaveData, - const ScPivotFieldVector& rFields, sal_uInt16 nOrient, + const ScPivotFieldVector& rFields, css::sheet::DataPilotFieldOrientation nOrient, const css::uno::Reference< css::sheet::XDimensionsSupplier>& xSource, const ScDPLabelDataVector& rLabels, const ScPivotFieldVector* pRefColFields = nullptr, const ScPivotFieldVector* pRefRowFields = nullptr, const ScPivotFieldVector* pRefPageFields = nullptr ); - static bool IsOrientationAllowed( sal_uInt16 nOrient, sal_Int32 nDimFlags ); + static bool IsOrientationAllowed( css::sheet::DataPilotFieldOrientation nOrient, sal_Int32 nDimFlags ); #if DUMP_PIVOT_TABLE void Dump() const; diff --git a/sc/inc/dpoutput.hxx b/sc/inc/dpoutput.hxx index e6d97cc2620a..3e99e0e40d93 100644 --- a/sc/inc/dpoutput.hxx +++ b/sc/inc/dpoutput.hxx @@ -24,6 +24,7 @@ #include <com/sun/star/sheet/DataResult.hpp> #include <com/sun/star/sheet/MemberResult.hpp> #include <com/sun/star/sheet/DataPilotOutputRangeType.hpp> +#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include "global.hxx" #include "address.hxx" @@ -114,10 +115,10 @@ public: field region. */ bool GetDataResultPositionData(::std::vector< css::sheet::DataPilotFieldFilter >& rFilters, const ScAddress& rPos); - long GetHeaderDim( const ScAddress& rPos, sal_uInt16& rOrient ); + long GetHeaderDim( const ScAddress& rPos, css::sheet::DataPilotFieldOrientation& rOrient ); bool GetHeaderDrag( const ScAddress& rPos, bool bMouseLeft, bool bMouseTop, long nDragDim, - tools::Rectangle& rPosRect, sal_uInt16& rOrient, long& rDimPos ); + tools::Rectangle& rPosRect, css::sheet::DataPilotFieldOrientation& rOrient, long& rDimPos ); bool IsFilterButton( const ScAddress& rPos ); void GetMemberResultNames(ScDPUniqueStringSet& rNames, long nDimension); diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx index 624ed3f7e080..2fa247c76802 100644 --- a/sc/inc/dpsave.hxx +++ b/sc/inc/dpsave.hxx @@ -98,7 +98,7 @@ private: std::unique_ptr<OUString> mpSubtotalName; bool bIsDataLayout; bool bDupFlag; - sal_uInt16 nOrientation; + css::sheet::DataPilotFieldOrientation nOrientation; ScGeneralFunction nFunction; // for data dimensions long nUsedHierarchy; sal_uInt16 nShowEmptyMode; //! at level @@ -145,7 +145,7 @@ public: void SetName( const OUString& rNew ); // used if the source dim was renamed (groups) - void SetOrientation(sal_uInt16 nNew); + void SetOrientation(css::sheet::DataPilotFieldOrientation nNew); void SetSubTotals(std::vector<ScGeneralFunction> const & rFuncs); long GetSubTotalsCount() const { return maSubTotalFuncs.size(); } @@ -200,7 +200,7 @@ public: void SetCurrentPage( const OUString* pPage ); // NULL = no selection (all) OUString GetCurrentPage() const; // only for ODF compatibility - sal_uInt16 GetOrientation() const + css::sheet::DataPilotFieldOrientation GetOrientation() const { return nOrientation; } ScDPSaveMember* GetExistingMemberByName(const OUString& rName); @@ -314,7 +314,7 @@ public: void RemoveDimensionByName(const OUString& rName); - ScDPSaveDimension* GetInnermostDimension(sal_uInt16 nOrientation); + ScDPSaveDimension* GetInnermostDimension(css::sheet::DataPilotFieldOrientation nOrientation); ScDPSaveDimension* GetFirstDimension(css::sheet::DataPilotFieldOrientation eOrientation); long GetDataDimensionCount() const; diff --git a/sc/inc/dpsdbtab.hxx b/sc/inc/dpsdbtab.hxx index 2b6e6c37744a..7c284961423a 100644 --- a/sc/inc/dpsdbtab.hxx +++ b/sc/inc/dpsdbtab.hxx @@ -22,6 +22,8 @@ #include "dptabdat.hxx" +#include <com/sun/star/sheet/DataImportMode.hpp> + #include <unordered_set> #include <vector> @@ -34,11 +36,11 @@ struct ScImportSourceDesc { OUString aDBName; OUString aObject; - sal_uInt16 nType; // enum DataImportMode + css::sheet::DataImportMode nType; bool bNative; ScDocument* mpDoc; - ScImportSourceDesc(ScDocument* pDoc) : nType(0), bNative(false), mpDoc(pDoc) {} + ScImportSourceDesc(ScDocument* pDoc) : nType(css::sheet::DataImportMode_NONE), bNative(false), mpDoc(pDoc) {} bool operator== ( const ScImportSourceDesc& rOther ) const { return aDBName == rOther.aDBName && diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx index 766dfed47784..23e1bfa5e727 100644 --- a/sc/inc/dptabres.hxx +++ b/sc/inc/dptabres.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/sheet/MemberResult.hpp> #include <com/sun/star/sheet/DataResult.hpp> +#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <map> @@ -285,7 +286,7 @@ class ScDPResultData std::vector<ScSubTotalFunc> maMeasureFuncs; std::vector<css::sheet::DataPilotFieldReference> maMeasureRefs; - std::vector<sal_uInt16> maMeasureRefOrients; + std::vector<css::sheet::DataPilotFieldOrientation> maMeasureRefOrients; std::vector<OUString> maMeasureNames; bool bLateInit:1; @@ -301,9 +302,10 @@ public: void SetMeasureData( std::vector<ScSubTotalFunc>& rFunctions, std::vector<css::sheet::DataPilotFieldReference>& rRefs, - std::vector<sal_uInt16>& rRefOrient, std::vector<OUString>& rNames ); + std::vector<css::sheet::DataPilotFieldOrientation>& rRefOrient, + std::vector<OUString>& rNames ); - void SetDataLayoutOrientation( sal_uInt16 nOrient ); + void SetDataLayoutOrientation( css::sheet::DataPilotFieldOrientation nOrient ); void SetLateInit( bool bSet ); long GetMeasureCount() const { return maMeasureFuncs.size(); } @@ -311,7 +313,7 @@ public: OUString GetMeasureString(long nMeasure, bool bForce, ScSubTotalFunc eForceFunc, bool& rbTotalResult) const; OUString GetMeasureDimensionName(long nMeasure) const; const css::sheet::DataPilotFieldReference& GetMeasureRefVal(long nMeasure) const; - sal_uInt16 GetMeasureRefOrient(long nMeasure) const; + css::sheet::DataPilotFieldOrientation GetMeasureRefOrient(long nMeasure) const; bool IsLateInit() const { return bLateInit; } diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx index 9ee1a8e6ed80..10277c888a41 100644 --- a/sc/inc/dptabsrc.hxx +++ b/sc/inc/dptabsrc.hxx @@ -33,6 +33,7 @@ #include <com/sun/star/sheet/DataPilotFieldLayoutMode.hpp> #include <com/sun/star/sheet/DataPilotFieldReference.hpp> #include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp> +#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include <com/sun/star/util/XRefreshable.hpp> #include <com/sun/star/sheet/XDrillDownDataSupplier.hpp> #include <com/sun/star/util/XCloneable.hpp> @@ -118,7 +119,7 @@ private: void CreateRes_Impl(); void FillMemberResults(); - void FillLevelList( sal_uInt16 nOrientation, std::vector<ScDPLevel*> &rList ); + void FillLevelList( css::sheet::DataPilotFieldOrientation nOrientation, std::vector<ScDPLevel*> &rList ); void FillCalcInfo(bool bIsRow, ScDPTableData::CalcInfo& rInfo, bool &bHasAutoShow); /** @@ -151,8 +152,9 @@ public: const OUString* GetGrandTotalName() const; - sal_uInt16 GetOrientation(long nColumn); - void SetOrientation(long nColumn, sal_uInt16 nNew); + css::sheet::DataPilotFieldOrientation + GetOrientation(long nColumn); + void SetOrientation(long nColumn, css::sheet::DataPilotFieldOrientation nNew); long GetPosition(long nColumn); long GetDataDimensionCount(); @@ -161,7 +163,8 @@ public: const ScDPCache* GetCache(); const ScDPItemData* GetItemDataById( long nDim, long nId ); bool IsDataLayoutDimension(long nDim); - sal_uInt16 GetDataLayoutOrientation(); + css::sheet::DataPilotFieldOrientation + GetDataLayoutOrientation(); bool IsDateDimension(long nDim); @@ -329,7 +332,7 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - sal_uInt16 getOrientation() const; + css::sheet::DataPilotFieldOrientation getOrientation() const; bool getIsDataLayoutDimension() const; ScGeneralFunction getFunction() const { return nFunction;} void setFunction(ScGeneralFunction nNew); // for data dimension diff --git a/sc/inc/generalfunction.hxx b/sc/inc/generalfunction.hxx index 0716f83e66d5..69c94b0529e5 100644 --- a/sc/inc/generalfunction.hxx +++ b/sc/inc/generalfunction.hxx @@ -30,69 +30,69 @@ enum class ScGeneralFunction { /** nothing is calculated. */ - NONE = css::sheet::GeneralFunction_NONE, + NONE = (int)css::sheet::GeneralFunction_NONE, /** function is determined automatically. <p>If the values are all numerical, SUM is used, otherwise COUNT.</p> */ - AUTO = css::sheet::GeneralFunction_AUTO, + AUTO = (int)css::sheet::GeneralFunction_AUTO, /** sum of all numerical values is calculated. */ - SUM = css::sheet::GeneralFunction_SUM, + SUM = (int)css::sheet::GeneralFunction_SUM, /** all values, including non-numerical values, are counted. */ - COUNT = css::sheet::GeneralFunction_COUNT, + COUNT = (int)css::sheet::GeneralFunction_COUNT, /** average of all numerical values is calculated. */ - AVERAGE = css::sheet::GeneralFunction_AVERAGE, + AVERAGE = (int)css::sheet::GeneralFunction_AVERAGE, /** maximum value of all numerical values is calculated. */ - MAX = css::sheet::GeneralFunction_MAX, + MAX = (int)css::sheet::GeneralFunction_MAX, /** minimum value of all numerical values is calculated. */ - MIN = css::sheet::GeneralFunction_MIN, + MIN = (int)css::sheet::GeneralFunction_MIN, /** product of all numerical values is calculated. */ - PRODUCT = css::sheet::GeneralFunction_PRODUCT, + PRODUCT = (int)css::sheet::GeneralFunction_PRODUCT, /** numerical values are counted. */ - COUNTNUMS = css::sheet::GeneralFunction_COUNTNUMS, + COUNTNUMS = (int)css::sheet::GeneralFunction_COUNTNUMS, /** standard deviation is calculated based on a sample. */ - STDEV = css::sheet::GeneralFunction_STDEV, + STDEV = (int)css::sheet::GeneralFunction_STDEV, /** standard deviation is calculated based on the entire population. */ - STDEVP = css::sheet::GeneralFunction_STDEVP, + STDEVP = (int)css::sheet::GeneralFunction_STDEVP, /** variance is calculated based on a sample. */ - VAR = css::sheet::GeneralFunction_VAR, + VAR = (int)css::sheet::GeneralFunction_VAR, /** variance is calculated based on the entire population. */ - VARP = css::sheet::GeneralFunction_VARP, + VARP = (int)css::sheet::GeneralFunction_VARP, /** * median of all numerical values is calculated. diff --git a/sc/inc/miscuno.hxx b/sc/inc/miscuno.hxx index e3af738b95b9..dd50fbac5cb6 100644 --- a/sc/inc/miscuno.hxx +++ b/sc/inc/miscuno.hxx @@ -134,8 +134,11 @@ public: const OUString& rName, sal_Int16 nDefault ); static sal_Int32 GetLongProperty( const css::uno::Reference< css::beans::XPropertySet>& xProp, const OUString& rName ); - static sal_Int32 GetEnumProperty( const css::uno::Reference< css::beans::XPropertySet>& xProp, - const OUString& rName, long nDefault ); + template<typename EnumT> + static EnumT GetEnumProperty( const css::uno::Reference< css::beans::XPropertySet>& xProp, + const OUString& rName, EnumT nDefault ) + { return static_cast<EnumT>(GetEnumPropertyImpl(xProp, rName, static_cast<sal_Int32>(nDefault))); } + static OUString GetStringProperty( const css::uno::Reference<css::beans::XPropertySet>& xProp, const OUString& rName, const OUString& rDefault ); @@ -167,6 +170,9 @@ public: return css::uno::Sequence<ValueType>(&rVector[0], static_cast<sal_Int32>(rVector.size())); } +private: + static sal_Int32 GetEnumPropertyImpl( const css::uno::Reference< css::beans::XPropertySet>& xProp, + const OUString& rName, sal_Int32 nDefault ); }; #endif diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index aaffffb57122..10e962129758 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -496,7 +496,7 @@ public: virtual VclPtr<AbstractScDPShowDetailDlg> CreateScDPShowDetailDlg( vcl::Window* pParent, ScDPObject& rDPObj, - sal_uInt16 nOrient ) = 0; + css::sheet::DataPilotFieldOrientation nOrient ) = 0; virtual VclPtr<AbstractScNewScenarioDlg> CreateScNewScenarioDlg ( vcl::Window* pParent, const OUString& rName, bool bEdit, bool bSheetProtected ) = 0; diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index f838659d81ee..f9dd4bbb0e12 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -374,6 +374,16 @@ std::ostream& operator<<(std::ostream& os, SvxBorderLineStyle n) return os; } +namespace com { namespace sun { namespace star { namespace sheet { + +std::ostream& operator<<(std::ostream& rStrm, DataPilotFieldOrientation n) +{ + rStrm << (int) n; + return rStrm; +} + +} } } } + bool ScFiltersTest::load(const OUString &rFilter, const OUString &rURL, const OUString &rUserData, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) @@ -1882,11 +1892,11 @@ void ScFiltersTest::testPivotTableNamedRangeSourceODS() CPPUNIT_ASSERT(pDesc); CPPUNIT_ASSERT_EQUAL(OUString("MyRange"), pDesc->GetRangeName()); - sal_uInt16 nOrient; + css::sheet::DataPilotFieldOrientation nOrient; long nDim = pDP->GetHeaderDim(ScAddress(0,1,1), nOrient); CPPUNIT_ASSERT_EQUAL_MESSAGE("Failed to detect header dimension.", long(0), nDim); CPPUNIT_ASSERT_EQUAL_MESSAGE("This dimension should be a page dimension.", - static_cast<sal_uInt16>(sheet::DataPilotFieldOrientation_PAGE), nOrient); + sheet::DataPilotFieldOrientation_PAGE, nOrient); xDocSh->DoClose(); } diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx index 28b6835221e9..1706f63b03e5 100644 --- a/sc/qa/unit/ucalc_pivottable.cxx +++ b/sc/qa/unit/ucalc_pivottable.cxx @@ -109,7 +109,7 @@ ScDPObject* createDPFromSourceDesc( { OUString aDimName = OUString::createFromAscii(aFields[i].pName); ScDPSaveDimension* pDim = aSaveData.GetNewDimensionByName(aDimName); - pDim->SetOrientation(static_cast<sal_uInt16>(aFields[i].eOrient)); + pDim->SetOrientation(aFields[i].eOrient); pDim->SetUsedHierarchy(0); if (aFields[i].eOrient == sheet::DataPilotFieldOrientation_DATA) diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index f4f0f116ba61..a692f27807d5 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1489,10 +1489,10 @@ ScFormatEntry* ScConditionEntry::Clone(ScDocument* pDoc) const return new ScConditionEntry(pDoc, *this); } -ScConditionMode ScConditionEntry::GetModeFromApi(sal_Int32 nOperation) +ScConditionMode ScConditionEntry::GetModeFromApi(css::sheet::ConditionOperator nOperation) { ScConditionMode eMode = SC_COND_NONE; - switch (nOperation) + switch ((sal_Int32)nOperation) { case css::sheet::ConditionOperator2::EQUAL: eMode = SC_COND_EQUAL; diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 957d16fa20f7..6b1f12a1f4a5 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -258,9 +258,9 @@ void DBConnector::getValue(long nCol, ScDPItemData &rData, short& rNumType) cons } -sal_uInt16 lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) +sheet::DataPilotFieldOrientation lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) { - long nRet = sheet::DataPilotFieldOrientation_HIDDEN; + sheet::DataPilotFieldOrientation nRet = sheet::DataPilotFieldOrientation_HIDDEN; if ( xSource.is() ) { uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions(); @@ -284,7 +284,7 @@ sal_uInt16 lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSup } } } - return static_cast< sal_uInt16 >( nRet ); + return nRet; } ScDPServiceDesc::ScDPServiceDesc( @@ -1422,7 +1422,7 @@ bool ScDPObject::IsFilterButton( const ScAddress& rPos ) return pOutput->IsFilterButton( rPos ); } -long ScDPObject::GetHeaderDim( const ScAddress& rPos, sal_uInt16& rOrient ) +long ScDPObject::GetHeaderDim( const ScAddress& rPos, sheet::DataPilotFieldOrientation& rOrient ) { CreateOutput(); // create xSource and pOutput if not already done @@ -1430,7 +1430,7 @@ long ScDPObject::GetHeaderDim( const ScAddress& rPos, sal_uInt16& rOrient ) } bool ScDPObject::GetHeaderDrag( const ScAddress& rPos, bool bMouseLeft, bool bMouseTop, long nDragDim, - tools::Rectangle& rPosRect, sal_uInt16& rOrient, long& rDimPos ) + tools::Rectangle& rPosRect, sheet::DataPilotFieldOrientation& rOrient, long& rDimPos ) { CreateOutput(); // create xSource and pOutput if not already done @@ -1740,7 +1740,7 @@ bool ScDPObject::ParseFilters( uno::Reference<sheet::XHierarchiesSupplier> xDimSupp( xDim, uno::UNO_QUERY ); bool bDataLayout = ScUnoHelpFunctions::GetBoolProperty( xDimProp, SC_UNO_DP_ISDATALAYOUT ); - sal_Int32 nOrient = ScUnoHelpFunctions::GetEnumProperty( + sheet::DataPilotFieldOrientation nOrient = ScUnoHelpFunctions::GetEnumProperty( xDimProp, SC_UNO_DP_ORIENTATION, sheet::DataPilotFieldOrientation_HIDDEN ); if ( !bDataLayout ) @@ -2160,7 +2160,7 @@ public: void lcl_FillOldFields( ScPivotFieldVector& rFields, const uno::Reference<sheet::XDimensionsSupplier>& xSource, - sal_uInt16 nOrient, bool bAddData ) + sheet::DataPilotFieldOrientation nOrient, bool bAddData ) { ScPivotFieldVector aFields; @@ -2184,7 +2184,7 @@ void lcl_FillOldFields( ScPivotFieldVector& rFields, uno::Reference<beans::XPropertySet> xDimProp( xIntDim, uno::UNO_QUERY ); // dimension orientation, hidden by default. - long nDimOrient = ScUnoHelpFunctions::GetEnumProperty( + sheet::DataPilotFieldOrientation nDimOrient = ScUnoHelpFunctions::GetEnumProperty( xDimProp, SC_UNO_DP_ORIENTATION, sheet::DataPilotFieldOrientation_HIDDEN ); @@ -2630,7 +2630,7 @@ public: } void ScDPObject::ConvertOrientation( - ScDPSaveData& rSaveData, const ScPivotFieldVector& rFields, sal_uInt16 nOrient, + ScDPSaveData& rSaveData, const ScPivotFieldVector& rFields, sheet::DataPilotFieldOrientation nOrient, const Reference<XDimensionsSupplier>& xSource, const ScDPLabelDataVector& rLabels, const ScPivotFieldVector* pRefColFields, @@ -2730,7 +2730,7 @@ void ScDPObject::ConvertOrientation( } } -bool ScDPObject::IsOrientationAllowed( sal_uInt16 nOrient, sal_Int32 nDimFlags ) +bool ScDPObject::IsOrientationAllowed( sheet::DataPilotFieldOrientation nOrient, sal_Int32 nDimFlags ) { bool bAllowed = true; switch (nOrient) diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 6795a29c53db..b8c02b9d4963 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -1571,7 +1571,7 @@ bool ScDPOutput::IsFilterButton( const ScAddress& rPos ) return ( nCol == aStartPos.Col() && nRow == aStartPos.Row() ); } -long ScDPOutput::GetHeaderDim( const ScAddress& rPos, sal_uInt16& rOrient ) +long ScDPOutput::GetHeaderDim( const ScAddress& rPos, sheet::DataPilotFieldOrientation& rOrient ) { SCCOL nCol = rPos.Col(); SCROW nRow = rPos.Row(); @@ -1619,7 +1619,7 @@ long ScDPOutput::GetHeaderDim( const ScAddress& rPos, sal_uInt16& rOrient ) bool ScDPOutput::GetHeaderDrag( const ScAddress& rPos, bool bMouseLeft, bool bMouseTop, long nDragDim, - tools::Rectangle& rPosRect, sal_uInt16& rOrient, long& rDimPos ) + tools::Rectangle& rPosRect, sheet::DataPilotFieldOrientation& rOrient, long& rDimPos ) { // Rectangle instead of ScRange for rPosRect to allow for negative values diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index ebfae9436692..9b088a1400cc 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -38,7 +38,6 @@ #include <com/sun/star/sheet/GeneralFunction2.hpp> #include <com/sun/star/sheet/DataPilotFieldAutoShowInfo.hpp> #include <com/sun/star/sheet/DataPilotFieldLayoutInfo.hpp> -#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include <com/sun/star/sheet/DataPilotFieldReference.hpp> #include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp> #include <com/sun/star/sheet/DataPilotFieldSortMode.hpp> @@ -348,7 +347,7 @@ void ScDPSaveDimension::SetName( const OUString& rNew ) aName = rNew; } -void ScDPSaveDimension::SetOrientation(sal_uInt16 nNew) +void ScDPSaveDimension::SetOrientation(css::sheet::DataPilotFieldOrientation nNew) { nOrientation = nNew; } @@ -722,8 +721,8 @@ void ScDPSaveDimension::Dump(int nIndent) const cout << aIndent << "* dimension name: '" << aName << "'" << endl; cout << aIndent << " + orientation: "; - if (nOrientation <= 4) - cout << pOrientNames[nOrientation]; + if (nOrientation <= DataPilotFieldOrientation_DATA) + cout << pOrientNames[(int)nOrientation]; else cout << "(invalid)"; cout << endl; @@ -888,7 +887,7 @@ void ScDPSaveData::GetAllDimensionsByOrientation( for (auto const& it : m_DimList) { const ScDPSaveDimension& rDim = *it; - if (rDim.GetOrientation() != static_cast<sal_uInt16>(eOrientation)) + if (rDim.GetOrientation() != eOrientation) continue; aDims.push_back(&rDim); @@ -993,7 +992,7 @@ ScDPSaveDimension& ScDPSaveData::DuplicateDimension( const ScDPSaveDimension& rD return *pNew; } -ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(sal_uInt16 nOrientation) +ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(DataPilotFieldOrientation nOrientation) { // return the innermost dimension for the given orientation, // excluding data layout dimension @@ -1034,7 +1033,7 @@ void ScDPSaveData::SetPosition( ScDPSaveDimension* pDim, long nNew ) { // position (nNew) is counted within dimensions of the same orientation - sal_uInt16 nOrient = pDim->GetOrientation(); + DataPilotFieldOrientation nOrient = pDim->GetOrientation(); for (auto it = m_DimList.begin(); it != m_DimList.end(); ++it) { diff --git a/sc/source/core/data/dpsdbtab.cxx b/sc/source/core/data/dpsdbtab.cxx index 079fb9b0b34f..499f6ad6b249 100644 --- a/sc/source/core/data/dpsdbtab.cxx +++ b/sc/source/core/data/dpsdbtab.cxx @@ -25,7 +25,6 @@ #include "document.hxx" #include "dpobject.hxx" -#include <com/sun/star/sheet/DataImportMode.hpp> #include <com/sun/star/sdb/CommandType.hpp> using namespace com::sun::star; diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index 13d7705206aa..f411f614d668 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -43,7 +43,6 @@ #include <com/sun/star/sheet/DataResultFlags.hpp> #include <com/sun/star/sheet/MemberResultFlags.hpp> -#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include <com/sun/star/sheet/DataPilotFieldReferenceType.hpp> #include <com/sun/star/sheet/DataPilotFieldReferenceItemType.hpp> #include <com/sun/star/sheet/DataPilotFieldShowItemsMode.hpp> @@ -763,7 +762,7 @@ ScDPResultData::~ScDPResultData() void ScDPResultData::SetMeasureData( std::vector<ScSubTotalFunc>& rFunctions, std::vector<sheet::DataPilotFieldReference>& rRefs, - std::vector<sal_uInt16>& rRefOrient, std::vector<OUString>& rNames ) + std::vector<sheet::DataPilotFieldOrientation>& rRefOrient, std::vector<OUString>& rNames ) { // We need to have at least one measure data at all times. @@ -784,7 +783,7 @@ void ScDPResultData::SetMeasureData( maMeasureNames.push_back(ScGlobal::GetRscString(STR_EMPTYDATA)); } -void ScDPResultData::SetDataLayoutOrientation( sal_uInt16 nOrient ) +void ScDPResultData::SetDataLayoutOrientation( sheet::DataPilotFieldOrientation nOrient ) { bDataAtCol = ( nOrient == sheet::DataPilotFieldOrientation_COLUMN ); bDataAtRow = ( nOrient == sheet::DataPilotFieldOrientation_ROW ); @@ -823,7 +822,7 @@ const sheet::DataPilotFieldReference& ScDPResultData::GetMeasureRefVal(long nMea return maMeasureRefs[nMeasure]; } -sal_uInt16 ScDPResultData::GetMeasureRefOrient(long nMeasure) const +sheet::DataPilotFieldOrientation ScDPResultData::GetMeasureRefOrient(long nMeasure) const { OSL_ENSURE((size_t) nMeasure < maMeasureRefOrients.size(), "bumm"); return maMeasureRefOrients[nMeasure]; @@ -2342,7 +2341,7 @@ void ScDPDataMember::UpdateRunningTotals( OUString aRefFieldName = aReferenceValue.ReferenceField; //TODO: aLocalSubState? - sal_uInt16 nRefOrient = pResultData->GetMeasureRefOrient( nMemberMeasure ); + sheet::DataPilotFieldOrientation nRefOrient = pResultData->GetMeasureRefOrient( nMemberMeasure ); bool bRefDimInCol = ( nRefOrient == sheet::DataPilotFieldOrientation_COLUMN ); bool bRefDimInRow = ( nRefOrient == sheet::DataPilotFieldOrientation_ROW ); diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 27a79cdd93db..1c4149060ff4 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -50,7 +50,6 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/sheet/DataPilotFieldFilter.hpp> -#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include <com/sun/star/sheet/DataPilotFieldReferenceType.hpp> #include <com/sun/star/sheet/DataPilotFieldSortMode.hpp> #include <com/sun/star/sheet/DataPilotFieldGroupBy.hpp> @@ -126,7 +125,7 @@ const OUString* ScDPSource::GetGrandTotalName() const return mpGrandTotalName.get(); } -sal_uInt16 ScDPSource::GetOrientation(long nColumn) +sheet::DataPilotFieldOrientation ScDPSource::GetOrientation(long nColumn) { if (std::find(maColDims.begin(), maColDims.end(), nColumn) != maColDims.end()) return sheet::DataPilotFieldOrientation_COLUMN; @@ -245,7 +244,7 @@ bool ScDPSource::SubTotalAllowed(long nColumn) return bAllowed; } -void ScDPSource::SetOrientation(long nColumn, sal_uInt16 nNew) +void ScDPSource::SetOrientation(long nColumn, sheet::DataPilotFieldOrientation nNew) { //TODO: change to no-op if new orientation is equal to old? @@ -284,7 +283,7 @@ bool ScDPSource::IsDataLayoutDimension(long nDim) return nDim == pData->GetColumnCount(); } -sal_uInt16 ScDPSource::GetDataLayoutOrientation() +sheet::DataPilotFieldOrientation ScDPSource::GetDataLayoutOrientation() { return GetOrientation(pData->GetColumnCount()); } @@ -763,7 +762,7 @@ void ScDPSource::CreateRes_Impl() if (pResData) return; - sal_uInt16 nDataOrient = GetDataLayoutOrientation(); + sheet::DataPilotFieldOrientation nDataOrient = GetDataLayoutOrientation(); if (maDataDims.size() > 1 && ( nDataOrient != sheet::DataPilotFieldOrientation_COLUMN && nDataOrient != sheet::DataPilotFieldOrientation_ROW ) ) { @@ -778,7 +777,7 @@ void ScDPSource::CreateRes_Impl() vector<OUString> aDataNames; vector<sheet::DataPilotFieldReference> aDataRefValues; vector<ScSubTotalFunc> aDataFunctions; - vector<sal_uInt16> aDataRefOrient; + vector<sheet::DataPilotFieldOrientation> aDataRefOrient; ScDPTableData::CalcInfo aInfo; @@ -807,7 +806,7 @@ void ScDPSource::CreateRes_Impl() // Get reference field/item information. aDataRefValues.push_back(pDim->GetReferenceValue()); - sal_uInt16 nDataRefOrient = sheet::DataPilotFieldOrientation_HIDDEN; // default if not used + sheet::DataPilotFieldOrientation nDataRefOrient = sheet::DataPilotFieldOrientation_HIDDEN; // default if not used sal_Int32 eRefType = aDataRefValues.back().ReferenceType; if ( eRefType == sheet::DataPilotFieldReferenceType::ITEM_DIFFERENCE || eRefType == sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE || @@ -868,7 +867,7 @@ void ScDPSource::CreateRes_Impl() // Show grand total columns only when the option is set *and* there is at // least one column field. Same for the grand total rows. - sal_uInt16 nDataLayoutOrient = GetDataLayoutOrientation(); + sheet::DataPilotFieldOrientation nDataLayoutOrient = GetDataLayoutOrientation(); long nColDimCount2 = maColDims.size() - (nDataLayoutOrient == sheet::DataPilotFieldOrientation_COLUMN ? 1 : 0); long nRowDimCount2 = maRowDims.size() - (nDataLayoutOrient == sheet::DataPilotFieldOrientation_ROW ? 1 : 0); bool bShowColGrand = bColumnGrand && nColDimCount2 > 0; @@ -978,7 +977,7 @@ void ScDPSource::CreateRes_Impl() #endif } -void ScDPSource::FillLevelList( sal_uInt16 nOrientation, std::vector<ScDPLevel*> &rList ) +void ScDPSource::FillLevelList( sheet::DataPilotFieldOrientation nOrientation, std::vector<ScDPLevel*> &rList ) { rList.clear(); @@ -1361,7 +1360,7 @@ void SAL_CALL ScDPDimension::setName( const OUString& rNewName ) aName = rNewName; } -sal_uInt16 ScDPDimension::getOrientation() const +sheet::DataPilotFieldOrientation ScDPDimension::getOrientation() const { return pSource->GetOrientation( nDim ); } @@ -1472,7 +1471,7 @@ void SAL_CALL ScDPDimension::setPropertyValue( const OUString& aPropertyName, co { sheet::DataPilotFieldOrientation eEnum; if (aValue >>= eEnum) - pSource->SetOrientation( nDim, sal::static_int_cast<sal_uInt16>(eEnum) ); + pSource->SetOrientation( nDim, eEnum ); } else if ( aPropertyName == SC_UNO_DP_FUNCTION ) { @@ -1553,7 +1552,7 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const OUString& aPropertyName aRet <<= (sal_Int32) getUsedHierarchy(); else if ( aPropertyName == SC_UNO_DP_ORIENTATION ) { - sheet::DataPilotFieldOrientation eVal = (sheet::DataPilotFieldOrientation)getOrientation(); + sheet::DataPilotFieldOrientation eVal = getOrientation(); aRet <<= eVal; } else if ( aPropertyName == SC_UNO_DP_FUNCTION ) diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 2015e8869927..bd9622c84d8d 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -994,7 +994,7 @@ static OUString lcl_convertCalcSubtotalName(const OUString& rName) void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) { // orientation - DataPilotFieldOrientation eOrient = static_cast< DataPilotFieldOrientation >( rSaveDim.GetOrientation() ); + DataPilotFieldOrientation eOrient = rSaveDim.GetOrientation(); OSL_ENSURE( eOrient != DataPilotFieldOrientation_DATA, "XclExpPTField::SetPropertiesFromDim - called for data field" ); maFieldInfo.AddApiOrient( eOrient ); @@ -1322,7 +1322,7 @@ void XclExpPivotTable::SetFieldPropertiesFromDim( const ScDPSaveDimension& rSave pField->SetPropertiesFromDim( rSaveDim ); // update the corresponding field position list - DataPilotFieldOrientation eOrient = static_cast< DataPilotFieldOrientation >( rSaveDim.GetOrientation() ); + DataPilotFieldOrientation eOrient = rSaveDim.GetOrientation(); sal_uInt16 nFieldIdx = pField->GetFieldIndex(); bool bDataLayout = nFieldIdx == EXC_SXIVD_DATA; bool bMultiData = maDataFields.size() > 1; diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx index c38b818200ff..04d85f0a9ff8 100644 --- a/sc/source/filter/excel/xepivotxml.cxx +++ b/sc/source/filter/excel/xepivotxml.cxx @@ -473,8 +473,7 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP continue; } - sheet::DataPilotFieldOrientation eOrient = - static_cast<sheet::DataPilotFieldOrientation>(rDim.GetOrientation()); + sheet::DataPilotFieldOrientation eOrient = rDim.GetOrientation(); switch (eOrient) { @@ -565,8 +564,7 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP continue; } - sheet::DataPilotFieldOrientation eOrient = - static_cast<sheet::DataPilotFieldOrientation>(pDim->GetOrientation()); + sheet::DataPilotFieldOrientation eOrient = pDim->GetOrientation(); if (eOrient == sheet::DataPilotFieldOrientation_HIDDEN) { diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index 23c72528a18f..c19a03f832ae 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -963,7 +963,7 @@ void XclImpPTField::ConvertRowColField( ScDPSaveData& rSaveData ) const OSL_ENSURE( maFieldInfo.mnAxes & EXC_SXVD_AXIS_ROWCOL, "XclImpPTField::ConvertRowColField - no row/column field" ); // special data orientation field? if( maFieldInfo.mnCacheIdx == EXC_SXIVD_DATA ) - rSaveData.GetDataLayoutDimension()->SetOrientation( static_cast< sal_uInt16 >( maFieldInfo.GetApiOrient( EXC_SXVD_AXIS_ROWCOL ) ) ); + rSaveData.GetDataLayoutDimension()->SetOrientation( maFieldInfo.GetApiOrient( EXC_SXVD_AXIS_ROWCOL ) ); else ConvertRCPField( rSaveData ); } @@ -1078,7 +1078,7 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con ScDPSaveDimension& rSaveDim = *pTest; // orientation - rSaveDim.SetOrientation( static_cast< sal_uInt16 >( maFieldInfo.GetApiOrient( EXC_SXVD_AXIS_ROWCOLPAGE ) ) ); + rSaveDim.SetOrientation( maFieldInfo.GetApiOrient( EXC_SXVD_AXIS_ROWCOLPAGE ) ); // general field info ConvertFieldInfo( rSaveDim ); diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index 54accf694b4e..37100699b3b2 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -880,6 +880,7 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreads rExport.CheckAttrList(); } break; + default: break; } } else if ((*pDPs)[i].IsServiceData()) diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index a91995b1168b..9556288953f9 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -787,7 +787,7 @@ void ScXMLTableRowCellContext::SetContentValidation( const ScRange& rScRange ) { ScValidationData aScValidationData( validationTypeToMode(aValidation.aValidationType), - ScConditionEntry::GetModeFromApi(static_cast<sal_Int32>(aValidation.aOperator)), + ScConditionEntry::GetModeFromApi(aValidation.aOperator), aValidation.sFormula1, aValidation.sFormula2, pDoc, ScAddress(), aValidation.sFormulaNmsp1, aValidation.sFormulaNmsp2, aValidation.eGrammar1, aValidation.eGrammar2 diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index d7989a22e137..c8e0d366a76b 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -315,7 +315,7 @@ const ScDPSaveDimension* getDimension( return nullptr; } -ScDPOutputGeometry::FieldType toFieldType(sal_uInt16 nOrient) +ScDPOutputGeometry::FieldType toFieldType(sheet::DataPilotFieldOrientation nOrient) { switch (nOrient) { @@ -951,7 +951,7 @@ ScXMLDataPilotFieldContext::ScXMLDataPilotFieldContext( ScXMLImport& rImport, nUsedHierarchy(1), nGroupPart(0), nFunction(ScGeneralFunction::NONE), - nOrientation(0), + nOrientation(sheet::DataPilotFieldOrientation_HIDDEN), bSelectedPage(false), bIsGroupField(false), bDateValue(false), @@ -999,7 +999,7 @@ ScXMLDataPilotFieldContext::ScXMLDataPilotFieldContext( ScXMLImport& rImport, break; case XML_TOK_DATA_PILOT_FIELD_ATTR_ORIENTATION : { - nOrientation = (sal_Int16) ScXMLConverter::GetOrientationFromString( sValue ); + nOrientation = ScXMLConverter::GetOrientationFromString( sValue ); } break; case XML_TOK_DATA_PILOT_FIELD_ATTR_SELECTED_PAGE : diff --git a/sc/source/filter/xml/xmldpimp.hxx b/sc/source/filter/xml/xmldpimp.hxx index 1519408f2bc9..36757416223a 100644 --- a/sc/source/filter/xml/xmldpimp.hxx +++ b/sc/source/filter/xml/xmldpimp.hxx @@ -101,7 +101,8 @@ class ScXMLDataPilotTableContext : public ScXMLImportContext sal_uInt32 mnColFieldCount; sal_uInt32 mnPageFieldCount; sal_uInt32 mnDataFieldCount; - sal_uInt16 mnDataLayoutType; + css::sheet::DataPilotFieldOrientation + mnDataLayoutType; bool bIsNative:1; bool bIgnoreEmptyRows:1; bool bIdentifyCategories:1; @@ -293,7 +294,8 @@ class ScXMLDataPilotFieldContext : public ScXMLImportContext sal_Int32 nUsedHierarchy; sal_Int32 nGroupPart; ScGeneralFunction nFunction; - sal_Int16 nOrientation; + css::sheet::DataPilotFieldOrientation + nOrientation; bool bSelectedPage:1; bool bIsGroupField:1; bool bDateValue:1; diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index fa38154a7b8a..c38fd98e9f37 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -296,8 +296,7 @@ std::unique_ptr<ScDBData> ScXMLDatabaseRangeContext::ConvertToDBData(const OUStr aParam.bNative = bNative; aParam.aDBName = sDatabaseName.isEmpty() ? sConnectionResource : sDatabaseName; aParam.aStatement = sSourceObject; - sheet::DataImportMode eMode = static_cast<sheet::DataImportMode>(nSourceType); - switch (eMode) + switch (nSourceType) { case sheet::DataImportMode_NONE: aParam.bImport = false; diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 25da277cffc8..cfefb627df5e 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -807,7 +807,7 @@ VclPtr<AbstractScDPDateGroupDlg> ScAbstractDialogFactory_Impl::CreateScDPDateGro } VclPtr<AbstractScDPShowDetailDlg> ScAbstractDialogFactory_Impl::CreateScDPShowDetailDlg ( - vcl::Window* pParent, ScDPObject& rDPObj, sal_uInt16 nOrient ) + vcl::Window* pParent, ScDPObject& rDPObj, css::sheet::DataPilotFieldOrientation nOrient ) { return VclPtr<AbstractScDPShowDetailDlg_Impl>::Create( VclPtr<ScDPShowDetailDlg>::Create( pParent, rDPObj, nOrient ) ); } diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index c6e33120e670..140701b0bec9 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -509,7 +509,7 @@ public: virtual VclPtr<AbstractScDPShowDetailDlg> CreateScDPShowDetailDlg( vcl::Window* pParent, ScDPObject& rDPObj, - sal_uInt16 nOrient ) override; + css::sheet::DataPilotFieldOrientation nOrient ) override; virtual VclPtr<AbstractScNewScenarioDlg> CreateScNewScenarioDlg ( vcl::Window* pParent, const OUString& rName, bool bEdit, bool bSheetProtected ) override; diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 4dcecad8e88f..74ba3f181dd5 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -814,7 +814,7 @@ IMPL_LINK( ScDPSubtotalOptDlg, SelectHdl, ListBox&, rLBox, void ) } } -ScDPShowDetailDlg::ScDPShowDetailDlg( vcl::Window* pParent, ScDPObject& rDPObj, sal_uInt16 nOrient ) : +ScDPShowDetailDlg::ScDPShowDetailDlg( vcl::Window* pParent, ScDPObject& rDPObj, css::sheet::DataPilotFieldOrientation nOrient ) : ModalDialog ( pParent, "ShowDetail", "modules/scalc/ui/showdetaildialog.ui" ), mrDPObj(rDPObj) { diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx index 98049b998bcf..a0f1fd5ec077 100644 --- a/sc/source/ui/inc/dbfunc.hxx +++ b/sc/source/ui/inc/dbfunc.hxx @@ -88,7 +88,7 @@ public: void DataPilotSort(ScDPObject* pDPObject, long nDimIndex, bool bAscending, sal_uInt16* pUserListId = nullptr); bool DataPilotMove( const ScRange& rSource, const ScAddress& rDest ); - bool HasSelectionForDrillDown( sal_uInt16& rOrientation ); + bool HasSelectionForDrillDown( css::sheet::DataPilotFieldOrientation& rOrientation ); void SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName = nullptr); void ShowDataPilotSourceData( ScDPObject& rDPObj, diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx index 1f58212de130..7a1fe8f79fad 100644 --- a/sc/source/ui/inc/pvfundlg.hxx +++ b/sc/source/ui/inc/pvfundlg.hxx @@ -22,6 +22,7 @@ #include <com/sun/star/sheet/DataPilotFieldReference.hpp> #include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp> +#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include <vcl/fixed.hxx> #include <vcl/layout.hxx> @@ -188,7 +189,8 @@ private: class ScDPShowDetailDlg : public ModalDialog { public: - explicit ScDPShowDetailDlg( vcl::Window* pParent, ScDPObject& rDPObj, sal_uInt16 nOrient ); + explicit ScDPShowDetailDlg( vcl::Window* pParent, ScDPObject& rDPObj, + css::sheet::DataPilotFieldOrientation nOrient ); virtual ~ScDPShowDetailDlg() override; virtual void dispose() override; virtual short Execute() override; diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 71a8d88a640e..6c1efce1ca4d 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -789,7 +789,7 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp ScImportParam aParam; ScImportDescriptor::FillImportParam( aParam, aArgSeq ); - sal_uInt16 nNewType = sheet::DataImportMode_NONE; + sheet::DataImportMode nNewType = sheet::DataImportMode_NONE; if ( aParam.bImport ) { if ( aParam.bSql ) @@ -2039,7 +2039,7 @@ DataPilotFieldOrientation ScDataPilotFieldObj::getOrientation() const { SolarMutexGuard aGuard; ScDPSaveDimension* pDim = GetDPDimension(); - return pDim ? static_cast< DataPilotFieldOrientation >( pDim->GetOrientation() ) : DataPilotFieldOrientation_HIDDEN; + return pDim ? pDim->GetOrientation() : DataPilotFieldOrientation_HIDDEN; } void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew) @@ -2088,7 +2088,7 @@ void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew) pDim = pNewDim; } - pDim->SetOrientation(sal::static_int_cast<sal_uInt16>(eNew)); + pDim->SetOrientation(eNew); // move changed field behind all other fields (make it the last field in dimension) pSaveData->SetPosition( pDim, pSaveData->GetDimensions().size() ); diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx index e82da5206fee..59bed5182426 100644 --- a/sc/source/ui/unoobj/fmtuno.cxx +++ b/sc/source/ui/unoobj/fmtuno.cxx @@ -260,7 +260,7 @@ void SAL_CALL ScTableConditionalFormat::addNew( if ( rProp.Name == SC_UNONAME_OPERATOR ) { sal_Int32 eOper = ScUnoHelpFunctions::GetEnumFromAny( rProp.Value ); - aEntry.meMode = ScConditionEntry::GetModeFromApi( eOper ); + aEntry.meMode = ScConditionEntry::GetModeFromApi( (sheet::ConditionOperator)eOper ); } else if ( rProp.Name == SC_UNONAME_FORMULA1 ) { @@ -518,7 +518,7 @@ sal_Int32 SAL_CALL ScTableConditionalEntry::getConditionOperator() void SAL_CALL ScTableConditionalEntry::setConditionOperator( sal_Int32 nOperator ) { SolarMutexGuard aGuard; - aData.meMode = ScConditionEntry::GetModeFromApi( nOperator ); + aData.meMode = ScConditionEntry::GetModeFromApi( (sheet::ConditionOperator)nOperator ); } OUString SAL_CALL ScTableConditionalEntry::getFormula1() @@ -706,7 +706,7 @@ sal_Int32 SAL_CALL ScTableValidationObj::getConditionOperator() void SAL_CALL ScTableValidationObj::setConditionOperator( sal_Int32 nOperator ) { SolarMutexGuard aGuard; - nMode = ScConditionEntry::GetModeFromApi( nOperator ); + nMode = ScConditionEntry::GetModeFromApi( (css::sheet::ConditionOperator)nOperator ); } OUString SAL_CALL ScTableValidationObj::getFormula1() diff --git a/sc/source/ui/unoobj/miscuno.cxx b/sc/source/ui/unoobj/miscuno.cxx index aebf59a040f3..e66afe621623 100644 --- a/sc/source/ui/unoobj/miscuno.cxx +++ b/sc/source/ui/unoobj/miscuno.cxx @@ -96,8 +96,8 @@ sal_Int32 ScUnoHelpFunctions::GetLongProperty( const uno::Reference<beans::XProp return nRet; } -sal_Int32 ScUnoHelpFunctions::GetEnumProperty( const uno::Reference<beans::XPropertySet>& xProp, - const OUString& rName, long nDefault ) +sal_Int32 ScUnoHelpFunctions::GetEnumPropertyImpl( const uno::Reference<beans::XPropertySet>& xProp, + const OUString& rName, sal_Int32 nDefault ) { sal_Int32 nRet = nDefault; if ( xProp.is() ) diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx index c47c3bf12383..0e7ba5756331 100644 --- a/sc/source/ui/vba/vbavalidation.cxx +++ b/sc/source/ui/vba/vbavalidation.cxx @@ -356,7 +356,7 @@ ScVbaValidation::getType() case sheet::ValidationType_TEXT_LEN: nExcelType = excel::XlDVType::xlValidateTextLength; break; - case sheet::ValidationType_MAKE_FIXED_SIZE: + case sheet::ValidationType::ValidationType_MAKE_FIXED_SIZE: default: break; }; diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index fd31875848fe..0a1f250ceb7b 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1073,7 +1073,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if ( pDPObj ) { Sequence<sheet::DataPilotFieldFilter> aFilters; - sal_uInt16 nOrientation; + css::sheet::DataPilotFieldOrientation nOrientation; if ( pTabViewShell->HasSelectionForDrillDown( nOrientation ) ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index ad0f714e9b65..cc512457c5d3 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -32,7 +32,6 @@ #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> #include <com/sun/star/sheet/DataPilotFieldSortMode.hpp> #include <com/sun/star/sheet/DataPilotTableHeaderData.hpp> -#include <com/sun/star/sheet/GeneralFunction.hpp> #include <com/sun/star/sheet/MemberResultFlags.hpp> #include <com/sun/star/sheet/XDimensionsSupplier.hpp> #include <com/sun/star/sheet/XDrillDownDataSupplier.hpp> @@ -1337,7 +1336,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString ) ScDPSaveData aData( *pDPObj->GetSaveData() ); bool bChange = false; - sal_uInt16 nOrient = DataPilotFieldOrientation_HIDDEN; + DataPilotFieldOrientation nOrient = DataPilotFieldOrientation_HIDDEN; long nField = pDPObj->GetHeaderDim( rPos, nOrient ); if ( nField >= 0 ) { @@ -1841,7 +1840,7 @@ bool ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest ) return bRet; } -bool ScDBFunc::HasSelectionForDrillDown( sal_uInt16& rOrientation ) +bool ScDBFunc::HasSelectionForDrillDown( css::sheet::DataPilotFieldOrientation& rOrientation ) { bool bRet = false; @@ -1863,7 +1862,7 @@ bool ScDBFunc::HasSelectionForDrillDown( sal_uInt16& rOrientation ) ScDPSaveDimension* pDim = pSaveData->GetExistingDimensionByName( aDimName ); if ( pDim ) { - sal_uInt16 nDimOrient = pDim->GetOrientation(); + css::sheet::DataPilotFieldOrientation nDimOrient = pDim->GetOrientation(); ScDPSaveDimension* pInner = pSaveData->GetInnermostDimension( nDimOrient ); if ( pDim == pInner ) { @@ -1910,7 +1909,7 @@ void ScDBFunc::SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName pDuplicated = aData.DuplicateDimension( *pNewDimensionName ); } - sal_uInt16 nOrientation = pDim->GetOrientation(); + css::sheet::DataPilotFieldOrientation nOrientation = pDim->GetOrientation(); pNewDim->SetOrientation( nOrientation ); long nPosition = LONG_MAX; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index d0c878b52bb6..4e33afb9bda7 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2031,7 +2031,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) if ( ( aData.Flags & sheet::MemberResultFlags::HASMEMBER ) && ! ( aData.Flags & sheet::MemberResultFlags::SUBTOTAL ) ) { - sal_uInt16 nDummy; + css::sheet::DataPilotFieldOrientation nDummy; if ( pView->HasSelectionForDrillDown( nDummy ) ) { // execute slot to show dialog @@ -3443,7 +3443,7 @@ sal_Int8 ScGridWindow::AcceptPrivateDrop( const AcceptDropEvent& rEvt ) { ScRange aOutRange = pDPObj->GetOutRange(); - sal_uInt16 nOrient = pDim->GetOrientation(); + sheet::DataPilotFieldOrientation nOrient = pDim->GetOrientation(); if ( nOrient == sheet::DataPilotFieldOrientation_COLUMN ) { eDragInsertMode = INS_CELLSRIGHT; diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 91936ae35c0e..88fe45a6c96a 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -61,7 +61,7 @@ DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW if (!pDPObj) return DataPilotFieldOrientation_HIDDEN; - sal_uInt16 nOrient = DataPilotFieldOrientation_HIDDEN; + DataPilotFieldOrientation nOrient = DataPilotFieldOrientation_HIDDEN; // Check for page field first. if (nCol > 0) @@ -86,7 +86,7 @@ DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW bool bIsDataLayout = false; OUString aFieldName = pDPObj->GetDimName(nField, bIsDataLayout); if (!aFieldName.isEmpty() && !bIsDataLayout) - return static_cast<DataPilotFieldOrientation>(nOrient); + return nOrient; } return DataPilotFieldOrientation_HIDDEN; @@ -156,7 +156,7 @@ void ScGridWindow::DoPushPivotButton( SCCOL nCol, SCROW nRow, const MouseEvent& if (pDPObj) { - sal_uInt16 nOrient = DataPilotFieldOrientation_HIDDEN; + DataPilotFieldOrientation nOrient = DataPilotFieldOrientation_HIDDEN; ScAddress aPos( nCol, nRow, nTab ); ScAddress aDimPos = aPos; if (!bButton && bPopup && aDimPos.Col() > 0) @@ -276,7 +276,7 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, bool bMove ) ScAddress aPos( nPosX, nPosY, pViewData->GetTabNo() ); tools::Rectangle aPosRect; - sal_uInt16 nOrient; + DataPilotFieldOrientation nOrient; long nDimPos; bool bHasRange = pDragDPObj->GetHeaderDrag( aPos, bMouseLeft, bMouseTop, nDPField, aPosRect, nOrient, nDimPos ); @@ -299,6 +299,7 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, bool bMove ) case DataPilotFieldOrientation_ROW: ePointer = PointerStyle::PivotRow; break; case DataPilotFieldOrientation_PAGE: case DataPilotFieldOrientation_DATA: ePointer = PointerStyle::PivotField; break; + default: break; } SetPointer( ePointer ); } @@ -439,7 +440,7 @@ private: void ScGridWindow::DPLaunchFieldPopupMenu(const Point& rScreenPosition, const Size& rScreenSize, const ScAddress& rAddress, ScDPObject* pDPObject) { - sal_uInt16 nOrient; + DataPilotFieldOrientation nOrient; long nDimIndex = pDPObject->GetHeaderDim(rAddress, nOrient); DPLaunchFieldPopupMenu(rScreenPosition, rScreenSize, nDimIndex, pDPObject); |