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 /formula | |
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 'formula')
-rw-r--r-- | formula/source/core/api/FormulaCompiler.cxx | 30 | ||||
-rw-r--r-- | formula/source/core/api/token.cxx | 10 |
2 files changed, 20 insertions, 20 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 0ee613dcd8f0..da9ac30cc136 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -52,7 +52,7 @@ class FormulaCompilerRecursionGuard ~FormulaCompilerRecursionGuard() { --rRecursion; } }; -short lcl_GetRetFormat( OpCode eOpCode ) +SvNumFormatType lcl_GetRetFormat( OpCode eOpCode ) { switch (eOpCode) { @@ -81,15 +81,15 @@ short lcl_GetRetFormat( OpCode eOpCode ) case ocIsEven: case ocIsOdd: case ocExact: - return css::util::NumberFormat::LOGICAL; + return SvNumFormatType::LOGICAL; case ocGetActDate: case ocGetDate: case ocEasterSunday : - return css::util::NumberFormat::DATE; + return SvNumFormatType::DATE; case ocGetActTime: - return css::util::NumberFormat::DATETIME; + return SvNumFormatType::DATETIME; case ocGetTime: - return css::util::NumberFormat::TIME; + return SvNumFormatType::TIME; case ocNPV: case ocPV: case ocSYD: @@ -103,7 +103,7 @@ short lcl_GetRetFormat( OpCode eOpCode ) case ocPpmt: case ocCumIpmt: case ocCumPrinc: - return css::util::NumberFormat::CURRENCY; + return SvNumFormatType::CURRENCY; case ocRate: case ocIRR: case ocMIRR: @@ -111,9 +111,9 @@ short lcl_GetRetFormat( OpCode eOpCode ) case ocEffect: case ocNominal: case ocPercentSign: - return css::util::NumberFormat::PERCENT; + return SvNumFormatType::PERCENT; default: - return css::util::NumberFormat::NUMBER; + return SvNumFormatType::NUMBER; } } @@ -716,7 +716,7 @@ FormulaCompiler::FormulaCompiler( FormulaTokenArray& rArr ) pStack( nullptr ), eLastOp( ocPush ), nRecursion( 0 ), - nNumFmt( css::util::NumberFormat::UNDEFINED ), + nNumFmt( SvNumFormatType::UNDEFINED ), pc( 0 ), meGrammar( formula::FormulaGrammar::GRAM_UNSPECIFIED ), bAutoCorrect( false ), @@ -738,7 +738,7 @@ FormulaCompiler::FormulaCompiler() pStack( nullptr ), eLastOp( ocPush ), nRecursion(0), - nNumFmt( css::util::NumberFormat::UNDEFINED ), + nNumFmt( SvNumFormatType::UNDEFINED ), pc( 0 ), meGrammar( formula::FormulaGrammar::GRAM_UNSPECIFIED ), bAutoCorrect( false ), @@ -1417,7 +1417,7 @@ void FormulaCompiler::Factor() } else { - if( nNumFmt == css::util::NumberFormat::UNDEFINED ) + if( nNumFmt == SvNumFormatType::UNDEFINED ) nNumFmt = lcl_GetRetFormat( eOp ); if ( IsOpCodeVolatile( eOp) ) @@ -1556,8 +1556,8 @@ void FormulaCompiler::Factor() // standard handling of ocNot, ocNeg and 1-parameter opcodes pFacToken = mpToken; eOp = NextToken(); - if( nNumFmt == css::util::NumberFormat::UNDEFINED && eOp == ocNot ) - nNumFmt = css::util::NumberFormat::LOGICAL; + if( nNumFmt == SvNumFormatType::UNDEFINED && eOp == ocNot ) + nNumFmt = SvNumFormatType::LOGICAL; if (eOp == ocOpen) { NextToken(); @@ -2036,8 +2036,8 @@ bool FormulaCompiler::CompileTokenArray() if ( bWasForced ) pArr->SetRecalcModeForced(); } - if( nNumFmt == css::util::NumberFormat::UNDEFINED ) - nNumFmt = css::util::NumberFormat::NUMBER; + if( nNumFmt == SvNumFormatType::UNDEFINED ) + nNumFmt = SvNumFormatType::NUMBER; return glSubTotal; } diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index 07ff7cc59b6e..cfd759562d59 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -210,13 +210,13 @@ double & FormulaToken::GetDoubleAsReference() return fVal; } -short FormulaToken::GetDoubleType() const +sal_Int16 FormulaToken::GetDoubleType() const { SAL_WARN( "formula.core", "FormulaToken::GetDoubleType: virtual dummy called" ); return 0; } -void FormulaToken::SetDoubleType( short ) +void FormulaToken::SetDoubleType( sal_Int16 ) { assert( !"virtual dummy called" ); } @@ -1785,7 +1785,7 @@ void FormulaTokenArrayPlainIterator::AfterRemoveToken( sal_uInt16 nOffset, sal_u double FormulaDoubleToken::GetDouble() const { return fDouble; } double & FormulaDoubleToken::GetDoubleAsReference() { return fDouble; } -short FormulaDoubleToken::GetDoubleType() const +sal_Int16 FormulaDoubleToken::GetDoubleType() const { // This is a plain double value without type information, don't emit a // warning via FormulaToken::GetDoubleType(). @@ -1797,12 +1797,12 @@ bool FormulaDoubleToken::operator==( const FormulaToken& r ) const return FormulaToken::operator==( r ) && fDouble == r.GetDouble(); } -short FormulaTypedDoubleToken::GetDoubleType() const +sal_Int16 FormulaTypedDoubleToken::GetDoubleType() const { return mnType; } -void FormulaTypedDoubleToken::SetDoubleType( short nType ) +void FormulaTypedDoubleToken::SetDoubleType( sal_Int16 nType ) { mnType = nType; } |