Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(742)

Unified Diff: Source/core/dom/Range.cpp

Issue 329183002: Removing "using" declarations that import names in the C++ Standard library. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Range.cpp
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index 31f24a347f3000d21e7b7235a16e73d1a731d726..1c795a361708b0597a2df830b72fee3e7a9837cc 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -53,7 +53,6 @@
namespace WebCore {
-using namespace std;
using namespace HTMLNames;
DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, rangeCounter, ("Range"));
@@ -935,8 +934,8 @@ String Range::toString() const
if (type == Node::TEXT_NODE || type == Node::CDATA_SECTION_NODE) {
String data = toCharacterData(n)->data();
int length = data.length();
- int start = (n == m_start.container()) ? min(max(0, m_start.offset()), length) : 0;
- int end = (n == m_end.container()) ? min(max(start, m_end.offset()), length) : length;
+ int start = (n == m_start.container()) ? std::min(std::max(0, m_start.offset()), length) : 0;
+ int end = (n == m_end.container()) ? std::min(std::max(start, m_end.offset()), length) : length;
builder.append(data, start, end - start);
}
}
@@ -1317,8 +1316,8 @@ IntRect Range::boundingBox() const
IntRect result;
Vector<IntRect> rects;
textRects(rects);
- const size_t n = rects.size();
- for (size_t i = 0; i < n; ++i)
+ const std::size_t n = rects.size();
+ for (std::size_t i = 0; i < n; ++i)
result.unite(rects[i]);
return result;
}
@@ -1340,7 +1339,7 @@ void Range::textRects(Vector<IntRect>& rects, bool useSelectionHeight, RangeInFi
continue;
RenderText* renderText = toRenderText(r);
int startOffset = node == startContainer ? m_start.offset() : 0;
- int endOffset = node == endContainer ? m_end.offset() : numeric_limits<int>::max();
+ int endOffset = node == endContainer ? m_end.offset() : std::numeric_limits<int>::max();
bool isFixed = false;
renderText->absoluteRectsForRange(rects, startOffset, endOffset, useSelectionHeight, &isFixed);
allFixed &= isFixed;
@@ -1368,7 +1367,7 @@ void Range::textQuads(Vector<FloatQuad>& quads, bool useSelectionHeight, RangeIn
continue;
RenderText* renderText = toRenderText(r);
int startOffset = node == startContainer ? m_start.offset() : 0;
- int endOffset = node == endContainer ? m_end.offset() : numeric_limits<int>::max();
+ int endOffset = node == endContainer ? m_end.offset() : std::numeric_limits<int>::max();
bool isFixed = false;
renderText->absoluteQuadsForRange(quads, startOffset, endOffset, useSelectionHeight, &isFixed);
allFixed &= isFixed;
@@ -1653,7 +1652,7 @@ FloatRect Range::boundingRect() const
return FloatRect();
FloatRect result;
- for (size_t i = 0; i < quads.size(); ++i)
+ for (std::size_t i = 0; i < quads.size(); ++i)
result.unite(quads[i].boundingBox());
return result;

Powered by Google App Engine
This is Rietveld 408576698