Removing conditional formats via UNO in LibreOffice
florian.haftmann at informatik.tu-muenchen.de
Wed Oct 1 08:06:12 PDT 2014
I am locked up in a situation where I want to *remove* an existing
conditional format from a cell range. The minimal example (supposed to
be run in a spreadsheet context) looks as follows:
dim sheet as variant
dim cell as variant
dim cond as object
sheet = thisComponent.sheets.getByIndex(0)
cell = sheet.getCellByPosition(3, 0)
cond = cell.conditionalFormat
cell.conditionalFormat = cond
In OpenOffice.org 3.21, this last three lines would effectively
*replace* the pre-existing conditional format attached to cell (3, 0).
In the meantime (since LibreOffice 188.8.131.52.0 and still in 184.108.40.206) the
semantics has changed such that the re-assignment in the last line does
not replace pre-existing conditional formats but *adds* another (here,
empty) conditional format entry to the cell. Btw. the same occurs if I
operate on a whole cell range rather than a single cell.
I guess this change is mainly due to conditional formats now applying to
whole cell ranges rather then single cells.
So, my question:
a) Is this subtle change above a breakdown or a deliberate change of the
b) If the change is deliberate, how am I supposed to remove existing
conditional formats now?
c) If the change is a breakdown, I am willing to examine further details
Thanks a lot,
More information about the LibreOffice