From 79602d0f93fb7e894ebfc191b88da36fd2ed7028 Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 8 Feb 2014 17:59:38 +0000 Subject: [PATCH] CtrlLib: LineEdit: Fixed issue with very long lines #657 git-svn-id: svn://ultimatepp.org/upp/trunk@6886 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/LineEdit.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/uppsrc/CtrlLib/LineEdit.cpp b/uppsrc/CtrlLib/LineEdit.cpp index b88d035eb..bfb3a033d 100644 --- a/uppsrc/CtrlLib/LineEdit.cpp +++ b/uppsrc/CtrlLib/LineEdit.cpp @@ -88,9 +88,14 @@ void LineEdit::Paint0(Draw& w) { int fascent = font.Info().GetAscent(); Color showcolor = Blend(SColorLight, SColorHighlight); for(int i = sc.y; i < ll; i++) { - WString tx = line[i]; - if(tx.GetLength() > 100000) // Do not go out of memory for patologic cases... - tx.Trim(100000); + WString tx; + if(line[i].text.GetLength() > 100000) { // Do not go out of memory for patologic cases... + String h = line[i].text; + h.Trim(100000); + tx = h.ToWString(); + } + else + tx = line[i]; int len = tx.GetLength(); if(w.IsPainting(0, y, sz.cx, fsz.cy)) { Highlight ih;