diff options
Diffstat (limited to 'editor/libeditor/HTMLTableEditor.cpp')
-rw-r--r-- | editor/libeditor/HTMLTableEditor.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/editor/libeditor/HTMLTableEditor.cpp b/editor/libeditor/HTMLTableEditor.cpp index 06d6cae26..b26466179 100644 --- a/editor/libeditor/HTMLTableEditor.cpp +++ b/editor/libeditor/HTMLTableEditor.cpp @@ -2932,11 +2932,10 @@ HTMLEditor::GetCellFromRange(nsRange* aRange, NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(startParent, NS_ERROR_FAILURE); - int32_t startOffset; - rv = aRange->GetStartOffset(&startOffset); - NS_ENSURE_SUCCESS(rv, rv); + uint32_t startOffset = aRange->StartOffset(); - nsCOMPtr<nsIDOMNode> childNode = GetChildAt(startParent, startOffset); + nsCOMPtr<nsIDOMNode> childNode = + GetChildAt(startParent, static_cast<int32_t>(startOffset)); // This means selection is probably at a text node (or end of doc?) if (!childNode) { return NS_ERROR_FAILURE; @@ -2947,15 +2946,11 @@ HTMLEditor::GetCellFromRange(nsRange* aRange, NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(startParent, NS_ERROR_FAILURE); - int32_t endOffset; - rv = aRange->GetEndOffset(&endOffset); - NS_ENSURE_SUCCESS(rv, rv); - // If a cell is deleted, the range is collapse - // (startOffset == endOffset) + // (startOffset == aRange->EndOffset()) // so tell caller the cell wasn't found if (startParent == endParent && - endOffset == startOffset+1 && + aRange->EndOffset() == startOffset+1 && HTMLEditUtils::IsTableCell(childNode)) { // Should we also test if frame is selected? (Use GetCellDataAt()) // (Let's not for now -- more efficient) |