Bug 134198 - Copy/paste of a doc results in deviating number of pages of the original (in single page view)
Summary: Copy/paste of a doc results in deviating number of pages of the original (in ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.3 release
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:25.2.0 target:24.8.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Repagination
  Show dependency treegraph
 
Reported: 2020-06-21 16:10 UTC by Telesto
Modified: 2024-10-23 09:12 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (880.26 KB, application/vnd.oasis.opendocument.text)
2020-06-21 16:11 UTC, Telesto
Details
5 pages repro doc (908.54 KB, application/vnd.oasis.opendocument.text)
2024-08-16 15:01 UTC, Miklos Vajna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-06-21 16:10:54 UTC
Description:
Copy/paste of a doc results in deviating number of pages of the original (in single page view)

Steps to Reproduce:
1. Open the attached file (in single page view)
2. CTRL+A
3. CTRL+C
4. CTRL+N (again in single page view)
3. CTRL+V
4. Scroll up
5. update index



Actual Results:
Expected 202

Expected Results:
Result 207
* No empty pages 
* no shifting images


Reproducible: Always


User Profile Reset: No



Additional Info:
Found
Version: 7.1.0.0.alpha0+ (x64)
Build ID: 43c60ce1ac7629a1462e927e6ff937469f58f743
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL

but not in
Version: 6.0.6.0.0+
Build ID: c30963b8b4bbbe42a24b97aafa161eff9d7ccdd4
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: nl-NL (nl_NL); Calc: CL
Comment 1 Telesto 2020-06-21 16:11:53 UTC
Created attachment 162263 [details]
Example file
Comment 2 Telesto 2020-06-21 18:32:01 UTC
Still fine in
Version: 6.4.0.0.alpha0+ (x64)
Build ID: 4a0b2b8024fa6fb8a0ab3e474b7d64fc455028b5
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: CL
Comment 3 BogdanB 2020-06-21 20:13:45 UTC
The last page in index is 209. The last page in document is 211.

Version: 6.4.4.2
Build ID: 3d775be2011f3886db32dfd395a6a6d1ca2630ff
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 4 BogdanB 2020-06-21 20:16:14 UTC
The last page in index is 201. The last page in document is 203.

Version: 6.4.4.2
Build ID: 3d775be2011f3886db32dfd395a6a6d1ca2630ff
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 5 Buovjaga 2020-07-01 12:24:37 UTC Comment hidden (obsolete)
Comment 6 Buovjaga 2020-07-10 07:33:29 UTC
My previous comment is canceled - I saw this even in the oldest of 7.0 repo yesterday.
Comment 7 Abhi 2020-07-10 18:18:20 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2020-07-10 18:55:12 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2022-07-11 03:29:31 UTC Comment hidden (obsolete)
Comment 10 Kira Tubo 2023-09-15 22:41:11 UTC
Reproduced in current stable and daily master builds.

Version: 7.6.1.2 (X86_64) / LibreOffice Community
Build ID: f5defcebd022c5bc36bbb79be232cb6926d8f674
CPU threads: 6; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9a37652b79001bf5208841b9221dee851b9b6d0f
CPU threads: 6; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 11 Buovjaga 2024-08-07 12:09:15 UTC
Bibisected with linux64-6.4 to a55b149a1822e71d20cc28cece827231300337b8
sw layout: remove checks for IsLayoutInCell
Comment 12 Miklos Vajna 2024-08-16 15:01:52 UTC
Created attachment 195870 [details]
5 pages repro doc

Hmm, I don't yet have an idea why the above cleanup would affect anything for an ODT file, which never set this LayoutInCell property.

In any case, here is a 5 page bugdoc (instead of 202 pages) that also reproduces the problem, should be easier to debug with this.

Oh, and I suggest focusing on the problem that the image gets shifted up from the last page to the previous page; if you copy&paste the content of your doc to a new doc, it may have valid reasons to have a different page count, since the compat flags in the old vs new doc can be different, and those can affect the layout.
Comment 13 Miklos Vajna 2024-10-07 07:27:28 UTC
I'll look into the above.
Comment 14 Commit Notification 2024-10-08 11:55:48 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#134198 sw: avoid losing char pos of anchor point on content copy

It will be available in 25.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 15 Commit Notification 2024-10-23 09:12:21 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/04c2823100fd348061c1bb7d13446d1a09e5e25a

tdf#134198 sw: avoid losing char pos of anchor point on content copy

It will be available in 24.8.3.

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.