From 843e2a9dd6127bf7b5b9adde2ef01451449f0ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 19 Jan 2017 16:21:46 +0000 Subject: [PATCH] get rid of second hicontrast argument Change-Id: If68b6c8dac5ea4ff50edf90f2b1b8dbc2e0383b4 --- .../star/wizards/form/UIControlArranger.java | 8 ++------ .../com/sun/star/wizards/ui/ButtonList.java | 18 +++++------------- wizards/com/sun/star/wizards/ui/ImageList.py | 16 ++++++---------- .../sun/star/wizards/web/BackgroundsDialog.py | 6 ++---- .../com/sun/star/wizards/web/IconsDialog.py | 7 ++----- .../sun/star/wizards/web/WebWizardDialog.py | 9 ++++----- .../com/sun/star/wizards/web/data/CGLayout.py | 4 ++-- 7 files changed, 23 insertions(+), 45 deletions(-) diff --git a/wizards/com/sun/star/wizards/form/UIControlArranger.java b/wizards/com/sun/star/wizards/form/UIControlArranger.java index 566829dfa0dc..c5185306705a 100644 --- a/wizards/com/sun/star/wizards/form/UIControlArranger.java +++ b/wizards/com/sun/star/wizards/form/UIControlArranger.java @@ -126,14 +126,10 @@ public class UIControlArranger private class LayoutRenderer implements ButtonList.IImageRenderer { - public Object[] getImageUrls(Object listitem) + public Object getImageUrl(Object listitem) { - int ResId = UIConsts.RID_IMG_FORM + (2 * ((Integer) listitem).intValue()); - return new Integer[] - { - Integer.valueOf(ResId), Integer.valueOf(ResId + 1) - }; + return Integer.valueOf(ResId); } public String render(Object listItem) diff --git a/wizards/com/sun/star/wizards/ui/ButtonList.java b/wizards/com/sun/star/wizards/ui/ButtonList.java index f2aa6eabd094..3bb1489f36ae 100644 --- a/wizards/com/sun/star/wizards/ui/ButtonList.java +++ b/wizards/com/sun/star/wizards/ui/ButtonList.java @@ -288,17 +288,10 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener Object oObj = getObjectFor(i); if (oObj == null) continue; - Object[] oResources = renderer.getImageUrls(oObj); - if (oResources == null) + Object oResource = renderer.getImageUrl(oObj); + if (oResource == null) continue; - if (oResources.length == 1) - { - Helper.setUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, oResources[0]); - } - else if (oResources.length == 2) - { - oUnoDialog.getPeerConfiguration().setImageUrl(m_aButtons[i].getModel(), oResources[0]); - } + oUnoDialog.getPeerConfiguration().setImageUrl(m_aButtons[i].getModel(), oResource); boolean bTabStop = Boolean.TRUE; // focusable ? Boolean.TRUE : Boolean.FALSE; Helper.setUnoPropertyValue(m_aButtons[i].getModel(), "Tabstop", bTabStop); if (refreshOverNull) @@ -533,10 +526,9 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener { /** - * @return two resource ids for an image referenced in the imaglist resourcefile of the - * wizards project; The second one of them is designed to be used for High Contrast Mode. + * @return a resource ids for an image referenced in the resourcefile of the wizards project */ - Object[] getImageUrls(Object listItem); + Object getImageUrl(Object listItem); } private static class SimpleCounterRenderer implements IRenderer diff --git a/wizards/com/sun/star/wizards/ui/ImageList.py b/wizards/com/sun/star/wizards/ui/ImageList.py index 5d7dd792299e..2e65eec55dae 100644 --- a/wizards/com/sun/star/wizards/ui/ImageList.py +++ b/wizards/com/sun/star/wizards/ui/ImageList.py @@ -224,13 +224,10 @@ class ImageList(ListDataListener): focusable = True for index, item in enumerate(self.m_aImages): - oResources = self.renderer.getImageUrls(self.getObjectFor(index)) - if oResources is not None: - if len(oResources) == 1: - item.Model.ImageURL = oResources[0] - elif len(oResources) == 2: - self.oUnoDialog.getPeerConfiguration().setImageUrl( - item.Model, oResources[0]) + oResource = self.renderer.getImageUrl(self.getObjectFor(index)) + if oResource is not None: + self.oUnoDialog.getPeerConfiguration().setImageUrl( + item.Model, oResource) item.Model.Tabstop = bool(focusable) if self.refreshOverNull: @@ -450,10 +447,9 @@ class ImageList(ListDataListener): class IImageRenderer(IRenderer): # @param listItem - # @return two resource ids for an image referenced in the imaglist resourcefile of the - # wizards project; The second one of them is designed to be used for High Contrast Mode. + # @return resource id for an image referenced in the resourcefile of the wizards project @abstractmethod - def getImageUrls(self, listItem): + def getImageUrl(self, listItem): pass class SimpleCounterRenderer(IRenderer): diff --git a/wizards/com/sun/star/wizards/web/BackgroundsDialog.py b/wizards/com/sun/star/wizards/web/BackgroundsDialog.py index c6c2fa8567e3..d096873b8c38 100644 --- a/wizards/com/sun/star/wizards/web/BackgroundsDialog.py +++ b/wizards/com/sun/star/wizards/web/BackgroundsDialog.py @@ -115,11 +115,9 @@ class BackgroundsDialog(ImageListDialog): self.cut = cut_ self.parent = parent - def getImageUrls(self, listItem): - sRetUrls = [] + def getImageUrl(self, listItem): if (listItem is not None): - sRetUrls.append(listItem) - return sRetUrls + return listItem return None def render(self, obj): diff --git a/wizards/com/sun/star/wizards/web/IconsDialog.py b/wizards/com/sun/star/wizards/web/IconsDialog.py index 31f834bb8dc1..14862cfeeb0b 100644 --- a/wizards/com/sun/star/wizards/web/IconsDialog.py +++ b/wizards/com/sun/star/wizards/web/IconsDialog.py @@ -92,15 +92,12 @@ class IconsDialog(ImageListDialog, ImageList.IImageRenderer, ListModel): def getElementAt(self, arg0): return self.objects[arg0] - def getImageUrls(self, listItem): + def getImageUrl(self, listItem): i = listItem iset = self.getIconsetNum(i) icon = self.getIconNum(i) - sRetUrls = list(range(2)) - sRetUrls[0] = self.htmlexpDirectory + "/htmlexpo/" \ + return self.htmlexpDirectory + "/htmlexpo/" \ + self.getIconsetPref(iset) + self.icons[icon] + self.getIconsetPostfix(iset) - sRetUrls[1] = sRetUrls[0] - return sRetUrls def render(self, object): if object is None: diff --git a/wizards/com/sun/star/wizards/web/WebWizardDialog.py b/wizards/com/sun/star/wizards/web/WebWizardDialog.py index f1248bdd89c5..4921c328ea4e 100644 --- a/wizards/com/sun/star/wizards/web/WebWizardDialog.py +++ b/wizards/com/sun/star/wizards/web/WebWizardDialog.py @@ -702,12 +702,11 @@ class WebWizardDialog(WizardDialog): class LayoutRenderer: - def getImageUrls(self, listItem): - oResIds = None + def getImageUrl(self, listItem): + oResId = None if listItem is not None: - oResIds = listItem.getImageUrls() - - return oResIds + oResId = listItem.getImageUrl() + return oResId def render(self, listItem): return "" if (listItem is None) else listItem.cp_Name diff --git a/wizards/com/sun/star/wizards/web/data/CGLayout.py b/wizards/com/sun/star/wizards/web/data/CGLayout.py index e7bb699895f4..cc5b8fbe29eb 100644 --- a/wizards/com/sun/star/wizards/web/data/CGLayout.py +++ b/wizards/com/sun/star/wizards/web/data/CGLayout.py @@ -44,9 +44,9 @@ class CGLayout(ConfigGroup): self.templates[fileName] = files[i] i += 1 - def getImageUrls(self): + def getImageUrl(self): ResId = UIConsts.RID_IMG_WEB + (self.cp_Index * 2) - return [ResId, ResId + 1] + return ResId def getTemplates(self, xmsf): self.createTemplates(xmsf)