return wxRICHTEXT_HITTEST_NONE;
int ret = wxRICHTEXT_HITTEST_NONE;
- if (m_floatCollector)
+ if (m_floatCollector && (flags & wxRICHTEXT_HITTEST_NO_FLOATING_OBJECTS) == 0)
ret = m_floatCollector->HitTest(dc, pt, textPosition, obj, flags);
if (ret == wxRICHTEXT_HITTEST_NONE)
int paraDescent = 0;
// This calculates the partial text extents
- GetRangeSize(GetRange(), paraSize, paraDescent, dc, wxRICHTEXT_UNFORMATTED|wxRICHTEXT_CACHE_SIZE, wxPoint(0,0), & partialExtents);
+ GetRangeSize(GetRange(), paraSize, paraDescent, dc, wxRICHTEXT_UNFORMATTED|wxRICHTEXT_CACHE_SIZE, rect.GetPosition(), & partialExtents);
#else
node = m_children.GetFirst();
while (node)
int length = action->GetNewParagraphs().GetOwnRange().GetLength();
- if (text.length() > 0 && text.Last() != wxT('\n'))
+ if (!text.empty() && text.Last() != wxT('\n'))
{
// Don't count the newline when undoing
length --;
action->GetNewParagraphs().SetPartialParagraph(true);
}
- else if (text.length() > 0 && text.Last() == wxT('\n'))
+ else if (!text.empty() && text.Last() == wxT('\n'))
length --;
action->SetPosition(pos);
return wxDynamicCast(obj, wxRichTextCell);
}
else
- return false;
+ return NULL;
}
// Returns a selection object specifying the selections between start and end character positions.
m_ctrl->Refresh(false);
m_ctrl->PositionCaret();
- m_ctrl->SetDefaultStyleToCursorStyle();
+
+ // This causes styles to persist when doing programmatic
+ // content creation except when Freeze/Thaw is used, so
+ // disable this and check for the consequences.
+ // m_ctrl->SetDefaultStyleToCursorStyle();
if (sendUpdateEvent)
wxTextCtrl::SendTextUpdatedEvent(m_ctrl);