aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Kandeler <[email protected]>2019-03-04 16:26:00 +0100
committerEike Ziller <[email protected]>2019-03-04 15:46:26 +0000
commit15777d11ef94b2dda4ee496f1bba0a0b229bcd1f (patch)
tree154f394fe5bf82bcbd0e6ed74dfb067ff229bcfe /src
parentaf318f9723fe729556b2a6495216803360b7c83d (diff)
Revert "Preserve non-breaking space on saving text files"
The reverted patch resulted in corrupted text files that had Unicode paragraph separators instead of newlines. This reverts commit c6b6a6a0773275a7c1b803bef62dc37dc5fe010e. Change-Id: Ia2559937afefbe39213ac73551377220b8077cef Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/clangtools/clangfixitsrefactoringchanges.cpp2
-rw-r--r--src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp2
-rw-r--r--src/plugins/projectexplorer/projectfilewizardextension.cpp2
-rw-r--r--src/plugins/texteditor/refactoringchanges.cpp4
-rw-r--r--src/plugins/texteditor/textdocument.cpp2
5 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp
index f2493b10cac..c3b6f4ac3ef 100644
--- a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp
+++ b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp
@@ -126,7 +126,7 @@ bool FixitsRefactoringFile::apply()
QString error;
for (auto it = m_documents.begin(); it != m_documents.end(); ++it) {
- if (!m_textFileFormat.writeFile(it.key(), it.value()->toRawText(), &error)) {
+ if (!m_textFileFormat.writeFile(it.key(), it.value()->toPlainText(), &error)) {
qCDebug(fixitsLog) << "ERROR: Could not write file" << it.key() << ":" << error;
return false; // Error writing file
}
diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp
index 80ee8ffeedd..e0a06c824e5 100644
--- a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp
+++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp
@@ -117,7 +117,7 @@ bool JsonWizardGenerator::formatFile(const JsonWizard *wizard, GeneratedFile *fi
block = block.next();
}
}
- file->setContents(doc.toRawText());
+ file->setContents(doc.toPlainText());
return true;
}
diff --git a/src/plugins/projectexplorer/projectfilewizardextension.cpp b/src/plugins/projectexplorer/projectfilewizardextension.cpp
index 6f44a829bf3..5dab7bbf997 100644
--- a/src/plugins/projectexplorer/projectfilewizardextension.cpp
+++ b/src/plugins/projectexplorer/projectfilewizardextension.cpp
@@ -277,7 +277,7 @@ void ProjectFileWizardExtension::applyCodeStyle(GeneratedFile *file) const
block = block.next();
}
}
- file->setContents(doc.toRawText());
+ file->setContents(doc.toPlainText());
}
} // namespace Internal
diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp
index ad4bc44243f..1d43972e68d 100644
--- a/src/plugins/texteditor/refactoringchanges.cpp
+++ b/src/plugins/texteditor/refactoringchanges.cpp
@@ -97,7 +97,7 @@ bool RefactoringChanges::createFile(const QString &fileName, const QString &cont
TextFileFormat format;
format.codec = EditorManager::defaultTextCodec();
QString error;
- bool saveOk = format.writeFile(fileName, document->toRawText(), &error);
+ bool saveOk = format.writeFile(fileName, document->toPlainText(), &error);
delete document;
if (!saveOk)
return false;
@@ -367,7 +367,7 @@ bool RefactoringFile::apply()
QString error;
// suppress "file has changed" warnings if the file is open in a read-only editor
Core::FileChangeBlocker block(m_fileName);
- if (!m_textFileFormat.writeFile(m_fileName, doc->toRawText(), &error)) {
+ if (!m_textFileFormat.writeFile(m_fileName, doc->toPlainText(), &error)) {
qWarning() << "Could not apply changes to" << m_fileName << ". Error: " << error;
result = false;
}
diff --git a/src/plugins/texteditor/textdocument.cpp b/src/plugins/texteditor/textdocument.cpp
index bfd709d5fef..2bfb51439a1 100644
--- a/src/plugins/texteditor/textdocument.cpp
+++ b/src/plugins/texteditor/textdocument.cpp
@@ -569,7 +569,7 @@ bool TextDocument::save(QString *errorString, const QString &saveFileName, bool
}
}
- const bool ok = write(fName, saveFormat, d->m_document.toRawText(), errorString);
+ const bool ok = write(fName, saveFormat, d->m_document.toPlainText(), errorString);
// restore text cursor and scroll bar positions
if (autoSave && undos < d->m_document.availableUndoSteps()) {