diff options
author | Noel Power <noel.power@novell.com> | 2012-01-17 10:11:22 +0000 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2012-01-17 10:17:33 +0000 |
commit | 9eef1e2961f9607fb235b43516bfe9f8fc24eaef (patch) | |
tree | 6235d350ba4b1ab52c83e07e6d6862cc840447c4 /basic | |
parent | 7e69e6485f9e961e9a4862d8252491104018975a (diff) |
fix Date 'operation' Date foobar
Post commit 9df90559d40f029479c4481e31f88737b70742f6 we have problems where Date types are added and subtracted. In fact that commit makes a subset of numberic operation return the date type. This fix ensures that the Date type is only applied when processing '+' ( old behaviour broken by the commit above ) and '-' ( new behaviour for consistency ) If both LHS & RHS are Date types then the result of the operations in question return the Double type.
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/sbx/sbxvalue.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index add49e101a8a..e1aa67de13f8 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -1271,8 +1271,10 @@ Lbl_OpIsDouble: default: SetError( SbxERR_NOTIMP ); } - // #45465 Date needs with "+" a special handling: forces date type - if( GetType() == SbxDATE || rOp.GetType() == SbxDATE ) + // Date with "+" or "-" needs special handling that + // forces the Date type ( except if lhs AND rhs are already + // Date types + if( ( eOp == SbxPLUS || eOp == SbxMINUS )&& ( ( GetType() == SbxDATE || rOp.GetType() == SbxDATE )&& ( GetType() != rOp.GetType() ) ) ) aL.eType = SbxDATE; } |