<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Wrong color scale conditional formatting structure with BASIC"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=119590">119590</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrong color scale conditional formatting structure with BASIC
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>6.1.0.3 release
</td>
</tr>
<tr>
<th>Hardware</th>
<td>x86-64 (AMD64)
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows (All)
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>BASIC
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>didgeriaccounts@orange.fr
</td>
</tr></table>
<p>
<div>
<pre>Description:
When creating a new color scale conditional formatting, the *ColorScaleEntries*
array is empty and I was not able to find any way to create any new
*com.sun.star.sheet.XColorScaleEntry* entry in it (2 or 3, depending of which
color scale).
Furthermore, when editing this newly created color scale conditional formatting
with the Conditional Formatting graphic tool in Calc, Calc crashes !
(I used Xray to see the structure.)
***************************
Sub addColorScaleCF
Dim oDoc As Object
Dim oRanges As Object 'Method "createByRange" needs a range
collection
Dim oSheet As Object
Dim oRange As Object
Dim EveryCF As Object
Dim NewCF As Object
oDoc = ThisComponent
oRanges = oDoc.createInstance("com.sun.star.sheet.SheetCellRanges")
oSheet = oDoc.Sheets.getByIndex(0)
oRange = oSheet.getCellRangeByName("A1:A4")
'Add oRange to the range collection
oRanges.insertByName("", oRange)
'Get Every CF in sheet
EveryCF = oSheet.ConditionalFormats
'Add a new CF
EveryCF.createByRange(oRanges)
'Get the newly created CF
NewCF= EveryCF.ConditionalFormats(EveryCF.Length - 1)
'Add a new entry (color scale) in the CF
NewCF.createEntry(com.sun.star.sheet.ConditionEntryType.COLORSCALE, 0)
'Explore the new entry
'Xray NewCF.getByIndex(0)
End Sub
***************************
Xray RESULTS
=============
ColorScaleEntries []com.sun.star.sheet.XColorScaleEntry <empty>
ImplementationId []byte <empty> (get),
read-only
PropertySetInfo com.sun.star.beans.XPropertySetInfo (get),
read-only
Type long 1 (get),
read-only
Types []type (get),
read-only
***************************
(Maybe it is not a bug and I missed something about filling the
*ColorScaleEntries* array...)
Steps to Reproduce:
1. Open any Calc document.
2. Execute the macro
3. Edit the newly created conditional formatting
Actual Results:
Depends on the action :
If editing the new CF, crash ! But, basically, I think the problem is the
emptyness of the *ColorScaleEntries* array.
Expected Results:
*ColorScaleEntries* array filled with editable entries.
Reproducible: Always
User Profile Reset: No
Additional Info:</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>