]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix assert in initial call to wxPostScriptDC::SetPen().
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Sep 2011 15:26:36 +0000 (15:26 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Sep 2011 15:26:36 +0000 (15:26 +0000)
Attempt to use wxPen::GetStyle() on the initially invalid pen resulted in an
assert, so don't do it and test for pen validity explicitly.

Closes #13524.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/dcpsg.cpp

index 5693d2f236b32be6fd063359afafb33913a35603..a490757cb05f6601211c314843ff72b60992868c 100644 (file)
@@ -1135,7 +1135,7 @@ void wxPostScriptDCImpl::SetPen( const wxPen& pen )
 
     if (!pen.IsOk()) return;
 
-    int oldStyle = m_pen.GetStyle();
+    int oldStyle = m_pen.IsOk() ? m_pen.GetStyle() : wxPENSTYLE_INVALID;
 
     m_pen = pen;