Remove bad asserts from IRC text wrapping code (#2446)
This commit is contained in:
@@ -611,7 +611,7 @@ void IrcTextElement::addToContainer(MessageLayoutContainer &container,
|
||||
}
|
||||
}
|
||||
|
||||
// we done goofed, we need to wrap the text
|
||||
// The word does not fit on a new line, we need to wrap it
|
||||
QString text = word.text;
|
||||
std::vector<Segment> segments = word.segments;
|
||||
int textLength = text.length();
|
||||
@@ -625,6 +625,7 @@ void IrcTextElement::addToContainer(MessageLayoutContainer &container,
|
||||
{
|
||||
if (!container.canAddElements())
|
||||
{
|
||||
// The container does not allow any more elements to be added, stop here
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -638,11 +639,10 @@ void IrcTextElement::addToContainer(MessageLayoutContainer &container,
|
||||
{
|
||||
std::vector<Segment> pieceSegments;
|
||||
int charactersLeft = i - wordStart;
|
||||
assert(charactersLeft > 0);
|
||||
|
||||
for (auto segmentIt = segments.begin();
|
||||
segmentIt != segments.end();)
|
||||
{
|
||||
assert(charactersLeft > 0);
|
||||
auto &segment = *segmentIt;
|
||||
if (charactersLeft >= segment.text.length())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user