mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
make use of const iterator in QTextTable::splitCell()
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
18e0bb09d8
commit
35e9aeb055
2 changed files with 3 additions and 4 deletions
|
@ -206,8 +206,7 @@ QTextDocumentPrivate *QTextObject::docHandle() const
|
||||||
|
|
||||||
void QTextBlockGroupPrivate::markBlocksDirty()
|
void QTextBlockGroupPrivate::markBlocksDirty()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < blocks.count(); ++i) {
|
foreach (const QTextBlock &block, blocks) {
|
||||||
const QTextBlock &block = blocks.at(i);
|
|
||||||
pieceTable->documentChange(block.position(), block.length());
|
pieceTable->documentChange(block.position(), block.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1208,8 +1208,8 @@ void QTextTable::splitCell(int row, int column, int numRows, int numCols)
|
||||||
for (int r = row + 1; r < row + rowSpan; ++r) {
|
for (int r = row + 1; r < row + rowSpan; ++r) {
|
||||||
// find the cell before which to insert the new cell markers
|
// find the cell before which to insert the new cell markers
|
||||||
int gridIndex = r * d->nCols + column;
|
int gridIndex = r * d->nCols + column;
|
||||||
QVector<int>::iterator it = qUpperBound(d->cellIndices.begin(), d->cellIndices.end(), gridIndex);
|
QVector<int>::const_iterator it = qUpperBound(d->cellIndices.constBegin(), d->cellIndices.constEnd(), gridIndex);
|
||||||
int cellIndex = it - d->cellIndices.begin();
|
int cellIndex = it - d->cellIndices.constBegin();
|
||||||
int fragment = d->cells.value(cellIndex, d->fragment_end);
|
int fragment = d->cells.value(cellIndex, d->fragment_end);
|
||||||
rowPositions[r - row] = p->fragmentMap().position(fragment);
|
rowPositions[r - row] = p->fragmentMap().position(fragment);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue