CtextBox: Precise function getLines()

Use refreshTextLineArray() for calculation of lines.
Note: 	count of lines will be only returned if CTextBox object
	is initialized with a valid CBox instance,
	otherwise count of 0 lines will be returned!

also remove inline declaration, not needed here


Origin commit data
------------------
Commit: ec83549e50
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-06-15 (Thu, 15 Jun 2017)
This commit is contained in:
2017-06-15 01:01:54 +02:00
parent 10fb9c3733
commit 030c9c496d
2 changed files with 22 additions and 10 deletions

View File

@@ -900,6 +900,16 @@ int CTextBox::getLines(const std::string& text)
return count;
}
int CTextBox::getLines()
{
if (m_cText.empty())
return 0;
refreshTextLineArray();
return m_nNrOfLines;
}
int CTextBox::getMaxLineWidth(const std::string& text, Font* font)
{
std::string txt = text;