fix for 101544: Text color does not change if change is made and no text is typed then the color is changed again. Also fixes 163712: changing font takes no action.

r=brade
sr=kin
This commit is contained in:
jfrancis%netscape.com 2002-11-17 01:03:20 +00:00
Родитель fc5e098023
Коммит 9714ebc7da
1 изменённых файлов: 22 добавлений и 12 удалений

Просмотреть файл

@ -185,19 +185,29 @@ nsresult TypeInState::SetProp(nsIAtom *aProp, const nsString &aAttr, const nsStr
return NS_OK;
}
// if it's already set we are done
if (IsPropSet(aProp,aAttr,nsnull)) return NS_OK;
// make a new propitem
PropItem *item = new PropItem(aProp,aAttr,aValue);
if (!item) return NS_ERROR_OUT_OF_MEMORY;
// remove it from the list of cleared properties, if we have a match
RemovePropFromClearedList(aProp,aAttr);
// add it to the list of set properties
mSetArray.AppendElement((void*)item);
nsAutoString value;
PRInt32 index;
PropItem *item = nsnull;
if (IsPropSet(aProp,aAttr,nsnull,index))
{
// if it's already set, update the value
item = (PropItem*)mSetArray[index];
item->value = aValue;
}
else
{
// make a new propitem
item = new PropItem(aProp,aAttr,aValue);
if (!item) return NS_ERROR_OUT_OF_MEMORY;
// add it to the list of set properties
mSetArray.AppendElement((void*)item);
// remove it from the list of cleared properties, if we have a match
RemovePropFromClearedList(aProp,aAttr);
}
return NS_OK;
}