Changing sort order of language list box

Eike Rathke erack at redhat.com
Tue Jul 24 04:17:22 PDT 2012


Hi Arno,

On Monday, 2012-07-23 18:16:44 -0500, Arno Teigseth wrote:

> Figured out how to break my LO's language list box, so that it would
> only show languages with installed checkers:
> 
> http://imgbin.org/index.php?page=image&id=8868

cool :)

> But, what I'm after is sorting the listbox by
> 1) Languages with Installed checkers then
> 2) Languages without
> 
> Now, I can't find where in the listbox control source the actual
> sorting takes place? Any hints?

The listbox control does that, it's enabled in
svx/source/dialog/langbox.cxx SvxLanguageBox::Init() with

    // display entries sorted
    SetStyle( GetStyle() | WB_SORT );

So if you wanted two sections sorted each you'd have to disable that,
obtain all entries - basically what's done in
SvxLanguageBox::SetLanguageList() but without calling InsertLanguage(),
sort the two sections independently and insert the sorted entries in
order.

Note though that the sort is not a mere code point sort, a usual sort
algorithm will fail for several translations and/or mixed alphanumeric
strings, details are in vcl/source/control/ilstbox.cxx
ImplEntryList::InsertEntry() and the NaturalStringSorter there above.


> -----BEGIN PGP SIGNATURE-----

Btw, I'd recommend to change the signature from old style inline-PGP to
PGP/MIME so that it doesn't clutter up the message text anymore. In
Thunderbird's Account Settings go to OpenPGP Security and enable Always
use PGP/MIME. See
http://enigmail.mozdev.org/documentation/per-account.php.html

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120724/4a731a74/attachment.pgp>


More information about the LibreOffice mailing list