From 5a376169b1b6d476a2a149ddf68c0ecd9f8b6913 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 18 Jun 2012 18:45:30 +0000 Subject: [PATCH] Fixed #14417: wxRichTextCtrl crashes on LoadFile git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71806 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextctrl.cpp | 2 ++ src/richtext/richtextstylepage.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 9f90f65488..e0e80081a1 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -2663,6 +2663,8 @@ bool wxRichTextCtrl::RecreateBuffer(const wxSize& size) bool wxRichTextCtrl::DoLoadFile(const wxString& filename, int fileType) { + SetFocusObject(& GetBuffer(), true); + bool success = GetBuffer().LoadFile(filename, (wxRichTextFileType)fileType); if (success) m_filename = filename; diff --git a/src/richtext/richtextstylepage.cpp b/src/richtext/richtextstylepage.cpp index 2d403075e4..372ef36040 100644 --- a/src/richtext/richtextstylepage.cpp +++ b/src/richtext/richtextstylepage.cpp @@ -158,7 +158,7 @@ bool wxRichTextStylePage::TransferDataFromWindow() bool wxRichTextStylePage::TransferDataToWindow() { wxPanel::TransferDataToWindow(); - + wxRichTextStyleDefinition* def = wxRichTextFormattingDialog::GetDialogStyleDefinition(this); if (def) { -- 2.45.2