OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |