Bug 1417796 - Refactor AccessibleCaretManager::GetFrameSelection() to eliminate a warning. r=mtseng

Fix warning: do not use 'else' after 'return'

MozReview-Commit-ID: 1jebzioHvph

--HG--
extra : rebase_source : 2dda2495c996eeb37e8421e0a96e97bb8e966905
This commit is contained in:
Ting-Yu Lin 2017-11-16 13:48:20 +08:00
Родитель a8daccc87e
Коммит 5eb302904c
1 изменённых файлов: 15 добавлений и 15 удалений

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

@ -785,24 +785,24 @@ AccessibleCaretManager::GetFrameSelection() const
MOZ_ASSERT(fm);
nsIContent* focusedContent = fm->GetFocusedContent();
if (focusedContent) {
nsIFrame* focusFrame = focusedContent->GetPrimaryFrame();
if (!focusFrame) {
return nullptr;
}
// Prevent us from touching the nsFrameSelection associated with other
// PresShell.
RefPtr<nsFrameSelection> fs = focusFrame->GetFrameSelection();
if (!fs || fs->GetShell() != mPresShell) {
return nullptr;
}
return fs.forget();
} else {
if (!focusedContent) {
// For non-editable content
return mPresShell->FrameSelection();
}
nsIFrame* focusFrame = focusedContent->GetPrimaryFrame();
if (!focusFrame) {
return nullptr;
}
// Prevent us from touching the nsFrameSelection associated with other
// PresShell.
RefPtr<nsFrameSelection> fs = focusFrame->GetFrameSelection();
if (!fs || fs->GetShell() != mPresShell) {
return nullptr;
}
return fs.forget();
}
nsAutoString