]> git.saurik.com Git - wxWidgets.git/commitdiff
don't crash on zero length string in DoDrawRotatedText
authorPaul Cornett <paulcor@bullseye.com>
Thu, 25 May 2006 02:40:58 +0000 (02:40 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Thu, 25 May 2006 02:40:58 +0000 (02:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dcclient.cpp

index bd8d184fc17359969c8d12b129223d3ebf3ff2c8..8dd54a51ab9941e70f6c22acd2167ac6f3d44bc7 100644 (file)
@@ -1586,16 +1586,17 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
 
 void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, double angle )
 {
+    if (!m_window || text.empty())
+        return;
+
+    wxCHECK_RET( Ok(), wxT("invalid window dc") );
+
     if ( wxIsNullDouble(angle) )
     {
         DrawText(text, x, y);
         return;
     }
 
-    wxCHECK_RET( Ok(), wxT("invalid window dc") );
-
-    if (!m_window) return;
-
     wxCoord w;
     wxCoord h;