{
wxRichTextObject* child = node2->GetData();
- if (!child->GetRange().IsOutside(lineRange) && !lineRange.IsOutside(range))
+ if (child->GetRange().GetLength() > 0 && !child->GetRange().IsOutside(lineRange) && !lineRange.IsOutside(range))
{
// Draw this part of the line at the correct position
wxRichTextRange objectRange(child->GetRange());
{
wxASSERT(partialExtents.GetCount() >= (size_t) range.GetLength());
+ if (partialExtents.GetCount() < (size_t) range.GetLength())
+ return 0;
+
int leftMostPos = 0;
if (range.GetStart() - para.GetRange().GetStart() > 0)
leftMostPos = partialExtents[range.GetStart() - para.GetRange().GetStart() - 1];
{
wxRichTextObject* child = node->GetData();
+ if (child->GetRange().GetLength() == 0)
+ {
+ node = node->GetNext();
+ continue;
+ }
+
// If this is e.g. a composite text box, it will need to be laid out itself.
// But if just a text fragment or image, for example, this will
// do nothing. NB: won't we need to set the position after layout?
{
wxRichTextObject* child = node2->GetData();
- if (!child->GetRange().IsOutside(lineRange))
+ if (child->GetRange().GetLength() > 0 && !child->GetRange().IsOutside(lineRange))
{
wxRichTextRange rangeToUse = lineRange;
rangeToUse.LimitTo(child->GetRange());