get rid of second hicontrast argument

Change-Id: If68b6c8dac5ea4ff50edf90f2b1b8dbc2e0383b4
This commit is contained in:
Caolán McNamara 2017-01-19 16:21:46 +00:00
parent 9e82befc72
commit 843e2a9dd6
7 changed files with 23 additions and 45 deletions

View file

@ -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)

View file

@ -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

View file

@ -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):

View file

@ -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):

View file

@ -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:

View file

@ -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

View file

@ -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)