From 6308632e5d0ec962a23c86c21ab7dcb1eea0cbe5 Mon Sep 17 00:00:00 2001
From: Fawzi Mohamed <fawzi.mohamed@nokia.com>
Date: Thu, 26 Jan 2012 12:14:21 +0100
Subject: [PATCH] texteditor: do not allow block selection to modify readonly
 editors

Task-number: QTCREATORBUG-5391

Change-Id: Icd896f39c183a0bf5e402ad65189b009dabdadc1
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
---
 src/plugins/texteditor/basetexteditor.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 09498bc5926..0db2feac684 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -1819,7 +1819,7 @@ void BaseTextEditorWidget::keyPressEvent(QKeyEvent *e)
         break;
     }
 
-    if (d->m_inBlockSelectionMode) {
+    if (!ro && d->m_inBlockSelectionMode) {
         QString text = e->text();
         if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t'))) {
             d->removeBlockSelection(text);
-- 
GitLab