incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 121167] New: XSortableGridData sort is too restrictive on column data type
Date Fri, 05 Oct 2012 17:08:01 GMT
https://issues.apache.org/ooo/show_bug.cgi?id=121167

          Priority: P3
            Bug ID: 121167
          Assignee: ooo-issues@incubator.apache.org
           Summary: XSortableGridData sort is too restrictive on column
                    data type
          Severity: normal
        Issue Type: DEFECT
    Classification: Code
                OS: All
          Reporter: marcelly@club-internet.fr
          Hardware: All
            Status: CONFIRMED
           Version: AOO 3.4.1
         Component: code
           Product: api

Created attachment 79737
  --> https://issues.apache.org/ooo/attachment.cgi?id=79737&action=edit
Three examples of UnoControlGrid trap

Testing the UnoControlGrid, I found cases where column sort do not work.
Investigation shows that it depends on the _value_ of the first cell of the
column, at least in Basic.
The sort mechanism uses the smallest type that can contain the value of the
first cell.

Example 1
If the column contains integer values, if the first cell contains 30 and
another cell contains 7500, sort is impossible.
This happens even if the programmer uses Basic conversion routines, like CLng(
).

Example 2
If the column contains Double values, but if the first cell happens to contains
300.0, sort is impossible because the sort routine supposes that the column
contains short values.
This happens even if the programmer uses CDbl() Basic conversion routine.

An awkward solution in Basic is to fill the cell values of the first row with
explicit UNO types, for example : CreateUnoValue("long", 3)

All programmers using Basic/Python/COM Automation languages will be caught in
this trap and spend a lot of time. And the problem may appear only with certain
data.
A more simple solution is needed :
- either make the sort routine smarter, 
- or force the programmer to indicate the UNO type of each column, for example
have a column property named DataType that must be filled with a string like
"double" or "long".

The attachment contains 3 examples of the above explanations.

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

Mime
View raw message