From c85435d9ab2d4bbaaa79779bcdfb104042ce3cfb Mon Sep 17 00:00:00 2001
From: Jens Bache-Wiig <jens.bache-wiig@nokia.com>
Date: Tue, 9 Jun 2009 18:17:38 +0200
Subject: [PATCH] Fixes:    Fix a painting glitch when not using code folding

---
 src/plugins/texteditor/basetexteditor.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 2425b4a715a..a183faafbeb 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -2310,7 +2310,8 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
 //     if (documentLayout->doubleMarkCount)
 //         markWidth += fm.lineSpacing() / 3;
 
-    const int extraAreaWidth = d->m_extraArea->width() - collapseBoxWidth(fm);
+    const int collapseColumnWidth = d->m_codeFoldingVisible ? collapseBoxWidth(fm): 0;
+    const int extraAreaWidth = d->m_extraArea->width() - collapseColumnWidth;
 
     painter.fillRect(e->rect(), pal.color(QPalette::Base));
     painter.fillRect(e->rect().intersected(QRect(0, 0, extraAreaWidth, INT_MAX)),
-- 
GitLab