diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-12-03 21:46:37 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-12-19 22:08:26 +0100 |
commit | 00bc5a097313fbd003675267be961ad3a152ba42 (patch) | |
tree | de9b9e6981d3c2f262b9391335a067d4898185b6 /sc/inc | |
parent | b74da08e556b7b001943f0288a61da53791d4dcf (diff) |
wrap scoped enum around css::util::NumberFormat
Change-Id: Icab5ded8bccdb95f79b3fa35ea164f47919c68fa
Reviewed-on: https://gerrit.libreoffice.org/46339
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/column.hxx | 2 | ||||
-rw-r--r-- | sc/inc/dociter.hxx | 7 | ||||
-rw-r--r-- | sc/inc/document.hxx | 4 | ||||
-rw-r--r-- | sc/inc/dpcache.hxx | 3 | ||||
-rw-r--r-- | sc/inc/externalrefmgr.hxx | 2 | ||||
-rw-r--r-- | sc/inc/formulacell.hxx | 7 | ||||
-rw-r--r-- | sc/inc/global.hxx | 9 | ||||
-rw-r--r-- | sc/inc/simpleformulacalc.hxx | 4 | ||||
-rw-r--r-- | sc/inc/stringutil.hxx | 3 | ||||
-rw-r--r-- | sc/inc/table.hxx | 2 |
10 files changed, 24 insertions, 19 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 60dfd3edf1d6..5c34279ad3c4 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -468,7 +468,7 @@ public: void SetPatternArea( SCROW nStartRow, SCROW nEndRow, const ScPatternAttr& rPatAttr ); void ApplyPatternIfNumberformatIncompatible( const ScRange& rRange, - const ScPatternAttr& rPattern, short nNewType ); + const ScPatternAttr& rPattern, SvNumFormatType nNewType ); void ApplyStyle( SCROW nRow, const ScStyleSheet* rStyle ); void ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, const ScStyleSheet& rStyle ); diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx index 6e8011438d73..915f478f4bfa 100644 --- a/sc/inc/dociter.hxx +++ b/sc/inc/dociter.hxx @@ -46,6 +46,7 @@ struct ScDBQueryParamInternal; struct ScDBQueryParamMatrix; class ScFormulaCell; struct ScInterpreterContext; +enum class SvNumFormatType : sal_Int16; class ScValueIterator // walk through all values in an area { @@ -61,7 +62,7 @@ class ScValueIterator // walk through all values in an area SCTAB mnTab; SCROW nAttrEndRow; SubtotalFlags mnSubTotalFlags; - short nNumFmtType; + SvNumFormatType nNumFmtType; bool bNumValid; bool bCalcAsShown; bool bTextAsZero; @@ -85,7 +86,7 @@ public: ScDocument* pDocument, const ScRange& rRange, SubtotalFlags nSubTotalFlags = SubtotalFlags::NONE, bool bTextAsZero = false ); - void GetCurNumFmtInfo( const ScInterpreterContext& rContext, sal_uInt32& nType, sal_uInt32& nIndex ); + void GetCurNumFmtInfo( const ScInterpreterContext& rContext, SvNumFormatType& nType, sal_uInt32& nIndex ); /// Does NOT reset rValue if no value found! bool GetFirst( double& rValue, FormulaError& rErr ); @@ -148,7 +149,7 @@ private: SCROW nRow; SCROW nAttrEndRow; SCTAB nTab; - sal_uInt32 nNumFmtType; + SvNumFormatType nNumFmtType; bool bCalcAsShown; }; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index ac3025ffb1d8..4d908c9e20cb 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1120,7 +1120,7 @@ public: SC_DLLPUBLIC sal_uInt32 GetNumberFormat( const ScInterpreterContext& rContext, const ScAddress& ) const; void SetNumberFormat( const ScAddress& rPos, sal_uInt32 nNumberFormat ); - void GetNumberFormatInfo( const ScInterpreterContext& rContext, sal_uInt32& nType, sal_uInt32& nIndex, const ScAddress& rPos ) const; + void GetNumberFormatInfo( const ScInterpreterContext& rContext, SvNumFormatType& nType, sal_uInt32& nIndex, const ScAddress& rPos ) const; SC_DLLPUBLIC const ScFormulaCell* GetFormulaCell( const ScAddress& rPos ) const; SC_DLLPUBLIC ScFormulaCell* GetFormulaCell( const ScAddress& rPos ); SC_DLLPUBLIC void GetFormula( SCCOL nCol, SCROW nRow, SCTAB nTab, OUString& rFormula ) const; @@ -1680,7 +1680,7 @@ public: SC_DLLPUBLIC void ApplyPatternIfNumberformatIncompatible( const ScRange& rRange, const ScMarkData& rMark, const ScPatternAttr& rPattern, - short nNewType ); + SvNumFormatType nNewType ); void ApplyStyle( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScStyleSheet& rStyle); diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx index 8601d7177aae..08517c167d0a 100644 --- a/sc/inc/dpcache.hxx +++ b/sc/inc/dpcache.hxx @@ -35,6 +35,7 @@ struct ScQueryParam; class ScDPObject; class ScDPItemData; struct ScDPNumGroupInfo; +enum class SvNumFormatType : sal_Int16; /** * This class represents the cached data part of the datapilot cache table @@ -98,7 +99,7 @@ public: virtual bool first() = 0; virtual bool next() = 0; virtual void finish() = 0; - virtual void getValue(long nCol, ScDPItemData& rData, short& rNumType) const = 0; + virtual void getValue(long nCol, ScDPItemData& rData, SvNumFormatType& rNumType) const = 0; virtual ~DBConnector() {} }; diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx index 19414e2a2084..70cf8f99a65f 100644 --- a/sc/inc/externalrefmgr.hxx +++ b/sc/inc/externalrefmgr.hxx @@ -104,7 +104,7 @@ public: struct CellFormat { bool mbIsSet; - short mnType; + SvNumFormatType mnType; sal_uLong mnIndex; explicit CellFormat(); diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx index 867bb89692d2..1eaf33649d77 100644 --- a/sc/inc/formulacell.hxx +++ b/sc/inc/formulacell.hxx @@ -51,6 +51,7 @@ class UpdatedRangeNames; class ScFormulaCell; class ScProgress; class ScTokenArray; +enum class SvNumFormatType : sal_Int16; struct SC_DLLPUBLIC ScFormulaCellGroup { @@ -66,7 +67,7 @@ public: ScFormulaCell *mpTopCell; SCROW mnLength; // How many of these do we have ? sal_Int32 mnWeight; - short mnFormatType; + SvNumFormatType mnFormatType; bool mbInvariant:1; bool mbSubTotal:1; @@ -118,7 +119,7 @@ private: ScFormulaCell* pPreviousTrack; ScFormulaCell* pNextTrack; sal_uInt16 nSeenInIteration; // Iteration cycle in which the cell was last encountered - short nFormatType; + SvNumFormatType nFormatType; ScMatrixMode cMatrixFlag; bool bDirty : 1; // Must be (re)calculated bool bChanged : 1; // Whether something changed regarding display/representation @@ -221,7 +222,7 @@ public: void SetNeedsDirty( bool bVar ); void SetNeedNumberFormat( bool bVal ); bool NeedsNumberFormat() const { return mbNeedsNumberFormat;} - short GetFormatType() const { return nFormatType; } + SvNumFormatType GetFormatType() const { return nFormatType; } void Compile(const OUString& rFormula, bool bNoListening, const formula::FormulaGrammar::Grammar ); diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 879902d5758f..fdb05f367094 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -38,6 +38,7 @@ class Color; struct ScCalcConfig; enum class SvtScriptType; enum class FormulaError : sal_uInt16; +enum class SvNumFormatType : sal_Int16; #define SC_COLLATOR_IGNORES css::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE @@ -575,7 +576,7 @@ public: const SfxObjectShell* pShell ); SC_DLLPUBLIC static OUString GetDocTabName( const OUString& rFileName, const OUString& rTabName ); - SC_DLLPUBLIC static sal_uInt32 GetStandardFormat( SvNumberFormatter&, sal_uInt32 nFormat, short nType ); + SC_DLLPUBLIC static sal_uInt32 GetStandardFormat( SvNumberFormatter&, sal_uInt32 nFormat, SvNumFormatType nType ); SC_DLLPUBLIC static sal_uInt16 GetStandardRowHeight(); SC_DLLPUBLIC static double nScreenPPTX; @@ -806,13 +807,13 @@ public: @param rCurFmtType Can be assigned a format type in case a date or time or date+time - string was converted, e.g. css::util::NumberFormat::DATE or - css::util::NumberFormat::TIME or a combination thereof. + string was converted, e.g. SvNumFormatType::DATE or + SvNumFormatType::TIME or a combination thereof. */ static double ConvertStringToValue( const OUString& rStr, const ScCalcConfig& rConfig, FormulaError & rError, FormulaError nStringNoValueError, - SvNumberFormatter* pFormatter, sal_uInt32 & rCurFmtType ); + SvNumberFormatter* pFormatter, SvNumFormatType & rCurFmtType ); }; diff --git a/sc/inc/simpleformulacalc.hxx b/sc/inc/simpleformulacalc.hxx index 600507bcb9d0..f14408aa190f 100644 --- a/sc/inc/simpleformulacalc.hxx +++ b/sc/inc/simpleformulacalc.hxx @@ -22,7 +22,7 @@ class ScTokenArray; class ScSimpleFormulaCalculator { private: - short mnFormatType; + SvNumFormatType mnFormatType; bool mbCalculated; std::unique_ptr<ScTokenArray> mpCode; @@ -47,7 +47,7 @@ public: FormulaError GetErrCode(); double GetValue(); svl::SharedString GetString(); - short GetFormatType() const { return mnFormatType; } + SvNumFormatType GetFormatType() const { return mnFormatType; } bool HasColRowName(); diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx index 005a99713f2f..34c4ce246b9f 100644 --- a/sc/inc/stringutil.hxx +++ b/sc/inc/stringutil.hxx @@ -26,6 +26,7 @@ #include "types.hxx" class SvNumberFormatter; +enum class SvNumFormatType : sal_Int16; /** * Store parameters used in the ScDocument::SetString() method. Various @@ -115,7 +116,7 @@ struct ScInputStringType OUString maText; double mfValue; - short mnFormatType; + SvNumFormatType mnFormatType; }; class ScStringUtil diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 9cd2342ce103..12a961b59a59 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -707,7 +707,7 @@ public: } void SetPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr ); void ApplyPatternIfNumberformatIncompatible( const ScRange& rRange, - const ScPatternAttr& rPattern, short nNewType ); + const ScPatternAttr& rPattern, SvNumFormatType nNewType ); void AddCondFormatData( const ScRangeList& rRange, sal_uInt32 nIndex ); void RemoveCondFormatData( const ScRangeList& rRange, sal_uInt32 nIndex ); |