CTextBox: rework return control of value of setText() function

value was not clearly, hope i'ts now


Origin commit data
------------------
Branch: ni/coolstream
Commit: 1120e3a37d
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-01-17 (Tue, 17 Jan 2017)



------------------
This commit was generated by Migit
This commit is contained in:
2017-01-17 08:53:12 +01:00
committed by Michael Liebmann
parent f82ce2d192
commit efd46bc4ce

View File

@@ -789,23 +789,26 @@ void CTextBox::refresh(void)
bool CTextBox::setText(const std::string* newText, int max_width, bool force_repaint)
{
//TRACE("[CTextBox]->SetText \r\n");
bool result = false;
m_nMaxTextWidth = max_width;
//reset text to force repaint the text, managed in hasChanged()
if (force_repaint)
m_old_cText = "";
//printf("setText: _max_width %d max_width %d\n", _max_width, max_width);
if (newText != NULL)
{
if (newText){
m_cText = *newText;
//m_cText = *newText + "\n"; //FIXME test
reSizeMainFrameHeight(m_cFrame.iHeight);
//refresh text line array
refreshTextLineArray();
refresh();
result = true;
}
return(result);
if (m_old_cText != m_cText){
//m_cText = *newText + "\n"; //FIXME test
reSizeMainFrameHeight(m_cFrame.iHeight);
//refresh text line array
refreshTextLineArray();
refresh();
return true;
}
return false;
}else
return false;
return true;
}
void CTextBox::paint (void)