HaikuDepot: TextSpan fixes for sometimes neglected fCharCount.

This commit is contained in:
Stephan Aßmus 2013-08-18 17:18:23 +02:00
parent 92d83d4edc
commit 00f2259aef

View File

@ -37,6 +37,7 @@ TextSpan&
TextSpan::operator=(const TextSpan& other)
{
fText = other.fText;
fCharCount = other.fCharCount;
fStyle = other.fStyle;
return *this;
@ -46,8 +47,9 @@ TextSpan::operator=(const TextSpan& other)
bool
TextSpan::operator==(const TextSpan& other) const
{
return fText == other.fText
&& fStyle == other.fStyle;
return fCharCount == other.fCharCount
&& fStyle == other.fStyle
&& fText == other.fText;
}
@ -62,6 +64,7 @@ void
TextSpan::SetText(const BString& text)
{
fText = text;
fCharCount = fText.CountChars();
}