Issue 69382 - Formula not properly updated when using user field variables
Summary: Formula not properly updated when using user field variables
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: editing (show other issues)
Version: OOo 2.0.1
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-08 09:19 UTC by steropes
Modified: 2017-05-20 11:19 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
An example for the issue, with a variable and two formulaes using it. (5.98 KB, application/vnd.oasis.opendocument.text)
2006-09-08 09:22 UTC, steropes
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description steropes 2006-09-08 09:19:34 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.
Comment 1 steropes 2006-09-08 09:22:14 UTC
Created attachment 39044 [details]
An example for the issue, with a variable and two formulaes using it.
Comment 2 michael.ruess 2006-09-08 11:48:39 UTC
Reassigned to ES.
Comment 3 eric.savary 2006-09-22 10:03:52 UTC
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")
Comment 4 Marcus 2017-05-20 11:19:35 UTC
Reset assigne to the default "issues@openoffice.apache.org".