]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/font/font.cpp
added missing return to avoid 'control reaches end of non-void function'
[wxWidgets.git] / samples / font / font.cpp
index 6c9dff7a5072adae9755b90c72415894d43bbf0e..7ef9add570cbb6feb6e4271e0004eda726464aba 100644 (file)
@@ -544,7 +544,7 @@ void MyFrame::OnSelectFont(wxCommandEvent& WXUNUSED(event))
     data.SetInitialFont(m_canvas->GetTextFont());
     data.SetColour(m_canvas->GetColour());
 
-    wxFontDialog dialog(this, &data);
+    wxFontDialog dialog(this, data);
     if ( dialog.ShowModal() == wxID_OK )
     {
         wxFontData retData = dialog.GetFontData();
@@ -632,7 +632,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
     }
 
     // ok, now get the corresponding encoding
-    wxFontEncoding fontenc = wxTheFontMapper->CharsetToEncoding(charset);
+    wxFontEncoding fontenc = wxFontMapper::Get()->CharsetToEncoding(charset);
     if ( fontenc == wxFONTENCODING_SYSTEM )
     {
         wxLogError(wxT("Charset '%s' is unsupported."), charset.c_str());
@@ -642,11 +642,11 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
     m_textctrl->LoadFile(filename);
 
     if ( fontenc == wxFONTENCODING_UTF8 ||
-            !wxTheFontMapper->IsEncodingAvailable(fontenc) )
+            !wxFontMapper::Get()->IsEncodingAvailable(fontenc) )
     {
         // try to find some similar encoding:
         wxFontEncoding encAlt;
-        if ( wxTheFontMapper->GetAltForEncoding(fontenc, &encAlt) )
+        if ( wxFontMapper::Get()->GetAltForEncoding(fontenc, &encAlt) )
         {
             wxEncodingConverter conv;
 
@@ -732,7 +732,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
     fontInfo.Printf(wxT("Font size is %d points, family: %s, encoding: %s"),
                     m_font.GetPointSize(),
                     m_font.GetFamilyString().c_str(),
-                    wxTheFontMapper->
+                    wxFontMapper::Get()->
                         GetEncodingDescription(m_font.GetEncoding()).c_str());
 
     dc.DrawText(fontInfo, x, y);