]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/font.cpp
remove incorrect cast of wxString to char* (unnecessary and breaks wxUSE_STL build)
[wxWidgets.git] / src / msw / font.cpp
index 778f351b9c779aabda641472319d7a015cbe8df7..ed8728be509a700253436f4bbfbfd800f3a05f7d 100644 (file)
@@ -171,18 +171,18 @@ public:
         return m_nativeFontInfoOk ? true : m_sizeUsingPixels;
     }
 
-    int GetFamily() const
+    wxFontFamily GetFamily() const
     {
         return m_family;
     }
 
-    int GetStyle() const
+    wxFontStyle GetStyle() const
     {
         return m_nativeFontInfoOk ? m_nativeFontInfo.GetStyle()
                                   : m_style;
     }
 
-    int GetWeight() const
+    wxFontWeight GetWeight() const
     {
         return m_nativeFontInfoOk ? m_nativeFontInfo.GetWeight()
                                   : m_weight;
@@ -410,7 +410,7 @@ void wxFontRefData::Init(const wxNativeFontInfo& info, WXHFONT hFont)
     m_nativeFontInfo = info;
     // This is the best we can do since we don't have the
     // correct information at this point.
-    m_family = wxSWISS;
+    m_family = wxFONTFAMILY_SWISS;
 }
 
 wxFontRefData::~wxFontRefData()
@@ -618,9 +618,7 @@ void wxNativeFontInfo::SetUnderlined(bool underlined)
 
 bool wxNativeFontInfo::SetFaceName(const wxString& facename)
 {
-    size_t len = WXSIZEOF(lf.lfFaceName);
-    wxStrncpy(lf.lfFaceName, facename, len);
-    lf.lfFaceName[len - 1] = '\0';    // truncate the face name
+    wxStrlcpy(lf.lfFaceName, facename.c_str(), WXSIZEOF(lf.lfFaceName));
     return true;
 }