From 895b89dbdf1a3ebc2965f5d8a66ac412d2b8f0cf Mon Sep 17 00:00:00 2001 From: jkobus Date: Wed, 24 Apr 2013 12:42:29 +0200 Subject: [PATCH] Fix a crash on changing context lines with block selection Crash occurs in diff editor when there is a block selection and you are changing context lines number. This workarounds the crash, but it seems that when BaseTextEditorWidget has a blockSelection calling "clear()" and "setPlainText()" causes the crash. When I turn off the blockSelection before calling "clear()" it helps. Change-Id: I0133862a2d7e2914c16368b7efa9986b4d56ff39 Reviewed-by: David Schulz --- src/plugins/diffeditor/diffeditorwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/diffeditor/diffeditorwidget.cpp b/src/plugins/diffeditor/diffeditorwidget.cpp index 346fc69c85d..7dc7be70f9c 100644 --- a/src/plugins/diffeditor/diffeditorwidget.cpp +++ b/src/plugins/diffeditor/diffeditorwidget.cpp @@ -718,6 +718,8 @@ void DiffEditorWidget::showDiff() const int leftHorizontalValue = m_leftEditor->horizontalScrollBar()->value(); const int rightHorizontalValue = m_rightEditor->horizontalScrollBar()->value(); + m_leftEditor->setBlockSelection(false); + m_rightEditor->setBlockSelection(false); m_leftEditor->clear(); m_rightEditor->clear(); m_leftEditor->clearLineNumbers();