Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.cpp
Show First 20 Lines • Show All 3577 Lines • ▼ Show 20 Line(s) | 3567 | { | |||
---|---|---|---|---|---|
3578 | QString result; | 3578 | QString result; | ||
3579 | result.reserve(str.size()); | 3579 | result.reserve(str.size()); | ||
3580 | 3580 | | |||
3581 | Q_FOREACH (const QChar ch, str) { | 3581 | Q_FOREACH (const QChar ch, str) { | ||
3582 | if (ch == tabChar) { | 3582 | if (ch == tabChar) { | ||
3583 | // Insert only enough spaces to align to the next indentWidth column | 3583 | // Insert only enough spaces to align to the next indentWidth column | ||
3584 | // This fixes bug #340212 | 3584 | // This fixes bug #340212 | ||
3585 | int spacesToInsert = indentWidth - (column % indentWidth); | 3585 | int spacesToInsert = indentWidth - (column % indentWidth); | ||
3586 | result += QStringLiteral(" ").repeated(spacesToInsert); | 3586 | result += QString(spacesToInsert, QLatin1Char(' ')); | ||
3587 | column += spacesToInsert; | 3587 | column += spacesToInsert; | ||
3588 | } else { | 3588 | } else { | ||
3589 | // Just keep all other typed characters as-is | 3589 | // Just keep all other typed characters as-is | ||
3590 | result += ch; | 3590 | result += ch; | ||
3591 | ++column; | 3591 | ++column; | ||
3592 | } | 3592 | } | ||
3593 | } | 3593 | } | ||
3594 | return result; | 3594 | return result; | ||
▲ Show 20 Lines • Show All 2491 Lines • Show Last 20 Lines |