add explicit "Clean Whitespace" advanced action

This commit is contained in:
mae
2008-12-09 17:43:31 +01:00
parent 98f35da629
commit 1931304da1
7 changed files with 42 additions and 46 deletions

View File

@@ -302,6 +302,18 @@ void BaseTextDocument::setSyntaxHighlighter(QSyntaxHighlighter *highlighter)
m_highlighter->setDocument(m_document);
}
void BaseTextDocument::cleanWhitespace()
{
QTextCursor cursor(m_document);
cursor.beginEditBlock();
cleanWhitespace(cursor, true);
if (m_storageSettings.m_addFinalNewLine)
ensureFinalNewLine(cursor);
cursor.endEditBlock();
}
void BaseTextDocument::cleanWhitespace(QTextCursor& cursor, bool inEntireDocument)
{