summaryrefslogtreecommitdiffstats
path: root/embedding
diff options
context:
space:
mode:
Diffstat (limited to 'embedding')
-rw-r--r--embedding/components/find/nsFind.cpp19
-rw-r--r--embedding/components/find/nsWebBrowserFind.cpp2
2 files changed, 13 insertions, 8 deletions
diff --git a/embedding/components/find/nsFind.cpp b/embedding/components/find/nsFind.cpp
index 63304dafb..89221251e 100644
--- a/embedding/components/find/nsFind.cpp
+++ b/embedding/components/find/nsFind.cpp
@@ -609,7 +609,7 @@ nsFind::NextNode(nsIDOMRange* aSearchRange,
// beginning/end of the search range.
nsCOMPtr<nsIDOMNode> startNode;
nsCOMPtr<nsIDOMNode> endNode;
- int32_t startOffset, endOffset;
+ uint32_t startOffset, endOffset;
if (aContinueOk) {
#ifdef DEBUG_FIND
printf("Match in progress: continuing past endpoint\n");
@@ -645,7 +645,8 @@ nsFind::NextNode(nsIDOMRange* aSearchRange,
}
}
- rv = InitIterator(startNode, startOffset, endNode, endOffset);
+ rv = InitIterator(startNode, static_cast<int32_t>(startOffset),
+ endNode, static_cast<int32_t>(endOffset));
NS_ENSURE_SUCCESS(rv, rv);
if (!aStartPoint) {
aStartPoint = aSearchRange;
@@ -665,14 +666,18 @@ nsFind::NextNode(nsIDOMRange* aSearchRange,
if (mFindBackward) {
aStartPoint->GetEndContainer(getter_AddRefs(node));
if (mIterNode.get() == node.get()) {
- aStartPoint->GetEndOffset(&mIterOffset);
+ uint32_t endOffset;
+ aStartPoint->GetEndOffset(&endOffset);
+ mIterOffset = static_cast<int32_t>(endOffset);
} else {
mIterOffset = -1; // sign to start from end
}
} else {
aStartPoint->GetStartContainer(getter_AddRefs(node));
if (mIterNode.get() == node.get()) {
- aStartPoint->GetStartOffset(&mIterOffset);
+ uint32_t startOffset;
+ aStartPoint->GetStartOffset(&startOffset);
+ mIterOffset = static_cast<int32_t>(startOffset);
} else {
mIterOffset = 0;
}
@@ -997,7 +1002,7 @@ nsFind::Find(const nsAString& aPatText, nsIDOMRange* aSearchRange,
// Get the end point, so we know when to end searches:
nsCOMPtr<nsIDOMNode> endNode;
- int32_t endOffset;
+ uint32_t endOffset;
aEndPoint->GetEndContainer(getter_AddRefs(endNode));
aEndPoint->GetEndOffset(&endOffset);
@@ -1132,8 +1137,8 @@ nsFind::Find(const nsAString& aPatText, nsIDOMRange* aSearchRange,
// Have we gone past the endpoint yet? If we have, and we're not in the
// middle of a match, return.
if (mIterNode == endNode &&
- ((mFindBackward && findex < endOffset) ||
- (!mFindBackward && findex > endOffset))) {
+ ((mFindBackward && findex < static_cast<int32_t>(endOffset)) ||
+ (!mFindBackward && findex > static_cast<int32_t>(endOffset)))) {
ResetAll();
return NS_OK;
}
diff --git a/embedding/components/find/nsWebBrowserFind.cpp b/embedding/components/find/nsWebBrowserFind.cpp
index aadc66f8e..5aefba975 100644
--- a/embedding/components/find/nsWebBrowserFind.cpp
+++ b/embedding/components/find/nsWebBrowserFind.cpp
@@ -518,7 +518,7 @@ nsWebBrowserFind::GetSearchLimits(nsIDOMRange* aSearchRange,
nsCOMPtr<nsIDOMRange> range;
nsCOMPtr<nsIDOMNode> node;
- int32_t offset;
+ uint32_t offset;
// Forward, not wrapping: SelEnd to DocEnd
if (!mFindBackwards && !aWrap) {