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

Side by Side Diff: Source/core/rendering/RenderTableSection.cpp

Issue 811843003: replace COMPILE_ASSERT with static_assert in core/rendering/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « Source/core/rendering/RenderTableCell.cpp ('k') | Source/core/rendering/RenderText.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 344 }
345 m_rowPos[row + 1] += accumulatedPositionIncrease; 345 m_rowPos[row + 1] += accumulatedPositionIncrease;
346 } 346 }
347 } 347 }
348 348
349 // Sometimes the multiplication of the 2 values below will overflow an integer. 349 // Sometimes the multiplication of the 2 values below will overflow an integer.
350 // So we convert the parameters to 'long long' instead of 'int' to avoid the 350 // So we convert the parameters to 'long long' instead of 'int' to avoid the
351 // problem in this function. 351 // problem in this function.
352 static void updatePositionIncreasedWithRowHeight(long long extraHeight, long lon g rowHeight, long long totalHeight, int& accumulatedPositionIncrease, int& remai nder) 352 static void updatePositionIncreasedWithRowHeight(long long extraHeight, long lon g rowHeight, long long totalHeight, int& accumulatedPositionIncrease, int& remai nder)
353 { 353 {
354 COMPILE_ASSERT(sizeof(long long int) > sizeof(int), int_should_be_less_than_ longlong); 354 static_assert(sizeof(long long int) > sizeof(int), "int should be smaller th an long long");
355 355
356 accumulatedPositionIncrease += (extraHeight * rowHeight) / totalHeight; 356 accumulatedPositionIncrease += (extraHeight * rowHeight) / totalHeight;
357 remainder += (extraHeight * rowHeight) % totalHeight; 357 remainder += (extraHeight * rowHeight) % totalHeight;
358 } 358 }
359 359
360 // This is mainly used to distribute whole extra rowspanning height in percent r ows when all spanning rows are 360 // This is mainly used to distribute whole extra rowspanning height in percent r ows when all spanning rows are
361 // percent rows. 361 // percent rows.
362 // Distributing whole extra rowspanning height in percent rows based on the rati os of percent because this method works 362 // Distributing whole extra rowspanning height in percent rows based on the rati os of percent because this method works
363 // same as percent distribution when only percent rows are present and percent i s 100. Also works perfectly fine when 363 // same as percent distribution when only percent rows are present and percent i s 100. Also works perfectly fine when
364 // percent is not equal to 100. 364 // percent is not equal to 100.
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1615 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1616 if (!style()->isLeftToRightDirection()) 1616 if (!style()->isLeftToRightDirection())
1617 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1617 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1618 else 1618 else
1619 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1619 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1620 1620
1621 cell->setLogicalLocation(cellLocation); 1621 cell->setLogicalLocation(cellLocation);
1622 } 1622 }
1623 1623
1624 } // namespace blink 1624 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTableCell.cpp ('k') | Source/core/rendering/RenderText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698