diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-05-07 07:58:46 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-05-07 15:47:24 +0200 |
commit | aa722151d0e76fddbc3801667f5d613690d5a4d9 (patch) | |
tree | 91ff4a291d2c52e12f5455cbb9c0599a4018871c /wizards | |
parent | 5aa54f17441afee8c2001d73f4b590eeeafd7414 (diff) |
tdf#107668: fix form wizard
Regression from https://cgit.freedesktop.org/libreoffice/core/commit/?id=fcf9c22e00db0107391775f51fac53555711b951
Use an hashmap to find the right helpText
Change-Id: Ie3389406525fb068fb24262a40b8e6af4c744100
Reviewed-on: https://gerrit.libreoffice.org/37334
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/form/UIControlArranger.java | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/wizards/com/sun/star/wizards/form/UIControlArranger.java b/wizards/com/sun/star/wizards/form/UIControlArranger.java index a6b4b77f3a41..15122111fec1 100644 --- a/wizards/com/sun/star/wizards/form/UIControlArranger.java +++ b/wizards/com/sun/star/wizards/form/UIControlArranger.java @@ -17,6 +17,9 @@ */ package com.sun.star.wizards.form; +import java.util.Map; +import java.util.HashMap; + import com.sun.star.awt.ItemEvent; import com.sun.star.awt.Size; import com.sun.star.awt.XControl; @@ -44,11 +47,15 @@ public class UIControlArranger private final XRadioButton optAlignLeft; private final XRadioButton optAlignRight; private final XControl flnLabelPlacement; - private final String[] HelpTexts = new String[4]; + private final Map helpTexts = new HashMap(4); private final ArrangeButtonList[] m_aArrangeList = new ArrangeButtonList[2]; private final Integer IControlStep; private static final int SOBASEIMAGEYPOSITION = 66; private static final int SOIMAGELISTHEIGHT = 60; + private static final String ARRANGELISTSIDE = "private:graphicrepository/wizards/res/formarrangelistside_42.png"; + private static final String ARRANGELISTTOP = "private:graphicrepository/wizards/res/formarrangelisttop_42.png"; + private static final String ARRANGETABLE = "private:graphicrepository/wizards/res/formarrangetable_42.png"; + private static final String ARRANGEFREE = "private:graphicrepository/wizards/res/formarrangefree_42.png"; public UIControlArranger(FormWizard _CurUnoDialog, FormDocument _curFormDocument) { @@ -102,16 +109,23 @@ public class UIControlArranger }); - HelpTexts[0] = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 36); // "Columnar - Labels Left" - HelpTexts[1] = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 37); // "Columnar - Labels of Top" - HelpTexts[2] = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 40); // "As Data Sheet" - HelpTexts[3] = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 39); // In Blocks - Labels Above" - DefaultListModel imageModel = new DefaultListModel(); - imageModel.addElement("private:graphicrepository/wizards/res/formarrangelistside_42.png"); - imageModel.addElement("private:graphicrepository/wizards/res/formarrangelisttop_42.png"); - imageModel.addElement("private:graphicrepository/wizards/res/formarrangetable_42.png"); - imageModel.addElement("private:graphicrepository/wizards/res/formarrangefree_42.png"); + imageModel.addElement(ARRANGELISTSIDE); + imageModel.addElement(ARRANGELISTTOP); + imageModel.addElement(ARRANGETABLE); + imageModel.addElement(ARRANGEFREE); + + // "Columnar - Labels Left" + helpTexts.put(ARRANGELISTSIDE, CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 36)); + + // "Columnar - Labels of Top" + helpTexts.put(ARRANGELISTTOP, CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 37)); + + // "As Data Sheet" + helpTexts.put(ARRANGETABLE, CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 40)); + + // "In Blocks - Labels Above" + helpTexts.put(ARRANGEFREE, CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 39)); String sMainArrangementHeader = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 41); // "Arrangement of the main form" m_aArrangeList[0] = new ArrangeButtonList(0, imageModel, sMainArrangementHeader); @@ -134,7 +148,7 @@ public class UIControlArranger { return PropertyNames.EMPTY_STRING; } - return HelpTexts[((Integer) listItem).intValue()]; + return (String) helpTexts.get(listItem); } } |