Bug 717004: Drop unused/unnecessary rv from GetLayoutHistoryAndKey, and check rv of nsILayoutHistoryState::GetState before using its output. r=volkmar

This commit is contained in:
Daniel Holbert 2012-01-10 15:32:58 -08:00
Родитель 9d53b56f95
Коммит 906e5580a5
1 изменённых файлов: 4 добавлений и 4 удалений

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

@ -1624,16 +1624,16 @@ nsGenericHTMLElement::RestoreFormControlState(nsGenericHTMLElement* aContent,
{ {
nsCOMPtr<nsILayoutHistoryState> history; nsCOMPtr<nsILayoutHistoryState> history;
nsCAutoString key; nsCAutoString key;
nsresult rv = GetLayoutHistoryAndKey(aContent, true, GetLayoutHistoryAndKey(aContent, true,
getter_AddRefs(history), key); getter_AddRefs(history), key);
if (!history) { if (!history) {
return false; return false;
} }
nsPresState *state; nsPresState *state;
// Get the pres state for this key // Get the pres state for this key
rv = history->GetState(key, &state); nsresult rv = history->GetState(key, &state);
if (state) { if (NS_SUCCEEDED(rv) && state) {
bool result = aControl->RestoreState(state); bool result = aControl->RestoreState(state);
history->RemoveState(key); history->RemoveState(key);
return result; return result;