diff options
Diffstat (limited to 'src/gui/text/qtextdocumentfragment.cpp')
-rw-r--r-- | src/gui/text/qtextdocumentfragment.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp index 0118c34c97..7d8b2eaa93 100644 --- a/src/gui/text/qtextdocumentfragment.cpp +++ b/src/gui/text/qtextdocumentfragment.cpp @@ -84,7 +84,7 @@ int QTextCopyHelper::appendFragment(int pos, int endPos, int objectIndex) } QString txtToInsert(originalText.constData() + frag->stringPosition + inFragmentOffset, charsToCopy); - if (txtToInsert.length() == 1 + if (txtToInsert.size() == 1 && (txtToInsert.at(0) == QChar::ParagraphSeparator || txtToInsert.at(0) == QTextBeginningOfFrame || txtToInsert.at(0) == QTextEndOfFrame @@ -109,7 +109,7 @@ int QTextCopyHelper::appendFragment(int pos, int endPos, int objectIndex) const int userState = nextBlock.userState(); if (userState != -1) dst->blocksFind(insertPos).setUserState(userState); - insertPos += txtToInsert.length(); + insertPos += txtToInsert.size(); } return charsToCopy; @@ -580,7 +580,7 @@ bool QTextHtmlImporter::appendNodeText() QString textToInsert; textToInsert.reserve(text.size()); - for (int i = 0; i < text.length(); ++i) { + for (int i = 0; i < text.size(); ++i) { QChar ch = text.at(i); if (ch.isSpace() @@ -621,7 +621,7 @@ bool QTextHtmlImporter::appendNodeText() || ch == QChar::ParagraphSeparator) { if (!textToInsert.isEmpty()) { - if (wsm == QTextHtmlParserNode::WhiteSpacePreLine && textToInsert.at(textToInsert.length() - 1) == u' ') + if (wsm == QTextHtmlParserNode::WhiteSpacePreLine && textToInsert.at(textToInsert.size() - 1) == u' ') textToInsert = textToInsert.chopped(1); cursor.insertText(textToInsert, format); textToInsert.clear(); @@ -906,7 +906,7 @@ QTextHtmlImporter::Table QTextHtmlImporter::scanTable(int tableNodeIdx) int tableHeaderRowCount = 0; QList<int> rowNodes; - rowNodes.reserve(at(tableNodeIdx).children.count()); + rowNodes.reserve(at(tableNodeIdx).children.size()); for (int row : at(tableNodeIdx).children) { switch (at(row).id) { case Html_tr: @@ -931,7 +931,7 @@ QTextHtmlImporter::Table QTextHtmlImporter::scanTable(int tableNodeIdx) QList<RowColSpanInfo> rowColSpanForColumn; int effectiveRow = 0; - for (int row : qAsConst(rowNodes)) { + for (int row : std::as_const(rowNodes)) { int colsInRow = 0; for (int cell : at(row).children) { @@ -959,7 +959,7 @@ QTextHtmlImporter::Table QTextHtmlImporter::scanTable(int tableNodeIdx) if (spanInfo.colSpan > 1 || spanInfo.rowSpan > 1) rowColSpans.append(spanInfo); - columnWidths.resize(qMax(columnWidths.count(), colsInRow)); + columnWidths.resize(qMax(columnWidths.size(), colsInRow)); rowColSpanForColumn.resize(columnWidths.size()); for (int i = currentColumn; i < currentColumn + c.tableCellColSpan; ++i) { if (columnWidths.at(i).type() == QTextLength::VariableLength) { @@ -1041,7 +1041,7 @@ QTextHtmlImporter::Table QTextHtmlImporter::scanTable(int tableNodeIdx) QTextTable *textTable = cursor.insertTable(table.rows, table.columns, fmt.toTableFormat()); table.frame = textTable; - for (int i = 0; i < rowColSpans.count(); ++i) { + for (int i = 0; i < rowColSpans.size(); ++i) { const RowColSpanInfo &nfo = rowColSpans.at(i); textTable->mergeCells(nfo.row, nfo.col, nfo.rowSpan, nfo.colSpan); } |