Bug 1343037 part 10. Remove the unused SetSelectionStart/SetSelectionEnd bits on text control frame. r=ehsan

MozReview-Commit-ID: G7ODMdAjzxV
This commit is contained in:
Boris Zbarsky 2017-03-09 14:44:05 -05:00
Родитель cced97dfc3
Коммит 083facd7b2
3 изменённых файлов: 0 добавлений и 57 удалений

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

@ -25,9 +25,6 @@ public:
NS_IMETHOD GetEditor(nsIEditor **aEditor) = 0;
NS_IMETHOD SetSelectionStart(int32_t aSelectionStart) = 0;
NS_IMETHOD SetSelectionEnd(int32_t aSelectionEnd) = 0;
NS_IMETHOD SetSelectionRange(int32_t aSelectionStart,
int32_t aSelectionEnd,
SelectionDirection aDirection = eNone) = 0;

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

@ -913,58 +913,6 @@ nsTextControlFrame::SetSelectionRange(int32_t aSelStart, int32_t aSelEnd,
}
NS_IMETHODIMP
nsTextControlFrame::SetSelectionStart(int32_t aSelectionStart)
{
nsresult rv = EnsureEditorInitialized();
NS_ENSURE_SUCCESS(rv, rv);
int32_t selStart = 0, selEnd = 0;
nsCOMPtr<nsITextControlElement> txtCtrl = do_QueryInterface(GetContent());
MOZ_ASSERT(txtCtrl, "Content not a text control element");
ErrorResult controlResult;
txtCtrl->GetSelectionRange(&selStart, &selEnd, controlResult);
if (NS_WARN_IF(controlResult.Failed())) {
return controlResult.StealNSResult();
}
if (aSelectionStart > selEnd) {
// Collapse to the new start point.
selEnd = aSelectionStart;
}
selStart = aSelectionStart;
return SetSelectionEndPoints(selStart, selEnd);
}
NS_IMETHODIMP
nsTextControlFrame::SetSelectionEnd(int32_t aSelectionEnd)
{
nsresult rv = EnsureEditorInitialized();
NS_ENSURE_SUCCESS(rv, rv);
int32_t selStart = 0, selEnd = 0;
nsCOMPtr<nsITextControlElement> txtCtrl = do_QueryInterface(GetContent());
MOZ_ASSERT(txtCtrl, "Content not a text control element");
ErrorResult controlResult;
txtCtrl->GetSelectionRange(&selStart, &selEnd, controlResult);
if (NS_WARN_IF(controlResult.Failed())) {
return controlResult.StealNSResult();
}
if (aSelectionEnd < selStart) {
// Collapse to the new end point.
selStart = aSelectionEnd;
}
selEnd = aSelectionEnd;
return SetSelectionEndPoints(selStart, selEnd);
}
nsresult
nsTextControlFrame::OffsetToDOMPoint(int32_t aOffset,
nsIDOMNode** aResult,

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

@ -142,8 +142,6 @@ public:
//==== NSITEXTCONTROLFRAME
NS_IMETHOD GetEditor(nsIEditor **aEditor) override;
NS_IMETHOD SetSelectionStart(int32_t aSelectionStart) override;
NS_IMETHOD SetSelectionEnd(int32_t aSelectionEnd) override;
NS_IMETHOD SetSelectionRange(int32_t aSelectionStart,
int32_t aSelectionEnd,
SelectionDirection aDirection = eNone) override;