Bug 114067 - Pressing CTRL + ENTER does not create pagebreak if chapter numbering is selected [EDITING]
Summary: Pressing CTRL + ENTER does not create pagebreak if chapter numbering is selec...
Status: RESOLVED DUPLICATE of bug 87409
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.7.2 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Heading-Numbering Writer-Page-Break
  Show dependency treegraph
 
Reported: 2017-11-26 17:10 UTC by Clemens Prill
Modified: 2025-09-12 11:53 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Clemens Prill 2017-11-26 17:10:52 UTC
Description:
A new line is inserted instead of a new page break. This seems unexpected behavior to me but I'm not very sure if this is intended.

Steps to Reproduce:
1. Create a new document with a heading
2. Add capital numbers
3. Go to first character in line of heading so that the chapter number is selected and becomes gray
4. press CTRL + ENTER to create a new pagebreak

Actual Results:  
A new line is added, not a new pagebreak.

Expected Results:
A pagebreak is inserted.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 5.3.7.2 (x64)
Build-ID: 6b8ed514a9f8b44d37a1b96673cbbdd077e24059


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Comment 1 Dieter 2017-11-26 18:35:08 UTC
I confirm this and also think that this is an inconsistent behaviour.
Comment 2 Dieter 2017-11-26 18:36:03 UTC
Additional information: Tested with

Version: 6.0.0.0.alpha1 (x64)
Build ID: c1d1f859b268f650143d48f294999cda0fa57350
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: de-DE (de_DE); Calc: group
Comment 3 Clemens Prill 2017-11-26 18:57:43 UTC
I have a similar issue to this reported one: I also can't add a pagebreak if I try to do it while I have any kind of index selected like table of content. This is an issue to me because I don't know how I can insert a new page as first page if the current first page is a page with a table of content and thus I can't type or insert anything before this index.

This could be related and thus fixed altogether.
Comment 4 Dieter 2017-11-26 19:12:42 UTC
There should only be one issue in a bug report. So I propose to open an new bug report for the second issue you mentioned. You can "connect" those two bugs, if you add the bug number in the field "See Also".
Comment 5 Clemens Prill 2017-11-26 19:26:27 UTC
I think that both case have the same cause: In both cases the pagebreak is not working when a special field is selected (like chapter number or table of content). Thus I would expect a bugfix which takes care of this in a more general approach, not just pagebreak while chapter number is selected.

If you think this could be two causes and it is not directly related to each other, just tell me. I will create a new issue then like you said.
Comment 6 Dieter 2017-11-30 20:45:54 UTC
I can add a page break at the beginning of a TOC, but it is part of the TOC. So I think it might be the problem, that you can't add a line before the TOC.

I'm not a developer, so I can't assess, if both problems can be solved together.
Comment 7 QA Administrators 2018-12-09 03:41:04 UTC Comment hidden (obsolete)
Comment 8 Dieter 2018-12-09 08:49:30 UTC
Still repro in 

Version: 6.2.0.0.beta1 (x64)
Build ID: d1b41307be3f8c19fe6f1938cf056e7ff1eb1d18
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-US (de_DE); UI-Language: en-GB
Calc: threaded

Steps to Reproduce:
1. Create a new document with a heading
2. Add chapter numbering
3. Go to beginning of the heading line (in 6.2.0.0 chapter number is not grey, but that might be another bug)
4. press CTRL + ENTER to create a new pagebreak

Actual Results:  
A new line is added, not a new pagebreak.

Expected Results:
A pagebreak is inserted.

Additional information: If set cursor befor the first charakter of the heading (without headng number) a page break is set.
Comment 9 QA Administrators 2019-12-10 04:04:52 UTC Comment hidden (obsolete, spam)
Comment 10 Justin L 2021-05-01 07:26:00 UTC
repro 7.2+

I can't imagine these two situations would share code, so they would be separate issues (although I wouldn't bother creating a separate report).

Extremely minor, and extremely edge case. Also easy to work around.
TOC: just delete the TOC, and some space, and re-add TOC (easy if you haven't customized the TOC).
HEADING: press Ctrl-Enter at the beginning of the paragraph, not before the numbering. Or press Enter as you did to get an empty paragraph, press Ctrl-Enter there, and then delete the empty paragraph again.
Comment 11 Justin L 2021-05-01 11:38:08 UTC

*** This bug has been marked as a duplicate of bug 87409 ***
Comment 12 Justin L 2025-09-11 21:03:08 UTC
Specifically about OP's trivial case of being in front of numbering:
Steps to reproduce:
1.) turn on bullets or numbering
2.) go left one position (bullet or numbering gets highlighted)
3.) press Ctrl-Enter.  (SplitNode happens, but no RES_BREAK)

SwTextShell::ExecInsert calls FN_INSERT_PAGEBREAK for Ctrl-Enter,
which runs SwWrtShell::InsertPageBreak.

The splitNode works fine, but for RES_BREAK
DocumentContentOperationsManager.cxx's lcl_InsAttr
sees rRg.IsInFrontOfLabel() and does an early return
without handling pOtherSet.
Comment 13 Justin L 2025-09-11 22:56:09 UTC
(In reply to Clemens Prill from comment #3)
> This is an issue to me because
> I can't type or insert anything before this index.
You can do Alt-Enter to create an empty paragraph before the TOC.

Bug 112932 shows that pressing Enter (and also Ctrl-Enter) in a TOC has special meaning - it is supposed to jump to that part of the document. So comment 3 is out of the picture (unless we special-case for being positioned at the START of the ToC).
Comment 14 Justin L 2025-09-12 11:53:24 UTC
(In reply to Justin L from comment #13)
> You can do Alt-Enter to create an empty paragraph before the TOC.

Alt-Enter properly came in 24.8 (and backported to 24.2.2) with
commit aebdc79dbc5bf059ee0921a00d2795e526a52c42
Author: Oliver Specht on Tue Feb 27 16:43:56 2024 +0100
    tdf#146356 insert new paragraph before table of contents
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164050

So perhaps something could be done with CanSpecialInsert/DoSpecialInsert in edtwin.cxx's SwEditWin::KeyInput for this particular case. But I still lean towards comment 10 - none of this is worth the coding complexity.