]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/richtext/richtext.cpp
Watcom does not accept #warning but supports more than MSW port.
[wxWidgets.git] / samples / richtext / richtext.cpp
index 115d7106a48dbca87f5e745a3d557d5a9229b313..6d52c0216ce648fb40f64d685fb6afff6366bfa6 100644 (file)
@@ -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);
         }
     }