Bugzilla – Attachment 57988 Details for
Bug 42396
Wizard dropdown does not sort alphabetically
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Dropdown list in Letter Wizard are now ordered alphabetically
0001-Dropdown-list-in-Letter-Wizard-are-now-ordered-alpha.patch (text/plain), 3.25 KB, created by
Szabolcs Dézsi
on 2012-03-03 16:00:19 UTC
(
hide
)
Description:
Dropdown list in Letter Wizard are now ordered alphabetically
Filename:
MIME Type:
Creator:
Szabolcs Dézsi
Created:
2012-03-03 16:00:19 UTC
Size:
3.25 KB
patch
obsolete
>From 19f67b45799639db9549a9aa1f0beac3d4217ed8 Mon Sep 17 00:00:00 2001 >From: Szabolcs Dezsi <dezsiszabi@hotmail.com> >Date: Sun, 4 Mar 2012 00:57:53 +0100 >Subject: [PATCH] Dropdown list in Letter Wizard are now ordered > alphabetically > >--- > .../wizards/letter/LetterWizardDialogImpl.java | 45 ++++++++++++++------ > 1 files changed, 32 insertions(+), 13 deletions(-) > >diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java >index 736233c..55a1a0e 100644 >--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java >+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java >@@ -27,6 +27,8 @@ > ************************************************************************/ > package com.sun.star.wizards.letter; > >+import java.util.Collections; >+import java.util.Comparator; > import java.util.Vector; > import com.sun.star.lang.IllegalArgumentException; > import com.sun.star.lang.WrappedTargetException; >@@ -65,6 +67,20 @@ import com.sun.star.wizards.common.Helper; > public class LetterWizardDialogImpl extends LetterWizardDialog > { > >+ private class Strings >+ { >+ public String Norm; >+ public String NormPath; >+ public String LanguageLabel; >+ >+ public Strings(String norm, String normPath, String languageLabel) >+ { >+ Norm = norm; >+ NormPath = normPath; >+ LanguageLabel = languageLabel; >+ } >+ } >+ > protected void enterStep(int OldStep, int NewStep) > { > } >@@ -1163,9 +1179,8 @@ public class LetterWizardDialogImpl extends LetterWizardDialog > e.printStackTrace(); > } > >- Vector NormsVector = new Vector(); >- Vector NormsPathVector = new Vector(); >- Vector LanguageLabelsVector = new Vector(); >+ Vector StringsVector = new Vector(); >+ > String[] LanguageLabels; > > boolean found = false; >@@ -1202,21 +1217,25 @@ public class LetterWizardDialogImpl extends LetterWizardDialog > > if (found) > { >- NormsVector.add(cIsoCode); >- NormsPathVector.add(nameList[i]); >- LanguageLabelsVector.add(lc.getLanguageString(MSID)); >+ StringsVector.add(new Strings(cIsoCode, (String)nameList[i], lc.getLanguageString(MSID))); > } > } > >+ Collections.sort(StringsVector, new Comparator() { >+ public int compare(Object a, Object b) { >+ return ((Strings)a).LanguageLabel.compareTo(((Strings)b).LanguageLabel); >+ } >+ }); > >- Norms = new String[NormsVector.size()]; >- NormsVector.toArray(Norms); >- >- NormPaths = new String[NormsPathVector.size()]; >- NormsPathVector.toArray(NormPaths); >+ Norms = new String[StringsVector.size()]; >+ NormPaths = new String[StringsVector.size()]; >+ LanguageLabels = new String[StringsVector.size()]; > >- LanguageLabels = new String[LanguageLabelsVector.size()]; >- LanguageLabelsVector.toArray(LanguageLabels); >+ for(int i = 0; i<StringsVector.size(); i++) { >+ Norms[i] = ((Strings)StringsVector.elementAt(i)).Norm; >+ NormPaths[i] = ((Strings)StringsVector.elementAt(i)).NormPath; >+ LanguageLabels[i] = ((Strings)StringsVector.elementAt(i)).LanguageLabel; >+ } > > setControlProperty("lstLetterNorm", PropertyNames.STRING_ITEM_LIST, LanguageLabels); > } >-- >1.7.7 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 42396
: 57988