X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a173d48f7669836759c922644b451bc4e8db503..740af654d1d20aaccad331e0eb73d113b5c0b02f:/samples/richtext/richtext.cpp diff --git a/samples/richtext/richtext.cpp b/samples/richtext/richtext.cpp index 115d7106a4..6d52c0216c 100644 --- a/samples/richtext/richtext.cpp +++ b/samples/richtext/richtext.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richedit.cpp +// Name: samples/richtext/richtext.cpp // Purpose: wxWidgets rich text editor sample // Author: Julian Smart // Modified by: @@ -61,6 +61,7 @@ #include "wx/richtext/richtextctrl.h" #include "wx/richtext/richtextstyles.h" #include "wx/richtext/richtextxml.h" +#include "wx/richtext/richtexthtml.h" // ---------------------------------------------------------------------------- // resources @@ -728,12 +729,10 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) if (!path.empty()) { - int fileType = 0; int filterIndex = dialog.GetFilterIndex(); - if (filterIndex < (int) fileTypes.GetCount()) - fileType = fileTypes[filterIndex]; - else - fileType = wxRICHTEXT_TYPE_TEXT; + int fileType = (filterIndex < (int) fileTypes.GetCount()) + ? fileTypes[filterIndex] + : wxRICHTEXT_TYPE_TEXT; m_richTextCtrl->LoadFile(path, fileType); } }