[Libreoffice-commits] core.git: wizards/com
Caolán McNamara
caolanm at redhat.com
Thu Jan 19 16:22:35 UTC 2017
wizards/com/sun/star/wizards/form/UIControlArranger.java | 8 +-----
wizards/com/sun/star/wizards/ui/ButtonList.java | 18 ++++-----------
wizards/com/sun/star/wizards/ui/ImageList.py | 16 +++++--------
wizards/com/sun/star/wizards/web/BackgroundsDialog.py | 6 +----
wizards/com/sun/star/wizards/web/IconsDialog.py | 7 +----
wizards/com/sun/star/wizards/web/WebWizardDialog.py | 9 +++----
wizards/com/sun/star/wizards/web/data/CGLayout.py | 4 +--
7 files changed, 23 insertions(+), 45 deletions(-)
New commits:
commit 843e2a9dd6127bf7b5b9adde2ef01451449f0ba3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jan 19 16:21:46 2017 +0000
get rid of second hicontrast argument
Change-Id: If68b6c8dac5ea4ff50edf90f2b1b8dbc2e0383b4
diff --git a/wizards/com/sun/star/wizards/form/UIControlArranger.java b/wizards/com/sun/star/wizards/form/UIControlArranger.java
index 566829d..c518530 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 f2aa6ea..3bb1489f3 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 5d7dd79..2e65eec 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 c6c2fa8..d096873 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 31f834b..14862cf 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 f1248bd..4921c32 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 e7bb699..cc5b8fb 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)
More information about the Libreoffice-commits
mailing list