Bug 82014 - BASIC Removing conditional formatting by API no longer works
Summary: BASIC Removing conditional formatting by API no longer works
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.2.5.1 rc
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.5.0 target:5.0.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2014-08-01 14:16 UTC by pierre-yves samyn
Modified: 2015-12-17 08:29 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
FormatageConditionnel.ods (9.06 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-08-01 14:16 UTC, pierre-yves samyn
Details
ClearCF1.png screenshot 3 conditions (13.95 KB, image/png)
2014-08-01 14:17 UTC, pierre-yves samyn
Details
ClearCF2.png Screenshot empty format (13.09 KB, image/png)
2014-08-01 14:17 UTC, pierre-yves samyn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pierre-yves samyn 2014-08-01 14:16:26 UTC
Created attachment 103819 [details]
FormatageConditionnel.ods

Hi

Removing conditional formatting by API no longer works

Steps to reproduce:
1. Open the FormatageConditionnel.ods attached 

Three conditional formatting defined for C3 (see ClearCF1.png screenshot attached)

2. Launch the PysClearFormats 

sub PysClearFormats

Dim oPlage as object
Dim oFormats as object

oPlage = ThisComponent.Sheets.getByName("Feuille1").GetCellRangeByName("C3")
oFormats = oPlage.conditionalFormat

oFormats.clear
oPlage.conditionalFormat = oFormats

end sub

Expected result: all the conditional formatting of cell C3 deleted
Actual result: a new empty conditional formatting is created (see ClearCF2.png screenshot attached)

3. Don't save and reload
4. Launch the PysClearLastFormats macro

Expected result: the last conditional formatting of cell C3 deleted
Actual result: a new conditional formatting is created with only 2 conditions but the original formatting is still there

Reproduce (user-fr) on:
-Windows XP & Version 3.6.5.2 (Build ID: 5b93205)
-Windows XP &  Version: 4.3.0.4 Build ID: 62ad5818884a2fc2e5780dd45466868d41009ec0

So I set status to New

Last known version Ok: LibreOffice 3.5.7.2 
Version ID : 3215f89-f603614-ab984f2-7348103-1225a5b

This Issue is different from bug 61915 (not the same methods or the same result)

Workaround :
oPlage = ThisComponent.Sheets.getByName("Feuille1").GetCellRangeByName("A1:E15")
oPlage.clearContents(32) 


Regards
Pierre-Yves
Comment 1 pierre-yves samyn 2014-08-01 14:17:15 UTC
Created attachment 103820 [details]
ClearCF1.png screenshot 3 conditions
Comment 2 pierre-yves samyn 2014-08-01 14:17:48 UTC
Created attachment 103821 [details]
ClearCF2.png Screenshot empty format
Comment 3 Buovjaga 2014-11-04 12:05:42 UTC
Confirmed. Need to test on Linux before setting bibisectRequest whiteboard.

Win 7 64-bit Version: 4.4.0.0.alpha1+
Build ID: ad6d94009cf8ea526eb70bf1a07e5c6a21320f83
TinderBox: Win-x86@51-TDF, Branch:MASTER, Time: 2014-11-04_00:06:27
Comment 4 Buovjaga 2014-11-04 15:44:47 UTC
Confirmed on Linux.

Version: 4.3.2.2.0+
Build ID: 4.3.2.2 Arch Linux build-1
Comment 5 Matthew Francis 2014-12-17 07:22:11 UTC
Bibisect results from 43all:

2f701cd5a012710b5a360239b7078ca3b23206ab is the first bad commit
commit 2f701cd5a012710b5a360239b7078ca3b23206ab
Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date:   Mon Dec 10 21:07:58 2012 +0000

    source-hash-e9960f36675a025c0536dec30ae56c50f4adecb1
    
    commit e9960f36675a025c0536dec30ae56c50f4adecb1
    Author:     Radek Doulik <rodo@novell.com>
    AuthorDate: Mon Oct 8 18:03:18 2012 +0200
    Commit:     Radek Doulik <rodo@novell.com>
    CommitDate: Mon Oct 8 18:06:37 2012 +0200
    
        implement a:overrideClrMapping (fixes n#783202)
    
        Change-Id: Ib6c0fd6d9b64f2bff446f919c58027fea76a00cb

# bad: [c2069a369d738078124812312d51f21ea1ce2421] source-hash-f160e4935c474a5293b3d3c11b3d538efb4767a0
# good: [cf86b7f14a98d2d81a5cd93507acb35ff6775d8b] source-hash-85c6244b85b29c1d2bb9d89b62e9512dd65378b5
git bisect start 'last41onmaster' 'last35onmaster'
# good: [cd18cb7f47f7e956c6d19bd0f31a6e30d1173b29] source-hash-558476135865d9ae7b8801a82c177fd1098386ff
git bisect good cd18cb7f47f7e956c6d19bd0f31a6e30d1173b29
# bad: [a7e54955e9f49e8b59dfd8c4533785a680b1796c] source-hash-5da10275a7475efdbfd9de14ea58cf8f4c6c1582
git bisect bad a7e54955e9f49e8b59dfd8c4533785a680b1796c
# bad: [1f14665c5624bc7a502738aa8f4f2bd70a211e72] source-hash-d85fd8a85501547d5bb87822d2589a07aed7f2d6
git bisect bad 1f14665c5624bc7a502738aa8f4f2bd70a211e72
# bad: [2e2d1aeff80dcbe390f6c3fbc54d6c8de81b0a0e] source-hash-64ab96cd15e52da88781e720d6f031dbcd0ba902
git bisect bad 2e2d1aeff80dcbe390f6c3fbc54d6c8de81b0a0e
# good: [12d0e3ae5464de93295e16f9b4d18de1aa3fca35] source-hash-ee34432562393a4549e9e77f71146e43c5d02233
git bisect good 12d0e3ae5464de93295e16f9b4d18de1aa3fca35
# good: [67a1700cf48455c8b0a2411ab01433f405866161] source-hash-d18455e24644a90cbf9f146ea8b4eed74180592b
git bisect good 67a1700cf48455c8b0a2411ab01433f405866161
# bad: [91fed7198400158ba17622fa48f1c85063ba839f] source-hash-7c4d3ea6ba4d42b4dda5148a00c8c411b5d7703d
git bisect bad 91fed7198400158ba17622fa48f1c85063ba839f
# bad: [2f701cd5a012710b5a360239b7078ca3b23206ab] source-hash-e9960f36675a025c0536dec30ae56c50f4adecb1
git bisect bad 2f701cd5a012710b5a360239b7078ca3b23206ab
# first bad commit: [2f701cd5a012710b5a360239b7078ca3b23206ab] source-hash-e9960f36675a025c0536dec30ae56c50f4adecb1
Comment 6 Matthew Francis 2014-12-17 07:30:56 UTC
Within the range of the bibisect, it seems highly likely that one of this set of commits is responsible:

commit 79b1868bf687ff105ce3bf3ccf583434946848aa
Author: Markus Mohrhard <markus.mohrhard@googlemail.com>
Date:   Thu Oct 4 03:53:37 2012 +0200

    more work on getting cell attributes and cond formats in sync
    
    Change-Id: If10059a6d2b8d2449a01fe09eb2efb9ccea55806


... lots more similiar commits omitted ...


commit ce8ac5bbe40e4cb57e1826a81b3b5c4632474789
Author: Markus Mohrhard <markus.mohrhard@googlemail.com>
Date:   Sat Oct 6 06:52:28 2012 +0200

    prevent creating cond formats without a attached range
    
    Change-Id: Ic4c13fa3d0eae54b7db1fa5a4e5c5040582b21ed
Comment 7 Commit Notification 2015-01-07 07:56:31 UTC
Matúš Kukan committed a patch related to this issue.
It has been pushed to "master":

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

fdo#82014: Remove old conditional formats when setting new one by UNO API

It will be available in 4.5.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 8 pierre-yves samyn 2015-02-20 12:16:43 UTC
Hi

(In reply to Commit Notification from comment #7)
> Matúš Kukan committed a patch related to this issue.
> It has been pushed to "master":
>...
> Affected users are encouraged to test the fix and report feedback.

Verified on Windows 7/64 & Version: 4.5.0.0.alpha0+
Build ID: c14ed48c65f20a63da930a526c2a6294d3a3f565
TinderBox: Win-x86@42, Branch:master, Time: 2015-02-20_01:20:20
Locale: fr_FR

Thank you :)

Regards
Pierre-Yves
Comment 9 Commit Notification 2015-04-10 13:56:23 UTC
Jan Holesovsky committed a patch related to this issue.
It has been pushed to "master":

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

fdo#82014: Repaint & set the document to modified after condformat change.

It will be available in 5.0.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 10 Robinson Tryon (qubit) 2015-12-17 08:29:14 UTC
Migrating Whiteboard tags to Keywords: (bibisected)
[NinjaEdit]