diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-16 15:52:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-17 07:57:52 +0200 |
commit | dc21a49ea3a5a655e6bf70860b1b99c20e5b7473 (patch) | |
tree | c777f773f8f90dbfe9725eb8be2c3674702b6b15 | |
parent | 4ea27cf64f050b98b8384d0acfe6df8e203413ba (diff) |
convert SbxDecimal::CmpResult to scoped enum
Change-Id: Id2d887c3ce4316a223497ef6790ca326983c4817
-rw-r--r-- | basic/source/sbx/sbxdec.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxdec.hxx | 3 | ||||
-rw-r--r-- | basic/source/sbx/sbxvalue.cxx | 12 |
3 files changed, 9 insertions, 8 deletions
diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx index 8a2df8dcf83e..690b84b5ca30 100644 --- a/basic/source/sbx/sbxdec.cxx +++ b/basic/source/sbx/sbxdec.cxx @@ -324,7 +324,7 @@ SbxDecimal::CmpResult compare( const SbxDecimal &rLeft, const SbxDecimal &rRight { (void)rLeft; (void)rRight; - return (SbxDecimal::CmpResult)0; + return SbxDecimal::CmpResult::LT; } void SbxDecimal::setChar( sal_Unicode val ) { (void)val; } diff --git a/basic/source/sbx/sbxdec.hxx b/basic/source/sbx/sbxdec.hxx index 2bc201be634c..4d80b253f0ed 100644 --- a/basic/source/sbx/sbxdec.hxx +++ b/basic/source/sbx/sbxdec.hxx @@ -95,7 +95,8 @@ public: bool isZero(); - enum CmpResult { LT, EQ, GT }; + // must match the return values of the Microsoft VarDecCmp Automation function + enum class CmpResult { LT, EQ, GT }; friend CmpResult compare( const SbxDecimal &rLeft, const SbxDecimal &rRight ); }; diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index 41713209e622..f4bc90578e96 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -1293,17 +1293,17 @@ bool SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const switch( eOp ) { case SbxEQ: - bRes = ( eRes == SbxDecimal::EQ ); break; + bRes = ( eRes == SbxDecimal::CmpResult::EQ ); break; case SbxNE: - bRes = ( eRes != SbxDecimal::EQ ); break; + bRes = ( eRes != SbxDecimal::CmpResult::EQ ); break; case SbxLT: - bRes = ( eRes == SbxDecimal::LT ); break; + bRes = ( eRes == SbxDecimal::CmpResult::LT ); break; case SbxGT: - bRes = ( eRes == SbxDecimal::GT ); break; + bRes = ( eRes == SbxDecimal::CmpResult::GT ); break; case SbxLE: - bRes = ( eRes != SbxDecimal::GT ); break; + bRes = ( eRes != SbxDecimal::CmpResult::GT ); break; case SbxGE: - bRes = ( eRes != SbxDecimal::LT ); break; + bRes = ( eRes != SbxDecimal::CmpResult::LT ); break; default: SetError( ERRCODE_SBX_NOTIMP ); } |