Bug 86253 - Copying & paste special / Paintbrush of conditional formatting applies to wrong cell range
Summary: Copying & paste special / Paintbrush of conditional formatting applies to wro...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.3.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Markus Mohrhard
URL:
Whiteboard: target:4.4.0.0.beta2 target:4.3.6 tar...
Keywords: bibisectRequest, regression
: 84927 85701 89408 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-13 14:27 UTC by Kevin Suo
Modified: 2019-12-07 19:22 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
test ods file with conditional formatting for A1:C6 (8.76 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-11-13 14:27 UTC, Kevin Suo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2014-11-13 14:27:14 UTC
Created attachment 109414 [details]
test ods file with conditional formatting for A1:C6

Steps to reproduce:

1. Download and save the attached test ods file. This file contains conditional formatting in cells A1:A6. You can observe the conditions by going to "Format - Conditional Formatting - Manage".

2. Open the saved file, then either:
 * Copy A1, then paste special only "formatting" to C1; or
 * Select A1, click the paintbrush, then apply to C1.

--> Conditional formatting is correctly applied to C1. A new formatting condition is created with the range "C1". This is expected.

3. But, if you do the following:
 * Copy A1, then paste special only "formatting" to C1:C17; or
 * Select A1, click the paintbrush, then apply to C1:C17.

--> Cell formatting for C1:C17 is changed. But, if you go to "Format - Conditional Formatting - Manage", you will see that a new formatting condition is created with the range "C1:C6", rather than "C1:C17". This is wrong behavior.

4. Further, if you save the file modified by step 3, then reopen, you see that cell formatting for C7:C17 are lost. (Of course this is because of the wrong behavior as discussed above in step 3.)

Version: 4.4.0.0.alpha2+
Build ID: c1358e5dc875bb923f4b5472ba615ebd19f0d057
Fedora 20 X64.

Also reproducible with
4.3.4.1
Build ID: bc356b2f991740509f321d70e4512a6a54c5f243 
xubuntu 14.04 64bit

I see that the main codes for conditional formatting is at:
http://cgit.freedesktop.org/libreoffice/core/tree/sc/source/core/data/conditio.cxx
and the recent changes to this file is:
http://cgit.freedesktop.org/libreoffice/core/log/sc/source/core/data/conditio.cxx

Not much changes to this source file, so it may be easier to find the bad commit.

(This bug was first reported at the Chinese LibreOffice discussion forum and was confirmed:
http://www.libreofficechina.org/thread-774-1-1.html
Comment 1 jmxhyz 2014-11-14 11:34:23 UTC
Also reproducible with
 4.3.3.2
Build ID: 9bb7eadab57b6755b1265afa86e04bf45fbfc644
xubuntu 14.04 64bit
Comment 2 Kevin Suo 2014-11-14 13:39:22 UTC
Set version to 4.3.3.2 according to comment 1.
Also jmxhyz pointed out in the chinese forum that it works OK in version 4.2.6.2, so it's a regression.
Comment 3 Markus Mohrhard 2014-11-29 19:48:55 UTC
*** Bug 85701 has been marked as a duplicate of this bug. ***
Comment 4 Markus Mohrhard 2014-11-29 20:13:56 UTC
Ok. I have a fix for this. Another case where our performance improvement for single cell copy&paste has introduced a conditional format regression.
Comment 5 Commit Notification 2014-11-30 00:14:48 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e429686c7797ce6e219dd8cd2dbbb1b59f8909da&h=libreoffice-4-4

we need to copy the condition format cell for cell, fdo#86253

It will be available in 4.4.0.0.beta2.

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 6 Markus Mohrhard 2014-11-30 00:24:41 UTC
review request for 4-3 in gerrit. Patch is also in master but the server reboot dropped the notification
Comment 7 Commit Notification 2014-12-01 09:24:51 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e6b9f1c7364bca5a63d4185b7c4ff10e8feecd2c&h=libreoffice-4-3

we need to copy the condition format cell for cell, fdo#86253

It will be available in 4.3.6.

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 8 Markus Mohrhard 2014-12-04 00:32:11 UTC
*** Bug 84927 has been marked as a duplicate of this bug. ***
Comment 9 Jürgen Mähnß 2015-02-17 10:22:49 UTC
*** Bug 89408 has been marked as a duplicate of this bug. ***
Comment 10 Robinson Tryon (qubit) 2015-12-17 08:39:14 UTC Comment hidden (obsolete)
Comment 11 Jürgen Mähnß 2017-02-09 08:05:54 UTC
Works correctly with LO Version: 5.2.4.2 (x64)
Build-ID: 3d5603e1122f0f102b62521720ab13a38a4e0eb0
Comment 12 Commit Notification 2018-03-18 15:09:33 UTC
Zdeněk Crhonek committed a patch related to this issue.
It has been pushed to "master":

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

uitest for bug tdf#86253

It will be available in 6.1.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 13 raal 2019-12-07 19:22:33 UTC
The test exist, set status to Verified.