Bug 154803 - print selected cells does not work when there is a merged cell in the top row
Summary: print selected cells does not work when there is a merged cell in the top row
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.5.1.2 release
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.6.0 target:7.5.3.2
Keywords: bibisected, bisected, regression
: 154998 (view as bug list)
Depends on:
Blocks: Print
  Show dependency treegraph
 
Reported: 2023-04-14 07:27 UTC by Jaromír Smola
Modified: 2023-05-03 10:10 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Dialogue window (26.11 KB, image/png)
2023-04-14 07:30 UTC, Jaromír Smola
Details
Current state of the print dialog (66.97 KB, image/png)
2023-04-14 09:38 UTC, Andreas Heinisch
Details
Screenshot of selected cells, print dialog settings, and resulting Print to File PDF (124.23 KB, image/png)
2023-04-14 09:58 UTC, Stéphane Guillou (stragu)
Details
Test ODS (15.49 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-04-14 10:00 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaromír Smola 2023-04-14 07:27:55 UTC
Description:
Printing selected cells does not work correctly if the first row of the table is a merged cell in the full width of the selection. 
A blank page will appear.

Steps to Reproduce:
1. I created a table of 4 columns 60 rows.
2. The first row is merged cells across all 4 columns with the text center aligned.
3. I selected cells A1 - D30.
4. I specified printing adjusted to the width and height of one page and chose to print only the selected cells.

Actual Results:
A blank page is printed.

Expected Results:
v


Reproducible: Always


User Profile Reset: No

Additional Info:
v
Comment 1 Jaromír Smola 2023-04-14 07:30:12 UTC
Created attachment 186650 [details]
Dialogue window
Comment 2 Stéphane Guillou (stragu) 2023-04-14 09:26:35 UTC
Thank you Jaromír!
Reproduced on Linux with recent master build:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1b06f35de68a555b85bceb5fc29d1a5f426f4bb7
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: threaded

Bibisected with linux-64-7.5 repo to first bad commit 0500d8ac5870d2a2f13d7069833530b7686ed568 which points to core commit bf39a7a45a9e6d1292a4425e5d25f9ce6551205a which is a cherry pick of:

commit b9411e587586750f36ba9009b5f1e29fe461d8b5
author	Andreas Heinisch <andreas.heinisch@yahoo.de>	Thu Jan 12 07:46:43 2023 +0100
committer	Andreas Heinisch <andreas.heinisch@yahoo.de>	Mon Jan 16 08:28:49 2023 +0000
tdf#147122 - Return cell object when a simple selection is merged
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145378

Andreas, can you please have a look?
Comment 3 Andreas Heinisch 2023-04-14 09:38:32 UTC
Created attachment 186658 [details]
Current state of the print dialog

I am not able to reproduce the issue. Is there something I am missing?
Comment 4 Andreas Heinisch 2023-04-14 09:46:52 UTC
Switching to "Print Selected Cells" shows the issue.
Comment 5 Stéphane Guillou (stragu) 2023-04-14 09:58:52 UTC
Created attachment 186660 [details]
Screenshot of selected cells, print dialog settings, and resulting Print to File PDF

Screenshot of the issue, for the record.
Comment 6 Stéphane Guillou (stragu) 2023-04-14 10:00:23 UTC
Created attachment 186661 [details]
Test ODS

Test document, could be used for UI test.

Steps:
1. Select one range highlighted in orange
2. Ctrl + P
3. More > From Which > Print selected cells

Results: preview and print are wrong.
Comment 7 Commit Notification 2023-04-18 10:41:30 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/10f2e8363076fb9217b4fc8acf12b4d9c13328cc

tdf#154803 - Check if range is entirely merged

It will be available in 7.6.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 8 Commit Notification 2023-04-19 06:21:27 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/752f0aa9d25a286d70a5627d466ce9e76c84fba6

tdf#154803 - Check if range is entirely merged

It will be available in 7.5.4.

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 Stéphane Guillou (stragu) 2023-04-25 07:53:13 UTC
*** Bug 154998 has been marked as a duplicate of this bug. ***
Comment 10 Jaromír Smola 2023-04-25 08:03:27 UTC
Hello,
I've tested on version 7.5.4 and the bug is fixed.
Thank you for your quick response and have a nice day.
Comment 11 Stéphane Guillou (stragu) 2023-04-25 21:45:26 UTC
Also verified in:

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

Thank you!
Comment 12 Commit Notification 2023-04-26 11:21:06 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-7-5-3":

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

tdf#154803 - Check if range is entirely merged

It will be available in 7.5.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.