Bug 156980 - "Delete chapter" error message and action in relation to folded headings is inverted in Navigator context menu
Summary: "Delete chapter" error message and action in relation to folded headings is i...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.2.0
Keywords:
Depends on:
Blocks: Writer-Outline-Folding
  Show dependency treegraph
 
Reported: 2023-08-28 23:03 UTC by sdc.blanco
Modified: 2023-11-05 12:31 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test document for delete chapter in Navigator (19.24 KB, application/vnd.oasis.opendocument.text)
2023-08-28 23:03 UTC, sdc.blanco
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2023-08-28 23:03:15 UTC
Created attachment 189218 [details]
test document for delete chapter in Navigator

The attached document has three lines.

-----

Heading Level 1  (with outline open)
  Random text
Heading Level 2 (with outline folded)

------

Test 1: 
  1. Place cursor in ”Heading Level 2 – folded”
  2. Use Navigator, right-click on ”Heading Level 1 – open”, choose ”Delete Heading”

Actual: Dialog box appears, with ”You are trying to delete folded (hidden) content.”
Expected: Either heading and text is deleted or request a confirm before deleting.

Test 2: 
  1. Fold outline of ”Heading Level 1”
  2. Place cursor in Heading Level 2.
  3. Use Navigator, right-click on ”Heading Level 1 – open”, choose ”Delete Heading”

Actual: Nothing happens.
Expected: In light of test 1, I now would expect to get the dialog box that appeared in test 1.

Test 3:

  1.  Use Navigator, right-click on "Heading Level 2 - folded", choose "Delete Heading"

Actual and expected:  Get error message about trying to delete hidden content

I think there is one more variation (that I cannot always repeat) where I add a new heading, and the first time I get the error dialog, then I toggle the heading closed and open, and then it is deleted.

Tested with:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 218a7650a5cf03f895bed19c68d6f02daec536e9
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: CL threaded
Comment 1 Dieter 2023-09-17 16:59:42 UTC
(In reply to sdc.blanco from comment #0)
> Test 1: 
>   1. Place cursor in ”Heading Level 2 – folded”
>   2. Use Navigator, right-click on ”Heading Level 1 – open”, choose ”Delete
> Heading”
> 
> Actual: Dialog box appears, with ”You are trying to delete folded (hidden)
> content.”

Actual result:
- No dialog box appears
- If heading level 2 is folded in navigator, heading level 2 within sublevel (instructions) is deleted
- If heading level 2 is open in navigator, sublevel "instructions" remains.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a4522ef5ce6a625054d83ec907aee07c156e94ed
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-US
Calc: CL threaded
Comment 2 sdc.blanco 2023-09-17 20:17:34 UTC
(In reply to Dieter from comment #1)
Just to be sure. The issue here is outline folding, not whether headings are collapsed or expanded in Navigator. I do not think the issue is affected by whether headings are collapsed or expanded in Navigator.

When I opened the attached document, I noticed that "Heading Level 2 - folded" was not "outline folded".  Make sure it is folded.  Then try the tests.

When "Heading Level 2 - folded" was outline folded, then I reproduced both Test 1 and Test 2, now with a later version.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 218a7650a5cf03f895bed19c68d6f02daec536e9
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Comment 3 Buovjaga 2023-10-02 06:09:35 UTC
(In reply to sdc.blanco from comment #2)
> When I opened the attached document, I noticed that "Heading Level 2 -
> folded" was not "outline folded".  Make sure it is folded.  Then try the
> tests.

Can you advise how to do it? I followed the instructions from https://help.libreoffice.org/latest/en-US/text/swriter/01/outlinecontent_visibility.html but Ctrl does nothing and there is no Outline Folding item in the context menu for headings in the Navigator.

Arch Linux 64-bit, X11
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9eb419b0b0f019f5fbc48ff1a11977e8b041edee
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 2 October 2023
Comment 4 Stéphane Guillou (stragu) 2023-10-02 15:37:20 UTC
I reproduce the three tests in:

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

Jim, any change you could have a look at these special cases?

(In reply to Buovjaga from comment #3)
> Can you advise how to do it? I followed the instructions from
> https://help.libreoffice.org/latest/en-US/text/swriter/01/
> outlinecontent_visibility.html but Ctrl does nothing and there is no Outline
> Folding item in the context menu for headings in the Navigator.

You don't get the right-hand-side arrow when hovering the titles?
Is this setting on? Tool > Options > LO Writer > View > Show Outline-Folding Buttons
Comment 5 Buovjaga 2023-10-02 16:38:29 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> (In reply to Buovjaga from comment #3)
> > Can you advise how to do it? I followed the instructions from
> > https://help.libreoffice.org/latest/en-US/text/swriter/01/
> > outlinecontent_visibility.html but Ctrl does nothing and there is no Outline
> > Folding item in the context menu for headings in the Navigator.
> 
> You don't get the right-hand-side arrow when hovering the titles?
> Is this setting on? Tool > Options > LO Writer > View > Show Outline-Folding
> Buttons

Ok, that was the missing step, I did not have it activated.
Comment 6 Jim Raykowski 2023-10-03 02:58:20 UTC
(In reply to sdc.blanco from comment #0)
> 
> Test 1: 
>   1. Place cursor in ”Heading Level 2 – folded”
>   2. Use Navigator, right-click on ”Heading Level 1 – open”, choose ”Delete
> Heading”
> 
> Actual: Dialog box appears, with ”You are trying to delete folded (hidden)
> content.”
> Expected: Either heading and text is deleted or request a confirm before
> deleting.
I repro this bug.

> Test 2: 
>   1. Fold outline of ”Heading Level 1”
>   2. Place cursor in Heading Level 2.
>   3. Use Navigator, right-click on ”Heading Level 1 – open”, choose ”Delete
> Heading”
> 
> Actual: Nothing happens.
> Expected: In light of test 1, I now would expect to get the dialog box that
> appeared in test 1.
After I set outline folding not to include sub levels I was able to repro this.
I agree that the dialog box should be shown. 

> Test 3:
> 
>   1.  Use Navigator, right-click on "Heading Level 2 - folded", choose
> "Delete Heading"
> 
> Actual and expected:  Get error message about trying to delete hidden content
To repro this, I needed to first fold "Heading Level 2 - folded". Reading comment 2, I see you had clarified this.
 
> I think there is one more variation (that I cannot always repeat) where I
> add a new heading, and the first time I get the error dialog, then I toggle
> the heading closed and open, and then it is deleted.
I'll look into why Test 1 and 2 don't show the dialog box. Same happens when the "Instructions:" heading is folded. I wonder if this has always been the behavior or if something has changed that has caused this.
Comment 7 Jim Raykowski 2023-10-07 05:49:59 UTC
Here is a patch that deletes folded content without any message:
https://gerrit.libreoffice.org/c/core/+/157667

I think this is probably the correct behavior when using the Navigator to delete headings.
Comment 8 Commit Notification 2023-10-10 04:31:20 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ceceb574251d6ed3ce4da2fdcae398cb72488dfa

tdf#156980 SwNavigator: Make headings delete even if they have

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Jim Raykowski 2023-10-10 04:33:28 UTC
Marking this as fixed. Please let me know if more attention is needed.