git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53090
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxRichTextCtrl::DoSetValue(const wxString& value, int flags)
{
void wxRichTextCtrl::DoSetValue(const wxString& value, int flags)
{
+ // Don't call Clear here, since it always sends a text updated event
+ m_buffer.ResetAndClearCommands();
+ m_buffer.SetDirty(true);
+ m_caretPosition = -1;
+ m_caretPositionForDefaultStyle = -2;
+ m_caretAtLineStart = false;
+ m_selectionRange.SetRange(-2, -2);
+
+ Scroll(0,0);
+
+ if (!IsFrozen())
+ {
+ LayoutContent();
+ Refresh(false);
+ }
if (!value.IsEmpty())
{
// Remove empty paragraph
GetBuffer().Clear();
if (!value.IsEmpty())
{
// Remove empty paragraph
GetBuffer().Clear();
+ DoWriteText(value, flags);
// for compatibility, don't move the cursor when doing SetValue()
SetInsertionPoint(0);
// for compatibility, don't move the cursor when doing SetValue()
SetInsertionPoint(0);