[Libreoffice-bugs] [Bug 119590] New: Wrong color scale conditional formatting structure with BASIC

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Aug 29 15:22:01 UTC 2018


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

            Bug ID: 119590
           Summary: Wrong color scale conditional formatting structure
                    with BASIC
           Product: LibreOffice
           Version: 6.1.0.3 release
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: didgeriaccounts at orange.fr

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:

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180829/70952f91/attachment.html>


More information about the Libreoffice-bugs mailing list