From 1c2d839fbfe4683d762754f0d9a727b15f5c4300 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 25 May 2006 02:40:58 +0000 Subject: [PATCH] don't crash on zero length string in DoDrawRotatedText git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dcclient.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index bd8d184..8dd54a5 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -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; -- 2.7.4