From 02ddbf031c472e4398f1833aa0ae4b518d785dda Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 8 Nov 2012 17:12:58 +0100 Subject: [PATCH] CTextBox: Fix displayed text width in function setText() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/11b2242d2e58dea90d88c05bed668d5973502ec5 Author: Michael Liebmann Date: 2012-11-08 (Thu, 08 Nov 2012) Origin message was: ------------------ * CTextBox: Fix displayed text width in function setText() ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 815cdc063..47b5d0c4c 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -332,8 +332,8 @@ void CTextBox::refreshTextLineArray(void) lineBreakWidth = std::max(m_nMaxWidth, m_cFrameTextRel.iWidth - 2*text_border_width); } -// if(m_nMaxWidth) -// lineBreakWidth = m_nMaxWidth; + if(m_nMaxTextWidth) + lineBreakWidth = m_nMaxTextWidth; //TRACE("[CTextBox] line %d: lineBreakWidth %d\n", __LINE__, lineBreakWidth); @@ -595,8 +595,7 @@ bool CTextBox::setText(const std::string* newText, int max_width) { //TRACE("[CTextBox]->SetText \r\n"); bool result = false; - if (max_width>0) - m_nMaxTextWidth = max_width; + m_nMaxTextWidth = max_width; //printf("setText: _max_width %d max_width %d\n", _max_width, max_width); if (newText != NULL)