]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/graphics.cpp
define wxString::iterator::iterator_category correctly if wxUSE_STD_STRING and not...
[wxWidgets.git] / src / msw / graphics.cpp
index 06c784811f38e6d5d0027d2c83df1e973905293b..7ffc36e55c08a0b4f1f2eef0ddf533066e6e9ea1 100644 (file)
     #include "wx/msw/wrapcdlg.h"
     #include "wx/image.h"
     #include "wx/window.h"
-    #include "wx/dc.h"
     #include "wx/utils.h"
     #include "wx/dialog.h"
     #include "wx/app.h"
     #include "wx/bitmap.h"
-    #include "wx/dcmemory.h"
     #include "wx/log.h"
     #include "wx/icon.h"
-    #include "wx/dcprint.h"
     #include "wx/module.h"
+    // include all dc types that are used as a param
+    #include "wx/dc.h"
+    #include "wx/dcclient.h"
+    #include "wx/dcmemory.h"
+    #include "wx/dcprint.h"
 #endif
 
 #include "wx/private/graphics.h"
@@ -1259,7 +1261,9 @@ void wxGDIPlusContext::DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxD
 
 void wxGDIPlusContext::DrawText( const wxString &str, wxDouble x, wxDouble y )
 {
-    if ( m_font.IsNull() || str.IsEmpty())
+    wxCHECK_RET( !m_font.IsNull(), wxT("wxGDIPlusContext::DrawText - no valid font set") );
+
+    if ( str.IsEmpty())
         return ;
 
     wxWCharBuffer s = str.wc_str( *wxConvUI );
@@ -1270,6 +1274,8 @@ void wxGDIPlusContext::DrawText( const wxString &str, wxDouble x, wxDouble y )
 void wxGDIPlusContext::GetTextExtent( const wxString &str, wxDouble *width, wxDouble *height,
                                      wxDouble *descent, wxDouble *externalLeading ) const
 {
+    wxCHECK_RET( !m_font.IsNull(), wxT("wxGDIPlusContext::GetTextExtent - no valid font set") );
+
     wxWCharBuffer s = str.wc_str( *wxConvUI );
     FontFamily ffamily ;
     Font* f = ((wxGDIPlusFontData*)m_font.GetRefData())->GetGDIPlusFont();
@@ -1315,6 +1321,8 @@ void wxGDIPlusContext::GetPartialTextExtents(const wxString& text, wxArrayDouble
     widths.Empty();
     widths.Add(0, text.length());
 
+    wxCHECK_RET( !m_font.IsNull(), wxT("wxGDIPlusContext::GetPartialTextExtents - no valid font set") );
+
     if (text.empty())
         return;