TextEditor: Compile with QT_NO_CAST_FROM_ASCII.

Change-Id: I8fa683c4f68d6e3d3a3eb95acf2f54f8c56b87b7
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
Friedemann Kleint
2012-01-05 11:05:28 +01:00
parent f85df65594
commit 34933799fa
19 changed files with 56 additions and 49 deletions

View File

@@ -1005,7 +1005,7 @@ void BaseTextEditorWidget::joinLines()
QString cutLine = cursor.selectedText();
// Collapse leading whitespaces to one or insert whitespace
cutLine.replace(QRegExp("^\\s*"), " ");
cutLine.replace(QRegExp(QLatin1String("^\\s*")), QLatin1String(" "));
cursor.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor);
cursor.removeSelectedText();
@@ -5396,7 +5396,7 @@ void BaseTextEditorWidget::format()
void BaseTextEditorWidget::rewrapParagraph()
{
const int paragraphWidth = displaySettings().m_wrapColumn;
const QRegExp anyLettersOrNumbers = QRegExp("\\w");
const QRegExp anyLettersOrNumbers = QRegExp(QLatin1String("\\w"));
const int tabSize = tabSettings().m_tabSize;
QTextCursor cursor = textCursor();
@@ -5604,7 +5604,7 @@ void BaseTextEditorWidget::setTabSettings(const TabSettings &ts)
// Although the tab stop is stored as qreal the API from QPlainTextEdit only allows it
// to be set as an int. A work around is to access directly the QTextOption.
qreal charWidth = QFontMetricsF(font()).width(QChar(' '));
qreal charWidth = QFontMetricsF(font()).width(QLatin1Char(' '));
QTextOption option = document()->defaultTextOption();
option.setTabStop(charWidth * ts.m_tabSize);
document()->setDefaultTextOption(option);