Bug 1391978 - Part 5. Replace nsISelection::GetFocusOffset/GetAnchroOffset with Selection::FocusOffset/AnchorOffset. r?masayuki
MozReview-Commit-ID: 6OpO1GQyhFO
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -2463,27 +2463,27 @@ HTMLEditor::GetSelectedElement(const nsA
// Link tag is a special case - we return the anchor node
// found for any selection that is totally within a link,
// included a collapsed selection (just a caret in a link)
nsCOMPtr<nsIDOMNode> anchorNode;
rv = selection->GetAnchorNode(getter_AddRefs(anchorNode));
NS_ENSURE_SUCCESS(rv, rv);
int32_t anchorOffset = -1;
if (anchorNode) {
- selection->GetAnchorOffset(&anchorOffset);
+ anchorOffset = selection->AnchorOffset();
}
nsCOMPtr<nsINode> focusNode = selection->GetFocusNode();
int32_t focusOffset = -1;
if (focusNode) {
- selection->GetFocusOffset(&focusOffset);
+ focusOffset = selection->FocusOffset();
}
// Link node must be the same for both ends of selection
- if (NS_SUCCEEDED(rv) && anchorNode) {
+ if (anchorNode) {
nsCOMPtr<nsIDOMElement> parentLinkOfAnchor;
rv = GetElementOrParentByTagName(NS_LITERAL_STRING("href"),
anchorNode,
getter_AddRefs(parentLinkOfAnchor));
// XXX: ERROR_HANDLING can parentLinkOfAnchor be null?
if (NS_SUCCEEDED(rv) && parentLinkOfAnchor) {
if (isCollapsed) {
// We have just a caret in the link