[Libreoffice-commits] .: basic/source

Noel Power noelp at kemper.freedesktop.org
Tue Jan 17 02:17:37 PST 2012


 basic/source/sbx/sbxvalue.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 9eef1e2961f9607fb235b43516bfe9f8fc24eaef
Author: Noel Power <noel.power at novell.com>
Date:   Tue Jan 17 10:11:22 2012 +0000

    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.

diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index add49e1..e1aa67d 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;
 
                 }


More information about the Libreoffice-commits mailing list