Bug 69464 - Fields, Show Variable displays 0 in the first paragraph when Set Variable is in the header
Summary: Fields, Show Variable displays 0 in the first paragraph when Set Variable is ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Header-Footer Fields-Variable
  Show dependency treegraph
 
Reported: 2013-09-17 12:53 UTC by Chris Vandenberghe
Modified: 2023-07-20 07:33 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
.odt document bug example (Variable PPmore not showing its correct value before page 13) (69.12 KB, application/vnd.oasis.opendocument.text)
2013-09-17 12:53 UTC, Chris Vandenberghe
Details
Smaller document with the same issue (13.95 KB, application/vnd.oasis.opendocument.text)
2013-09-24 11:54 UTC, Chris Vandenberghe
Details
Screenshot 1 of the smaller document showing the same issue (7.86 KB, image/png)
2013-09-24 11:55 UTC, Chris Vandenberghe
Details
Screenshot 2 of the smaller document showing the same issue (9.89 KB, image/png)
2013-09-24 11:55 UTC, Chris Vandenberghe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Vandenberghe 2013-09-17 12:53:20 UTC
Created attachment 85972 [details]
.odt document bug example (Variable PPmore not showing its correct value before page 13)

Dear,

I've attachted a .odt in which I inserted a Variable "PPmore" in the header.

- in the first part of the document, using the variable returns "0" (which is incorrect)
- in the second part (from page 13) of the document it returns it's correct value ("2")

I've inserted the text "Value of PPmore = " with the Variable inserted.

So you can search for "PPmore" in the document for the position where the value of the Variable "PPmore" becomes correct (on page 13).

(Turning on "show non-printables" doesn't show me anything...)

(FYI : Usage of the Variable : conditially hiding some sections)
 
Thank you very much for looking into this - I would like to tackle this issue.

Kind regards,
Chris Vandenberghe
Comment 1 Cor Nouws 2013-09-17 18:39:38 UTC
Hi Chris,

thanks for reporting. In 4.1.1.2 on Ubuntu I see 2 as value on all places, starting from page 1.

Best,
Cor
Comment 2 Chris Vandenberghe 2013-09-24 11:52:15 UTC
Hi Cor,

Thanks for looking into this.

I'm working on Windows 8.

I managed to reduce the document in size - the variable's that are defined in the header (none of them actually) that are used in the top alinea  (for example VAR123) are showing 0.

When putting a Enter, splitting up the alinea, the variables in the second part ar showing correctly the correct value.

When using a variable that is defined inside that first alinea (see example VAR789), this problem does not occur.

So it seems to be related to inserting the definition of a (new) variable in side the page header ...

I attached the new example document :
 BUG-VariablesInTopAlineaNOK.odt

And two screenshots :
 VariablesInTopAlineaNOK.png
 VariablesInSecondAlineaOK.png

Thanks for your efforts on this issue.

Kind regards,
Chris
Comment 3 Chris Vandenberghe 2013-09-24 11:54:24 UTC
Created attachment 86440 [details]
Smaller document with the same issue

Smaller document with the same issue
Comment 4 Chris Vandenberghe 2013-09-24 11:55:16 UTC
Created attachment 86441 [details]
Screenshot 1 of the smaller document showing the same issue
Comment 5 Chris Vandenberghe 2013-09-24 11:55:44 UTC
Created attachment 86442 [details]
Screenshot 2 of the smaller document showing the same issue
Comment 6 sophie 2014-01-29 17:06:36 UTC
Confirmed using Version: 4.2.0.4
Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71 Ubuntu 13.10 x64.
Change plateform to all, set as New - Sophie
Comment 7 Joel Madero 2015-05-02 15:41:36 UTC Comment hidden (obsolete)
Comment 8 Gordo 2015-05-12 23:32:16 UTC
The first attachment has the value "2" everywhere for me.  I can reproduce the issue with the second attachment.

I was able to reproduce the bug from scratch showing that it only affects the first paragraph as stated in comment 2.

Set Variable in Header:
1. New Text Document.
2. Insert → Header → Default Style.
3. Place cursor in header and Insert → Fields → More Fields.
4. On Variables tab, select Set variable, type “test” in Name, type “123” in Value, and Insert then Close.
5. Place cursor in first paragraph and Insert → Fields → More Fields.
6. On Variables tab, select Show variable, Insert then Close.
Result:
Value is “0”.
7. Place cursor at the end of the first paragraph and Enter.
8. Insert → Fields → More Fields.
9. On Variables tab, select Show variable, Insert then Close.
Result:
Value of second field is “123”.
10. Place cursor before the first field in the first paragraph and Enter.
11. Tools → Update → Fields.
Result:
Value is “123”.

If you set the variable in the footer then showing the variable anywhere on the first page will display “0”.

Set Variable in Footer:
1. New Text Document.
2. Insert → Footer → Default Style.
3. Place cursor in footer and Insert → Fields → More Fields.
4. On Variables tab, select Set variable, type “test” in Name, type “123” in Value, and Insert then Close.
5. Place cursor in first paragraph and Insert → Fields → More Fields.
6. On Variables tab, select Show variable, Insert then Close.
Result:
Value is “0”.
7. Place cursor at the end of the first paragraph and Enter.
8. Insert → Fields → More Fields.
9. On Variables tab, select Show variable, Insert then Close.
Result:
Value is “0”.
10. Either Enter enough paragraphs to start on the next page or Insert → Manual Break → Page Break and OK.
11. Place cursor in first paragraph of second page and Insert → Fields → More Fields.
12. On Variables tab, select Show variable, Insert then Close.
Result:
Value is “123”.

Version: 4.4.3.2
Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Comment 9 Cor Nouws 2015-05-13 06:52:12 UTC
"
So it seems to be related to inserting the definition of a (new) variable in side the page header ..." som IMO minor, not major.
Comment 10 QA Administrators 2016-09-20 09:41:53 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2022-10-24 03:42:27 UTC Comment hidden (obsolete, spam)
Comment 12 Stéphane Guillou (stragu) 2023-07-20 07:33:45 UTC
Reproduced as in comment 8 (header part tested) in:

Version: 5.4.0.3
Build ID: 92c2794a7c181ba4c1c5053618179937228ed1fb
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group

and:

Version: 7.5.5.2 (X86_64) / LibreOffice Community
Build ID: ca8fe7424262805f223b9a2334bc7181abbcbf5e
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Same in OOo 3.3, so issue is inherited.