Bug 129331 - cannot hide a section by using "select All" - "Insert > Section" - Hide
Summary: cannot hide a section by using "select All" - "Insert > Section" - Hide
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.3.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Section
  Show dependency treegraph
 
Reported: 2019-12-11 16:44 UTC by sdc.blanco
Modified: 2020-02-14 09:24 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2019-12-11 16:44:55 UTC
Procedure to produce bug

1.  Open new Writer document
2.  Put 1 or more lines of text.  (but do not include a CR after the last line)
3.  Select all the text (where there is no CR before or after the selection) and Insert > Section
4.  Check 'Hide' and click OK  (or click OK without hide, then right-click, Edit Section and check Hide)

Actual result:  The section is not hidden.

Expected result:  The section should be hidden.

Additional information.

1.  Only this particular procedure seems to produce the problem.

2.  If a section is inserted (in a new document) and then text is added to the section, then it can be hidden  (presumably because it is adding a CR after the section).  

3.  If there are multiple lines of text, and only some of them are selected for Insert > Section, then it can be hidden (presumably because there is a line after the section).

4.  In short, it seems to be a highly specialized situation where the text is present first (without CR before or after the text), and then the entire text is selected, and section inserted, then it cannot be hidden.
 
5.  Not exactly a big problem, and not likely for most users to encounter the situation, but there you have it.

Tested with: LO 6.3.3.2 and 6.4.0.0.beta1
Comment 1 Durgapriyanka 2019-12-12 16:16:02 UTC
Thank you for reporting the bug. I can reproduce this bug  in

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

But, not in

Version: 6.4.0.0.alpha1+ (x86)
Build ID: ec7374ff84c71edfbb30d6e4dc5b486b6df7107f
CPU threads: 2; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-11-10_21:37:30
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
Comment 2 sdc.blanco 2019-12-12 16:35:11 UTC
(In reply to Durgapriyanka from comment #1)
> Thank you for reporting the bug. I can reproduce this bug  in
> 
> LibreOffice 3.3.0 
> But, not in
> 
> Version: 6.4.0.0.alpha1+ (x86)

I just reproduced it again in  6.4.0.0.beta1+   and 6.3.3.2

Did you make sure to have no blank lines above or below the selected text and you selected all the text to be inserted into a section?  If you do not follow that condition, then you will not get the bug (i.e., will not be able to hide the section).
Comment 3 sdc.blanco 2019-12-14 01:54:47 UTC
From:  https://help.libreoffice.org/latest/en-US/text/swriter/01/04020100.html#hd_id3150549

"You cannot hide a section if it is the only content on a page, or in a header, footer, footnote, frame, or table cell."

I now assume that this explains the actual result.

So -- as a naive question -- is this a preferred behavior?  In which case, NOTABUG

At best, it seems rather inelegant, especially when the help page needs to warn about it. Maybe WONTFIX?  or enhancement?
Comment 4 Dieter 2019-12-29 10:59:23 UTC
(In reply to sdc.blanco from comment #3)
> So -- as a naive question -- is this a preferred behavior?  In which case,
> NOTABUG
> 
> At best, it seems rather inelegant, especially when the help page needs to
> warn about it. Maybe WONTFIX?  or enhancement?

=> Let's ask design team
Comment 5 Heiko Tietze 2020-01-06 17:22:23 UTC
You cannot have a completely empty document, there is always a single paragraph. Or do you want to add something before/after the void ;-)

Ideally we disable the function but alternatively a feedback would be nice. Confirmation box or an infobar are okay.
Comment 6 sdc.blanco 2020-01-07 13:24:24 UTC
(In reply to Heiko Tietze from comment #5)
> Or do you want to add something before/after the void ;-)

Sounds promising. (-:  Have tried to give a more simple summary now.
 
> Ideally we disable the function but alternatively a feedback would be nice.
> Confirmation box or an infobar are okay.

The matter is more complicated than appreciated originally. 

(but first a motivating use context: Started writing a new document, decided to put the text into a section to be hidden -- encountered the problem).

How to hide a section in an empty document.

1.  New document
2.  Insert>section
3.  Enter text in section
4.  right-click, Edit Section, check Hide, Ok
5.  Section is hidden. No problem. Empty document, etc.
    (also contradicts help page cited in comment #3

And for those who do not plan ahead:

1. New document
2. Enter text
3. Select all
4. Insert>Section, check Hide, Ok.
5. Section is NOT hidden. (checked Hide does not "stick")

(easy enough to "workaround" -- maybe not likely for many to encounter -- but the arbitrary difference seems strange.)  

Maybe an unnecessary restriction from an earlier version of LO?  (given the help page, or maybe the help page comment arose because users were encountering this problem?)  Seems to raise a question about the accuracy of the help page.