Bug 151645 - Hidden sections are present in the output document when they merged with option as individual documents
Summary: Hidden sections are present in the output document when they merged with opti...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.5.0
Keywords:
Depends on:
Blocks: Mail-Merge Section
  Show dependency treegraph
 
Reported: 2022-10-19 20:17 UTC by Gellért Gyuris
Modified: 2023-05-06 15:22 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file (10.76 KB, application/vnd.oasis.opendocument.text)
2022-10-19 20:18 UTC, Gellért Gyuris
Details
Test database file (3.58 KB, application/vnd.oasis.opendocument.database)
2022-10-19 20:19 UTC, Gellért Gyuris
Details
Test ouput in one (merged as a single document) - ouput is OK (10.93 KB, application/vnd.oasis.opendocument.text)
2022-10-19 20:21 UTC, Gellért Gyuris
Details
Test ouput 1 (merged as individual documents) - ouput is wrong (10.95 KB, application/vnd.oasis.opendocument.text)
2022-10-19 20:22 UTC, Gellért Gyuris
Details
Test output 1 (merged as individual documents) - output is wrong (10.95 KB, application/vnd.oasis.opendocument.text)
2022-10-19 20:24 UTC, Gellért Gyuris
Details
Test output in one (merged as a single document) - output is OK (10.93 KB, application/vnd.oasis.opendocument.text)
2022-10-19 20:24 UTC, Gellért Gyuris
Details
Test output 1 (merged as individual documents) - output is wrong (10.95 KB, application/vnd.oasis.opendocument.text)
2022-10-19 20:25 UTC, Gellért Gyuris
Details
Test output 2 (merged as individual documents) - output is wrong (11.27 KB, application/vnd.oasis.opendocument.text)
2022-10-19 20:25 UTC, Gellért Gyuris
Details
Test output 3 (merged as individual documents) - output is wrong (10.99 KB, application/vnd.oasis.opendocument.text)
2022-10-19 20:25 UTC, Gellért Gyuris
Details
Version tests (728.21 KB, application/zip)
2023-05-01 20:57 UTC, Gellért Gyuris
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gellért Gyuris 2022-10-19 20:17:55 UTC
Description:
If a document with hidden sections are merged as a single document the hidden sections are stripped form the document. This is the expected result. But if the document is merged as individual documents the hidden sections are present in the document. This is a bug.


Steps to Reproduce:
1. Create a document with this content (automatically numbered list)
  1. first element
  2. second element
  3. third element
2. Insert 3 sections
  -- 1st section
  1. first element
  -- 2nd section
  2. second element
  -- 3rd section
  3. third element
3. Create a mail merge database with some fields: Id, name and some boolean fields. For example:
  ID	Name	Item1	Item2	Istem3
  1	John	true	false	false
  2	Peter	false	true	true
  3	Paul	false	false	true
4. Add "hidden" condition to the all sections: Format > Sections > Hidden: 
  !HiddenDatabase.Sheet.Item1
  !HiddenDatabase.Sheet.Item2
  !HiddenDatabase.Sheet.Item3
5. Choose File > Print and respond with Yes in the message box. Create a merged file as a single document.
6. Choose File > Print and respond with Yes in the message box. Create merged files as individual documents.

Actual Results:
The file created with as a single document options: OK
The files created with option as individual documents: is fails. For example. The output is:

    Peter
    2. second element
    3. third element

Expected Results:
The expected result is:

    Peter
    1. second element
    2. third element


Reproducible: Always


User Profile Reset: No



Additional Info:
Why is the ouput for single document good?
- Open the document.
- See Format > Sections: There are no hidden sections. Only the visible sections are in the document structure. The sections are named in this way: MailMergeSection[datetime][original section name]
  
Why are ouputs for individual documents wrong?
- Open a document.
- See Format > Sections: All sections are present in the document structure and there are hidden sections!
Comment 1 Gellért Gyuris 2022-10-19 20:18:58 UTC
Created attachment 183139 [details]
Test file
Comment 2 Gellért Gyuris 2022-10-19 20:19:29 UTC
Created attachment 183140 [details]
Test database file
Comment 3 Gellért Gyuris 2022-10-19 20:21:00 UTC
Created attachment 183141 [details]
Test ouput in one (merged as a single document) - ouput is OK
Comment 4 Gellért Gyuris 2022-10-19 20:22:49 UTC
Created attachment 183142 [details]
Test ouput 1 (merged as individual documents) - ouput is wrong
Comment 5 Gellért Gyuris 2022-10-19 20:24:01 UTC
Created attachment 183143 [details]
Test output 1 (merged as individual documents) - output is wrong
Comment 6 Gellért Gyuris 2022-10-19 20:24:33 UTC
Created attachment 183144 [details]
Test output in one (merged as a single document) - output is OK
Comment 7 Gellért Gyuris 2022-10-19 20:25:12 UTC
Created attachment 183145 [details]
Test output 1 (merged as individual documents) - output is wrong
Comment 8 Gellért Gyuris 2022-10-19 20:25:30 UTC
Created attachment 183146 [details]
Test output 2 (merged as individual documents) - output is wrong
Comment 9 Gellért Gyuris 2022-10-19 20:25:48 UTC
Created attachment 183147 [details]
Test output 3 (merged as individual documents) - output is wrong
Comment 10 Dieter 2022-11-05 06:09:44 UTC
I confirm it with

Version: 7.4.3.1 (x64) / LibreOffice Community
Build ID: 3793858a34d8fef5b92f8fee233f97766f05e281
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Steps:
1. Open attachment 183139 [details]
2. File > Print and respond with Yes in the message box (use database in attachment 183140 [details]). Create a merged file as a single document.
3. File > Print and respond with Yes in the message box. Create merged files as individual documents.
4. Compare results from step 2 and step 3
Comment 11 Gellért Gyuris 2023-05-01 20:57:09 UTC
Created attachment 187038 [details]
Version tests

1) I guess this bug is a regression. I made some version checks: 
- 4.0.0.3 - works well as expected
- 4.0.6.2 - works well as expected
- 5.2.0.4 - bug is present
- 6.0.0.1 - bug is present
- 7.0.0.3 - bug is present
- 7.3.7.2 - bug is present
- 7.4.0.3 - bug is present
- 7.4.6.2 - bug is present
- 7.5.0.3 - works well as expected
- 7.5.2.2 - works well as expected
- 7.5.2.2 - works well as expected
(See attached results)

2) Bug is fixed/disappeared first in 7.5. I tried to find related commit. Maybe this is it: https://gerrit.libreoffice.org/c/core/+/141520
Comment 12 Dieter 2023-05-02 06:11:40 UTC
(In reply to Gellért Gyuris from comment #11)
> 2) Bug is fixed/disappeared first in 7.5. 
=> RESOLVED WORKSFORME