https://bugs.documentfoundation.org/show_bug.cgi?id=171950

Neil Roberts <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Neil Roberts <[email protected]> ---
(In reply to [email protected] from comment #0)

> While the API documentation suggests that ColorScaleEntries should accept a
> sequence of PropertyValue arrays, the bridge frequently throws
> com.sun.star.lang.IllegalArgumentException or
> com.sun.star.uno.RuntimeException.

Where did you find the information that ColorScaleEntries accepts a sequence of
PropertyValue arrays? The only documentation I can find is this for the
ColorScale service:

https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1sheet_1_1ColorScale.html

That says that the ColorScaleEntries property is a sequence of
XColorScaleEntry’s. So I guess we could mark the bug as NOTABUG seeing as it
looks like you might be misinterpreting the docs. Hovewer, I can’t find a way
to do what you want to do with the API so I guess the bug is that the API
probably needs fixing. 

There doesn’t seem to be any way to construct an XColorScaleEntry aside from
creating a class that implements the interface yourself, which would be a bit
ridiculous. My guess is that the intention is that you’re not supposed to set
the ColorScaleEntries property but instead just read from it in order to get
access to the existing XColorScaleEntry objects and then configure them with
the methods setColor, setFormat and setType.

This already works for data bars if you use code like this:

    cf.createEntry(DATABAR, 0)
    entry = cf[0]
    entry.DataBarEntries[0].setFormula("12")

However it doesn’t seem to work for color scale formatting because nothing
creates the initial XColorScaleEntry’s. Maybe a fix could be to add entries for
2- and 3- colour types in com.sun.star.sheet.ConditionEntryType and then make
it automatically allocate the color entries. Then you could use it like the
data bar example above.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to