diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc
index 2a9b0593079a1f3d78c86f4d0a3d85e506d258d8..98706129f671a4a55c29737c4a6a553f26ca2c1f 100644
--- a/doc/qtcreator.qdoc
+++ b/doc/qtcreator.qdoc
@@ -2011,12 +2011,13 @@
     \list
         \o  Windows XP Service Pack 2
         \o  Windows Vista
-        \o  (K)Ubuntu Linux 5.04
         \o  (K)Ubuntu Linux 7.04 32bit and 64 bit
         \o  Mac OS 10.4 and later
     \endlist
 
-    \note Building the sources requires \bold{Qt 4.6.0} or later.
+    \note Building Qt Creator itself from source requires \bold{Qt 4.6.0} or later.
+          On Windows, MinGW 4.4 or Microsoft Visual Studio 2008 or later are required for compiling
+          Qt Creator itself.
 */
 
 
diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp
index a5b511282fc25f894f99dc32aa630f80aa27d80b..f6852efc8cd736931aba2b58e27ac60eb9d5b23a 100644
--- a/src/libs/cplusplus/pp-engine.cpp
+++ b/src/libs/cplusplus/pp-engine.cpp
@@ -747,7 +747,7 @@ bool Preprocessor::markGeneratedTokens(bool markGeneratedTokens,
                 out(*it);
         }
 
-        if (! markGeneratedTokens && dot->newline())
+        if (! markGeneratedTokens && dot->f.newline)
             processNewline(/*force = */ true);
     }
 
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index d75f328e3909763bbd5ae27e1ecb9bd4648b8688..b7f7da5045c3bbf811210d3de47250ad8d01e33a 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -673,26 +673,30 @@ void CPPEditor::inAllRenameSelections(EditOperation operation,
 {
     cursor.beginEditBlock();
 
-    const int offset = cursor.position() - currentRenameSelection.cursor.anchor();
+    const int startOffset = cursor.selectionStart() - currentRenameSelection.cursor.anchor();
+    const int endOffset = cursor.selectionEnd() - currentRenameSelection.cursor.anchor();
+    const int length = endOffset - startOffset;
 
     for (int i = 0; i < m_renameSelections.size(); ++i) {
         QTextEdit::ExtraSelection &s = m_renameSelections[i];
         int pos = s.cursor.anchor();
         int endPos = s.cursor.position();
-        s.cursor.setPosition(s.cursor.anchor() + offset);
+
+        s.cursor.setPosition(pos + startOffset);
+        s.cursor.setPosition(pos + endOffset, QTextCursor::KeepAnchor);
 
         switch (operation) {
         case DeletePreviousChar:
             s.cursor.deletePreviousChar();
-            --endPos;
+            endPos -= qMax(1, length);
             break;
         case DeleteChar:
             s.cursor.deleteChar();
-            --endPos;
+            endPos -= qMax(1, length);
             break;
         case InsertText:
             s.cursor.insertText(text);
-            endPos += text.length();
+            endPos += text.length() - length;
             break;
         }
 
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 1f40fbf2f8d680a159dbae384749edcefebb047b..8000813c77fd07317099363d59627ec69566f1d2 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -1007,8 +1007,10 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e)
             cursor.insertBlock();
             indent(document(), cursor, QChar::Null);
         } else {
-            QString previousBlockText = cursor.block().text();
             cursor.insertBlock();
+
+            // After inserting the block, to avoid duplicating whitespace on the same line
+            const QString previousBlockText = cursor.block().previous().text();
             cursor.insertText(ts.indentationString(previousBlockText));
         }
         cursor.endEditBlock();