diff options
Diffstat (limited to 'layout/generic')
-rw-r--r-- | layout/generic/nsImageFrame.cpp | 14 | ||||
-rw-r--r-- | layout/generic/nsSelection.cpp | 6 |
2 files changed, 13 insertions, 7 deletions
diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index c64520f2ea..ee35ecad81 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -1836,7 +1836,7 @@ nsImageFrame::ShouldDisplaySelection() int32_t thisOffset = parentContent->IndexOf(mContent); nsCOMPtr<nsIDOMNode> parentNode = do_QueryInterface(parentContent); nsCOMPtr<nsIDOMNode> rangeNode; - int32_t rangeOffset; + uint32_t rangeOffset; nsCOMPtr<nsIDOMRange> range; selection->GetRangeAt(0,getter_AddRefs(range)); if (range) @@ -1844,12 +1844,16 @@ nsImageFrame::ShouldDisplaySelection() range->GetStartContainer(getter_AddRefs(rangeNode)); range->GetStartOffset(&rangeOffset); - if (parentNode && rangeNode && (rangeNode == parentNode) && rangeOffset == thisOffset) - { + if (parentNode && rangeNode && rangeNode == parentNode && + static_cast<int32_t>(rangeOffset) == thisOffset) { range->GetEndContainer(getter_AddRefs(rangeNode)); range->GetEndOffset(&rangeOffset); - if ((rangeNode == parentNode) && (rangeOffset == (thisOffset +1))) //+1 since that would mean this whole content is selected only - return false; //do not allow nsFrame do draw any further selection + // +1 since that would mean this whole content is selected only + if (rangeNode == parentNode && + static_cast<int32_t>(rangeOffset) == thisOffset + 1) { + // Do not allow nsFrame do draw any further selection + return false; + } } } } diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index f44ff7ea12..994ec48520 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -4119,13 +4119,15 @@ Selection::GetType(int16_t* aType) static inline bool RangeMatchesBeginPoint(nsRange* aRange, nsINode* aNode, int32_t aOffset) { - return aRange->GetStartParent() == aNode && aRange->StartOffset() == aOffset; + return aRange->GetStartParent() == aNode && + static_cast<int32_t>(aRange->StartOffset()) == aOffset; } static inline bool RangeMatchesEndPoint(nsRange* aRange, nsINode* aNode, int32_t aOffset) { - return aRange->GetEndParent() == aNode && aRange->EndOffset() == aOffset; + return aRange->GetEndParent() == aNode && + static_cast<int32_t>(aRange->EndOffset()) == aOffset; } // Selection::EqualsRangeAtPoint |