Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 20/01/12 13:40, Andrew Douglas Pitonyak wrote:
On 01/20/2012 06:32 AM, Noel Power wrote:
note there is a mistake in the table below

[*] table of behaviour in vba, pre the bug being introduced and post patch

                               mso    old behaviour  present
                            --------------------------------
date + num                    Date      Date          Date
date - num                    Date      Double        Date
date * num                    Double    Double        Double
date / num                    Double    Double        Double
date + date                   Date      Double        Double [1]
should read
date / num                    Double    Date        Double
                                       ^^^^
e.g.

                               mso    old behaviour  present
                            --------------------------------
date + num                    Date      Date          Date
date - num                    Date      Double        Date
date * num                    Double    Double        Double
date / num                    Double    Double        Double
date + date                   Date      Date          Double [1]
date - date                   Double    Double        Double
date * date                   Double    Double        Double

in other words other than the date - num example the 'old' the old and new behaviour *should* match

The only thing with which I disagree is that I would have addition and subtraction return the same types. So, I would say that if date + date returns a date (as your chart shows for MSO) then I would have date - date return a date as well. If not, then I would leave your original change as is so that they are consistent for addition and subtraction.
I would prefer to preserve compatibility ( especially for (+/-) ) as these are afaics the only operators that really make sense. I have a patch to do that that I would like to commit to master

What type is "-date"? I see that never returned a date so (date + (-date)) will return a date.
no idea, it shouldn't be any different then it was before though

Noel


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.