Apache OpenOffice (AOO) Bugzilla – Issue 69382
Formula not properly updated when using user field variables
Last modified: 2017-05-20 11:19:35 UTC
Hello, I'd like to report this bug that shows up when using User Fields, with Formulaes and Variables. It's a bit difficult to explain. Basically, when modifying a numeric User Field variable in a formula, it seems to set to zero the other operands. Let's say you have "var=2 and var*2=4". The first '2' is the value of the variable 'var', '4' is the (right) result of the formula 'var*2'. Now, modifying 'var' by clicking on '2' and entering a new value simply sets the result of the formula to... 0. Still a bit unclear ? Let me provide a step by step description. - Open a new Text document. - Go to Insert->Field...->Other... - Go to Variables - Select 'User Field' in the 'Type' column (the leftmost one), type a name (we'll call it 'var') and create the User Field (using the 'V' button). - Now select 'Input field' in the 'Type' column, 'var' should be highlighted in 'Selection'. - Click on 'Insert' : a dialog box appears. Type a numeric value, let's say 1, in the bottom text area. Click OK. - Type in a few spaces, and go to Insert->Field...->Other...->Variables again. - This time select 'Insert Formula'. - In the 'Formula' text area, type for example 'var * 10' (without quotes). Insert the formula, the result is properly calculated. - For the sake of the example, let's create an other field with the exact same formula a bit further in the text. - Modify 'var' by clicking on its field, type in 2 for example. -> The first formula is set to 0, the second is properly calculated. Changing the formula a bit (using var + 10 instead for example), it would seem the operands after var are set to 0. Two workarounds for this: - In simple formulaes like this, putting var last seems to get the formula to be calculated properly. - Modifying in any way the document (except modifying the buggy formula itself). Typing anything seems to get the formula to be calculated properly.
Created attachment 39044 [details] An example for the issue, with a variable and two formulaes using it.
Reassigned to ES.
Strange! Shorter description: - set input field var = 1 - in the document: some text <formula: var * 10> some text <formula: var * 10> - change var to var = 5 -> output is NOT "some text 50 some text 50" BUT: "some text 0 some text 50" This does not happen with variables entered as variables ("Set variable")
Reset assigne to the default "issues@openoffice.apache.org".