+    // the control won't be modified any more as we programmatically replace
+    // all the existing text, so reset the flag and don't set it again (and do
+    // it now, before the text event handler is ran so that IsModified() called
+    // from there returns the expected value)
+    m_modified = false;
+    DontMarkDirtyOnNextChange();
+