]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fontcmn.cpp
Combine two wxImage-to-pixmap creation functions into one.
[wxWidgets.git] / src / common / fontcmn.cpp
index 80d2e7b1a0c5d86a5999c5dead4b2047ea54b0a6..7c093918c570fcbb2b5c346af57ac6c34cd591a3 100644 (file)
     #include "wx/intl.h"
     #include "wx/dcscreen.h"
     #include "wx/log.h"
     #include "wx/intl.h"
     #include "wx/dcscreen.h"
     #include "wx/log.h"
+    #include "wx/gdicmn.h"
 #endif // WX_PRECOMP
 
 #endif // WX_PRECOMP
 
-#include "wx/gdicmn.h"
-
 #if defined(__WXMSW__)
     #include  "wx/msw/private.h"  // includes windows.h for LOGFONT
     #include  "wx/msw/winundef.h"
 #if defined(__WXMSW__)
     #include  "wx/msw/private.h"  // includes windows.h for LOGFONT
     #include  "wx/msw/winundef.h"
@@ -268,7 +267,7 @@ wxString wxFontBase::GetNativeFontInfoDesc() const
     if ( fontInfo )
     {
         fontDesc = fontInfo->ToString();
     if ( fontInfo )
     {
         fontDesc = fontInfo->ToString();
-        wxASSERT_MSG(!fontDesc.IsEmpty(), wxT("This should be a non-empty string!"));
+        wxASSERT_MSG(!fontDesc.empty(), wxT("This should be a non-empty string!"));
     }
     else
     {
     }
     else
     {
@@ -285,11 +284,11 @@ wxString wxFontBase::GetNativeFontInfoUserDesc() const
     if ( fontInfo )
     {
         fontDesc = fontInfo->ToUserString();
     if ( fontInfo )
     {
         fontDesc = fontInfo->ToUserString();
-        wxASSERT_MSG(!fontDesc.IsEmpty(), wxT("This should be a non-empty string!"));
+        wxASSERT_MSG(!fontDesc.empty(), wxT("This should be a non-empty string!"));
     }
     else
     {
     }
     else
     {
-        wxASSERT_MSG(0, wxT("Derived class should have created the wxNativeFontInfo!"));
+        wxFAIL_MSG(wxT("Derived class should have created the wxNativeFontInfo!"));
     }
 
     return fontDesc;
     }
 
     return fontDesc;
@@ -329,6 +328,12 @@ bool wxFontBase::operator==(const wxFont& font) const
            (
             Ok() == font.Ok() &&
             GetPointSize() == font.GetPointSize() &&
            (
             Ok() == font.Ok() &&
             GetPointSize() == font.GetPointSize() &&
+            // in wxGTK1 GetPixelSize() calls GetInternalFont() which uses
+            // operator==() resulting in infinite recursion so we can't use it
+            // in that port
+#if !defined(__WXGTK__) || defined(__WXGTK20__)
+            GetPixelSize() == font.GetPixelSize() &&
+#endif
             GetFamily() == font.GetFamily() &&
             GetStyle() == font.GetStyle() &&
             GetWeight() == font.GetWeight() &&
             GetFamily() == font.GetFamily() &&
             GetStyle() == font.GetStyle() &&
             GetWeight() == font.GetWeight() &&