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

Unified Diff: Source/core/layout/LayoutBlockFlowLine.cpp

Issue 1062283002: Use C++11 range-based loop for core/layout (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix it naming Created 5 years, 8 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
« no previous file with comments | « Source/core/layout/LayoutBlock.cpp ('k') | Source/core/layout/LayoutFlowThread.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlockFlowLine.cpp
diff --git a/Source/core/layout/LayoutBlockFlowLine.cpp b/Source/core/layout/LayoutBlockFlowLine.cpp
index c178f18d8c464fce288c9df094558b7aaffc204f..da094bab1fbf3cbaafa0bdf20cc25fd1505eee3c 100644
--- a/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -1013,12 +1013,11 @@ void LayoutBlockFlow::linkToEndLineIfNeeded(LineLayoutState& layoutState)
line->adjustBlockDirectionPosition(delta.toFloat());
}
if (Vector<LayoutBox*>* cleanLineFloats = line->floatsPtr()) {
- Vector<LayoutBox*>::iterator end = cleanLineFloats->end();
- for (Vector<LayoutBox*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
- FloatingObject* floatingObject = insertFloatingObject(**f);
+ for (auto* box : *cleanLineFloats) {
+ FloatingObject* floatingObject = insertFloatingObject(*box);
ASSERT(!floatingObject->originatingLine());
floatingObject->setOriginatingLine(line);
- setLogicalHeight(logicalTopForChild(**f) - marginBeforeForChild(**f) + delta);
+ setLogicalHeight(logicalTopForChild(*box) - marginBeforeForChild(*box) + delta);
positionNewFloats();
}
}
@@ -1629,9 +1628,7 @@ void LayoutBlockFlow::checkFloatsInCleanLine(RootInlineBox* line, Vector<FloatWi
if (!cleanLineFloats)
return;
- Vector<LayoutBox*>::iterator end = cleanLineFloats->end();
- for (Vector<LayoutBox*>::iterator it = cleanLineFloats->begin(); it != end; ++it) {
- LayoutBox* floatingBox = *it;
+ for (auto* floatingBox : *cleanLineFloats) {
floatingBox->layoutIfNeeded();
LayoutSize newSize = floatingBox->size() +
LayoutSize(floatingBox->marginWidth(), floatingBox->marginHeight());
@@ -1742,14 +1739,13 @@ RootInlineBox* LayoutBlockFlow::determineStartPosition(LineLayoutState& layoutSt
RootInlineBox* line = firstRootBox();
while (line != curr) {
if (Vector<LayoutBox*>* cleanLineFloats = line->floatsPtr()) {
- Vector<LayoutBox*>::iterator end = cleanLineFloats->end();
- for (Vector<LayoutBox*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
- FloatingObject* floatingObject = insertFloatingObject(**f);
+ for (auto* box : *cleanLineFloats) {
+ FloatingObject* floatingObject = insertFloatingObject(*box);
ASSERT(!floatingObject->originatingLine());
floatingObject->setOriginatingLine(line);
- setLogicalHeight(logicalTopForChild(**f) - marginBeforeForChild(**f));
+ setLogicalHeight(logicalTopForChild(*box) - marginBeforeForChild(*box));
positionNewFloats();
- ASSERT(layoutState.floats()[numCleanFloats].object == *f);
+ ASSERT(layoutState.floats()[numCleanFloats].object == box);
numCleanFloats++;
}
}
« no previous file with comments | « Source/core/layout/LayoutBlock.cpp ('k') | Source/core/layout/LayoutFlowThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698