Bug 97526 - Copy of the first line of the page and inserting, produce a page break (except of the first page)
Summary: Copy of the first line of the page and inserting, produce a page break (excep...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-03 13:33 UTC by Juergen Funk (CIB)
Modified: 2016-09-27 06:50 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example from LO and saved in MSWord (4.87 KB, application/vnd.oasis.opendocument.text)
2016-02-03 13:33 UTC, Juergen Funk (CIB)
Details
document to show the benefit of copying page breaks (9.63 KB, application/vnd.oasis.opendocument.text)
2016-02-12 07:54 UTC, Oliver Specht (CIB)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Funk (CIB) 2016-02-03 13:33:10 UTC
Created attachment 122353 [details]
Example from LO and saved in MSWord

First scenario (with MSWord):
-----------------------------
 1. In a empty doc insert "First Line in Lo" <Enter>
 2. save as odt
 3. load in MSWord insert "Second Line in MS" <Enter>
 4. and save
 5. load in Lo
 6. copy the "First Line in Lo"
 7. on a new paragraph insert the Line
 8. you can see a page break and the "First Line in Lo"

When you not have MSWord, you can you us the attached file then you can start with setp 5

I have investigate and found follow

In LO it is: 
<office:automatic-styles>
  <style:style style:name="P1" style:family="paragraph" 
               style:parent-style-name="Standard">
     <style:text-properties officeooo:rsid="0006bdfe" 
                            officeooo:paragraph-rsid="0006bdfe"/>
  </style:style>
</office:automatic-styles>

And when MSWord save, it look like:
<office:automatic-styles>
  <style:style style:name="P1" style:parent-style-name="Standard" 
               style:master-page-name="MP0" style:family="paragraph">
        <style:paragraph-properties fo:break-before="page"/>
  </style:style>
</office:automatic-styles>

The different is: 

    style:master-page-name="MP0" 
    fo:break-before="page" 

I have found a side 
 http://books.evc-cit.info/odbook/ch03.html#master-styles-section 
is decript this and i am not sure is LO wrong or msword, but LO copy here wrong.


I have found the Bug 39400 but it descript the problem in the first page without MSWord. 


-------------------------------------------------------------------------------

Second scenario (only LO)
-------------------------
 1. In a empty doc insert "First line on page 1" <Enter>
 2. insert a manuel page break (CTRL-Enter)
 3. insert "First line on page 2" <Enter>
 4. copy the "First line on page 2"
 5. insert on the new paragraph the Line
 6. you can see on the new page 3 the "First line on page 2"
Comment 1 Juergen Funk (CIB) 2016-02-10 14:07:35 UTC
Commit here https://gerrit.libreoffice.org/22270

would like to make this on 5.1 too
Comment 2 Oliver Specht (CIB) 2016-02-12 07:54:02 UTC
Created attachment 122563 [details]
document to show the benefit of copying page breaks

This document shows a use case where copying page breaks makes sense. 
There is a landscape page (second page) and you might want to copy that and paste it at the end of the document. It is not easily possible to copy from the paragraph before the page break because you'd need to copy the previous table completely.
Comment 3 Juergen Funk (CIB) 2016-02-12 10:23:42 UTC
In this case it is right, but 
 1. no User known, the page is connect with the first line of the page.
 2. oh, but the first page and the first Line to do that not, why 
    (only in LO without MS)?!

In this case, LO is inconsistent.

But a other solution can be, the "special copy" can insert the first page-break
Comment 4 Commit Notification 2016-02-17 07:31:44 UTC
Juergen Funk committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b0facbbedf42a02449d9f35bb4ac8bd7ec2d8917

tdf#97526 - in copy/paste ignore unwanted page break on first paragraph

It will be available in 5.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 5 Juergen Funk (CIB) 2016-02-18 06:56:09 UTC
Now, the fix only remove the page-break from the first page, when you copy the first line from the first page of the document, and paste then this make NO page-break. 
But from the following pages it the same at the past, e.g. copy from the second page the first line and paste at the beginning of the paragraph then you get the page-break. When you paste NOT at the beginning from the paragraph, then it is also suppressed
Comment 6 Xisco Faulí 2016-09-26 10:29:30 UTC
Hello Juergen,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?
Changing status to NEW.
Comment 7 Juergen Funk (CIB) 2016-09-27 06:50:54 UTC
Fixed and tested