Bug 122835 - DOCX: Selecting a page's first line also selects beginning-of-page marker
Summary: DOCX: Selecting a page's first line also selects beginning-of-page marker
Status: RESOLVED DUPLICATE of bug 118711
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.4.2 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Page-Break DOCX-Page
  Show dependency treegraph
 
Reported: 2019-01-20 16:07 UTC by Johannes Riecken
Modified: 2020-12-10 14:02 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
screencast of bug with page-break paragraph styling (2.37 MB, video/x-flv)
2019-01-23 22:18 UTC, Johannes Riecken
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Riecken 2019-01-20 16:07:30 UTC
Descrption: When I select any page's first line including line-break with mouse or keyboard and then instantiate the selection's contents somewhere else in the document (cut/copy/paste or drag&drop), then a line-break is inserted before the selection contents. When selecting with the mouse, then any selection including the page's first character is enough.

Steps to reproduce:
1. In a new document type Lorem<newline>Ipsum<newline>
2. Move to the beginning of line 1 and select it with shift down arrow. 
3. Cut the line.
4. Move to the empty line at the end and paste.

Expected result:
==Page 1==
Ipsum
Lorem

Actual result:
==Page 1==
Ipsum
==Page 2==
Lorem
Comment 1 Dieter 2019-01-20 16:48:17 UTC
I can't confirm it with

Version: 6.1.4.2 (x64)
Build-ID: 9d0f32d1f0b509096fd65e0d4bec26ddd1938fd3
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: group threaded

But perhaps I don't understand it. Maybe it is possible to add a screencast?
Comment 2 Mike Kaganski 2019-01-20 16:54:05 UTC
If you have set manual page breaks, then these page breaks are part of the paragraph properties. Copying such paragraphs naturally copies all their properties, including that they are started from new page.
Comment 3 Roman Kuznetsov 2019-01-21 19:37:26 UTC
(In reply to Mike Kaganski from comment #2)
> If you have set manual page breaks, then these page breaks are part of the
> paragraph properties. Copying such paragraphs naturally copies all their
> properties, including that they are started from new page.

Mike, is it NOTABUG?
Comment 4 Johannes Riecken 2019-01-22 07:47:31 UTC
I do have that problem on Arch Linux using just the steps to reproduce I mentioned without inserting manual page breaks, although the issue doesn't appear on the Ubuntu machine at work. I'll try to record a screencast after work.
Comment 5 Mike Kaganski 2019-01-22 08:32:52 UTC
In the screencast, please don't forget to show the copied paragraph's properties, esp. text flow tab
Comment 6 Johannes Riecken 2019-01-23 22:18:21 UTC
Created attachment 148572 [details]
screencast of bug with page-break paragraph styling

Here is a short screencast. Let me know if you need any other information. It looks like the problem only appears with .docx files, be they generated by Word or by LibreOffice. In a .docx file generated by Word the "insert page break before" is checked under paragraph styling, but looks like when I generate the .docx file within LibreOffice that's not the case. So here's the amended steps:

Steps to reproduce:
1. In a new document type Lorem<newline>Ipsum<newline>
2. Save as .docx, close LibreOffice and open the file again.
3. Move to the beginning of line 1 and select it with shift down arrow. 
4. Cut the line.
5. Move to the empty line at the end and paste.
Comment 7 Mike Kaganski 2019-01-24 02:57:11 UTC
(In reply to Johannes Riecken from comment #6)

So yes, the problem is the page break explicitly set for the very first paragraph (on DOCX import). Although not shown on your screencast (where you did it wrong when selected the first line *up to start of the second* when opened paragraph properties - try not selecting anything, and just put cursor to first line when opening paragraph properties).

I'm still unsure if this is a bug, since Word has no notion of page styles (it only applies page settings through direct formatting of section properties), so LibreOffice has to map these section properties to auto-generated page  styles, and only in most  simple cases, where only one section is present in the document, could it in principle avoid applying the page break with page style.

Another way to reproduce would be this:
1. Create new test document.
2. Add lorem<newline>ipsum<newline>
3. Apply another page style (e.g., double-click at "First page" at Stylist's page styles; no need to be at the first paragraph at this stage!)
4. Try copying first paragraph to the end (as in your step 5).

Step 3 applies page break with page style to the first paragraph; it's only not needed on the very first paragraph of the document when no custom styles are set (Default page style is used).
Comment 8 Dieter 2019-08-19 06:03:51 UTC
I could reproduce this with steps from comment 7. I've set status to NEW, because described behaviour is reproducible.

Jim, what is the next step to come to a decision, if this is a bug (that can be fixed) or not? Is further input from developers needed?
Comment 9 Justin L 2020-12-10 11:22:07 UTC

*** This bug has been marked as a duplicate of bug 118711 ***