On Thu, Aug 15, 2013 at 10:35 AM, sebb <seb...@gmail.com> wrote: > On 15 August 2013 15:21, Rob Weir <robw...@apache.org> wrote: >> On Thu, Aug 15, 2013 at 10:07 AM, sebb <seb...@gmail.com> wrote: >>> On 15 August 2013 14:47, Rob Weir <robw...@apache.org> wrote: >>>> On Thu, Aug 15, 2013 at 9:41 AM, janI <j...@apache.org> wrote: >>>>> On Aug 15, 2013 3:06 PM, "Rob Weir" <robw...@apache.org> wrote: >>>>>> >>>>>> https://issues.apache.org/ooo/show_bug.cgi?id=122927 >>>>>> >>>>>> It boils down to how an IF() statements are evaluated. >>>>>> >>>>>> Remember, the typical form is IF(Condition;X;Y) where you give a >>>>>> return value for the case where Condition is TRUE and another value >>>>>> when Condition is FALSE. >>>>>> >>>>>> But it is also possible to leave out the last parameter and have a >>>>>> formula like this: >>>>>> >>>>>> IF(Condition;X) >>>>>> >>>>>> So what does the formula evaluate to if Condition is FALSE? >>>>>> >>>>>> The behavior in 4.0.0, returning FALSE, is correct according to the >>>>>> ODF 1.2 specification and is the same as what Excel does. However, it >>>>>> is different than what earlier versions of OpenOffice did, namely >>>>>> returning 0.0. >>>>>> >>>>>> We obviously cannot do both. I think the AOO 4.0.0 behavior is >>>>>> correct and should remain. >>>>> >>>>> I dont understand why we cannot do both, most programming languages >>>>> interpret falase==0 and true==1, that allows the use of boolean functions >>>>> in calculations. >>>>> >>>> >>>> If the user takes the results of the IF() calculation and uses it in >>>> another formula, then FALSE is automatically treated as 0 in any other >>>> formula where a number is expected. You are correct in your >>>> assumption there. So no one gets a wrong answer in a calculation >>>> because of the change. >>>> >>>> What is different is what appears in the cell that actually has the >>>> IF() statement in it. AOO 4.0 and Excel show FALSE. Earlier versions >>>> of AOO showed 0. In this sense we can have one default behavior or >>>> the other, but not both. >>> >>> Could you not add a setting that controls the behaviour? >>> >>> For a fresh install AOO 4.x will show FALSE. >>> But if the user sets the appropriate backwards compatibilty option, it >>> will show 0. >>> >> >> In theory yes, but in practice users don't really think about this as >> a per-installation setting. > > Maybe not, but if it was documented it could solve problems for some users. > And it is a fairly simple solution. > >> They want their spreadsheet to look the >> same as it was when it was created, even if it was created in a >> different version of OpenOffice, > > That I can understand. > >> or in a different spreadsheet application altogether. > > In which case the default may be something else entirely - e.g. > omitted trailing values are not allowed. > >> So a more targeted fix would be to trigger backwards compatibility >> mode whenever you read a spreadsheet that was created in older >> versions of AOO. > > In which case, there needs to be some way to change the behaviour in > case the user wants to update to the new behaviour without recreating > the spreadsheet. > >> Even better is to have a declarative approach where the behaviors are >> encoded in the document itself as metadata. This approach has been >> discussed, but is not yet standardized. > > That would require older sheets to be updated, unless the default for > missing metadata varied between versions. > > When context-sensitive solutions work, it's great. > However when they fail to work, it's usually not at all obvious what > the problem is - nor the solution. >
Maybe it is clearer if you look at it from the perspective of a future AOO 4.2. user who receives a spreadsheet from a AOO 4.1 user who (hypothetically) has a version that allows the user to set the default in their application, on how IF() behaves. The 4.1 document could have been saved in 3.4 mode, or in 4.0 (Excel compatible) mode. So how does the document appear to the 4.2 user? 1) Application per-install user settings are messy. The 4.2 user has no idea what the setting was for the 4.1 user. 2) Logic that tries to render the appearance of a specific version of AOO fails. It might have worked in the 3.4 to 4.1 transition, since 3.4 had only a single behavior. But it breaks in the 4.1 to 4.2 transition since 4.1 would (hypothetically) allow two behaviors. 3) So the only thing that works is to store the setting used in the document itself. This won't fix the past, of course. 3.4 to 4.0 is still messy. But it makes the future a little cleaner. Now you could imagine a per-install setting that gives the defaults to apply to new documents as they are created. But this starts increasing complexity quite quickly. But if done right you could imagine several "compatibility" modes, including one for reading Excel documents, as well as when reading older AOO documents. -Rob >> -Rob >> >>>> -Rob >>>> >>>> >>>>> rgds >>>>> jan i >>>>>> >>>>>> I'd like to close the issue as NOTABUG. But I'd like to get a few >>>>>> more thoughts on this first. >>>>>> >>>>>> Regards, >>>>>> >>>>>> -Rob >>>>>> >>>>>> --------------------------------------------------------------------- >>>>>> To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org >>>>>> For additional commands, e-mail: dev-h...@openoffice.apache.org >>>>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org >>>> For additional commands, e-mail: dev-h...@openoffice.apache.org >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org >>> For additional commands, e-mail: dev-h...@openoffice.apache.org >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org >> For additional commands, e-mail: dev-h...@openoffice.apache.org >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org > For additional commands, e-mail: dev-h...@openoffice.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org For additional commands, e-mail: dev-h...@openoffice.apache.org