]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't send event from ChangeValue
authorJulian Smart <julian@anthemion.co.uk>
Tue, 8 Apr 2008 11:05:00 +0000 (11:05 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 8 Apr 2008 11:05:00 +0000 (11:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53090 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextctrl.cpp

index 5df966700d1b5e72428ca51cdae244a253d2e0dd..d18a1b35aeec27702a8bbbca77c0c5bd25209614 100644 (file)
@@ -2089,13 +2089,27 @@ wxString wxRichTextCtrl::GetRange(long from, long to) const
 
 void wxRichTextCtrl::DoSetValue(const wxString& value, int flags)
 {
-    Clear();
+    // 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();
-        DoWriteText(value);
+        DoWriteText(value, flags);
 
         // for compatibility, don't move the cursor when doing SetValue()
         SetInsertionPoint(0);