Issue 124831

Summary: No property to sort list and combo boxes by default
Product: App Dev Reporter: Ariel Constenla-Haile <arielch>
Component: apiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Normal    
Priority: P3 CC: marcelly.bernard, mroe.nospam
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Writer document with a macro none

Description Ariel Constenla-Haile 2014-05-06 12:07:28 UTC
Created attachment 83343 [details]
Writer document with a macro

The UNO control models have no property to sort the list and combo boxes items.
But this is possible (as the macro shows), it's just not implemented in the toolkit public API.
A new property to enable sorting would be a nice-to-have.
Comment 1 bmarcelly 2015-02-16 14:04:38 UTC
I am not convinced it is so simple.

Your example builds an incomplete dialog object :
  oDlg.getControls() returns an empty array
  oDlg.getModel().getElementNames() returns an empty array
In fact you have created peers but not real controls.

a) The order of items displayed by the control must be the same as in the StringItemList in the model of the control. So that a given position gives the same item in the control and its model.
b) If the model StringItemList is changed by program, it should be sorted again if the property Sort is set.
c) If the property Sort was not set, the list should be sorted when the property is set by program.