OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2002 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2002 Lars Knoll (knoll@kde.org) |
3 * (C) 2002 Dirk Mueller (mueller@kde.org) | 3 * (C) 2002 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2003, 2006 Apple Computer, Inc. | 4 * Copyright (C) 2003, 2006 Apple Computer, Inc. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License. | 9 * version 2 of the License. |
10 * | 10 * |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 cell->calcPrefWidths(); | 159 cell->calcPrefWidths(); |
160 | 160 |
161 Length w = cell->styleOrColWidth(); | 161 Length w = cell->styleOrColWidth(); |
162 int span = cell->colSpan(); | 162 int span = cell->colSpan(); |
163 int effWidth = 0; | 163 int effWidth = 0; |
164 if (w.isFixed() && w.isPositive()) | 164 if (w.isFixed() && w.isPositive()) |
165 effWidth = w.value(); | 165 effWidth = w.value(); |
166 | 166 |
167 int usedSpan = 0; | 167 int usedSpan = 0; |
168 int i = 0; | 168 int i = 0; |
169 while (usedSpan < span) { | 169 while (usedSpan < span && cCol + i < nEffCols) { |
170 ASSERT(cCol + i < nEffCols); | |
171 int eSpan = m_table->spanOfEffCol(cCol + i); | 170 int eSpan = m_table->spanOfEffCol(cCol + i); |
172 // Only set if no col element has already set it. | 171 // Only set if no col element has already set it. |
173 if (m_width[cCol + i].isAuto() && w.type() != Auto) { | 172 if (m_width[cCol + i].isAuto() && w.type() != Auto) { |
174 m_width[cCol + i].setRawValue(w.type(), w.rawValue() * e
Span / span); | 173 m_width[cCol + i].setRawValue(w.type(), w.rawValue() * e
Span / span); |
175 usedWidth += effWidth * eSpan / span; | 174 usedWidth += effWidth * eSpan / span; |
176 } | 175 } |
177 usedSpan += eSpan; | 176 usedSpan += eSpan; |
178 i++; | 177 i++; |
179 } | 178 } |
180 cCol += i; | 179 cCol += i; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 for (int i = 0; i < nEffCols; i++) { | 325 for (int i = 0; i < nEffCols; i++) { |
327 m_table->columnPositions()[i] = pos; | 326 m_table->columnPositions()[i] = pos; |
328 pos += calcWidth[i] + hspacing; | 327 pos += calcWidth[i] + hspacing; |
329 } | 328 } |
330 int colPositionsSize = m_table->columnPositions().size(); | 329 int colPositionsSize = m_table->columnPositions().size(); |
331 if (colPositionsSize > 0) | 330 if (colPositionsSize > 0) |
332 m_table->columnPositions()[colPositionsSize - 1] = pos; | 331 m_table->columnPositions()[colPositionsSize - 1] = pos; |
333 } | 332 } |
334 | 333 |
335 } // namespace WebCore | 334 } // namespace WebCore |
OLD | NEW |