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;
nsCAutoString key;
nsresult rv = GetLayoutHistoryAndKey(aContent, true,
getter_AddRefs(history), key);
GetLayoutHistoryAndKey(aContent, true,
getter_AddRefs(history), key);
if (!history) {
return false;
}
nsPresState *state;
// Get the pres state for this key
rv = history->GetState(key, &state);
if (state) {
nsresult rv = history->GetState(key, &state);
if (NS_SUCCEEDED(rv) && state) {
bool result = aControl->RestoreState(state);
history->RemoveState(key);
return result;