diff options
Diffstat (limited to 'dom/base/nsDocumentEncoder.cpp')
-rw-r--r-- | dom/base/nsDocumentEncoder.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/dom/base/nsDocumentEncoder.cpp b/dom/base/nsDocumentEncoder.cpp index 34eb6ed383..de41a7331d 100644 --- a/dom/base/nsDocumentEncoder.cpp +++ b/dom/base/nsDocumentEncoder.cpp @@ -1588,10 +1588,13 @@ nsHTMLCopyEncoder::IncludeInContext(nsINode *aNode) nsresult nsHTMLCopyEncoder::PromoteRange(nsIDOMRange *inRange) { - if (!inRange) return NS_ERROR_NULL_POINTER; + RefPtr<nsRange> range = static_cast<nsRange*>(inRange); + if (!range) { + return NS_ERROR_NULL_POINTER; + } nsresult rv; nsCOMPtr<nsIDOMNode> startNode, endNode, common; - int32_t startOffset, endOffset; + uint32_t startOffset, endOffset; rv = inRange->GetCommonAncestorContainer(getter_AddRefs(common)); NS_ENSURE_SUCCESS(rv, rv); @@ -1609,9 +1612,11 @@ nsHTMLCopyEncoder::PromoteRange(nsIDOMRange *inRange) int32_t opStartOffset, opEndOffset; // examine range endpoints. - rv = GetPromotedPoint( kStart, startNode, startOffset, address_of(opStartNode), &opStartOffset, common); + rv = GetPromotedPoint(kStart, startNode, static_cast<int32_t>(startOffset), + address_of(opStartNode), &opStartOffset, common); NS_ENSURE_SUCCESS(rv, rv); - rv = GetPromotedPoint( kEnd, endNode, endOffset, address_of(opEndNode), &opEndOffset, common); + rv = GetPromotedPoint(kEnd, endNode, static_cast<int32_t>(endOffset), + address_of(opEndNode), &opEndOffset, common); NS_ENSURE_SUCCESS(rv, rv); // if both range endpoints are at the common ancestor, check for possible inclusion of ancestors @@ -1623,9 +1628,9 @@ nsHTMLCopyEncoder::PromoteRange(nsIDOMRange *inRange) } // set the range to the new values - rv = inRange->SetStart(opStartNode, opStartOffset); + rv = inRange->SetStart(opStartNode, static_cast<uint32_t>(opStartOffset)); NS_ENSURE_SUCCESS(rv, rv); - rv = inRange->SetEnd(opEndNode, opEndOffset); + rv = inRange->SetEnd(opEndNode, static_cast<uint32_t>(opEndOffset)); return rv; } |