Issue 124831 - No property to sort list and combo boxes by default
Summary: No property to sort list and combo boxes by default
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Normal
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2014-05-06 12:07 UTC by Ariel Constenla-Haile
Modified: 2015-02-16 14:04 UTC (History)
2 users (show)

See Also:
Latest Confirmation in: ---
Developer Difficulty: ---

Writer document with a macro (12.94 KB, application/vnd.oasis.opendocument.text)
2014-05-06 12:07 UTC, Ariel Constenla-Haile
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
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.