[multiple changes]

2004-03-11  Dalibor Topic  <robilad@kaffe.org>

	* java/text/AttributedString.java
	(addAttribute(AttributedCharacterIterator.Attribute,Object,int,int)):
	Use HashMap instead of Hashtable since value can be null, and
	you can not store a null value in a Hashtable.

2004-03-11  Guilhem Lavaux <guilhem@kaffe.org>

	* java/text/AttributedStringIterator.java
	(getAllAttributesKey): Return only keys concerned
	by the current iterator.
	(getAttributes): Use strict inequality for
	end_index.

From-SVN: r79329
This commit is contained in:
Michael Koch 2004-03-11 15:50:34 +00:00
parent c21a266bf2
commit 1ce9c63d50
3 changed files with 28 additions and 8 deletions

View file

@ -179,8 +179,12 @@ getAllAttributeKeys()
if (attribs == null)
return(s);
for (int i = 0; i < attribs.length; i++)
for (int i = 0; i < attribs.length; i++)
{
if (attribs[i].begin_index > getEndIndex()
|| attribs[i].end_index <= getBeginIndex())
continue;
Set key_set = attribs[i].attribs.keySet();
Iterator iter = key_set.iterator();
while (iter.hasNext())
@ -327,7 +331,7 @@ getAttribute(AttributedCharacterIterator.Attribute attrib)
// Check for attribute match and range match
if (obj.equals(attrib))
if ((ci.getIndex() >= attribs[i].begin_index) &&
(ci.getIndex() <= attribs[i].end_index))
(ci.getIndex() < attribs[i].end_index))
return(attribs[i].attribs.get(obj));
}
}
@ -351,7 +355,7 @@ getAttributes()
for (int i = 0; i < attribs.length; i++)
{
if ((ci.getIndex() >= attribs[i].begin_index) &&
(ci.getIndex() <= attribs[i].end_index))
(ci.getIndex() < attribs[i].end_index))
m.putAll(attribs[i].attribs);
}