From f8ccdd0bcf7a3004d743aa7141988d294f727663 Mon Sep 17 00:00:00 2001 From: Mariano Reingart Date: Mon, 29 Sep 2014 02:59:24 +0000 Subject: [PATCH] Fix issues with dashes in wxQT, thanks @seandepagnier git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/qt/pen.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qt/pen.cpp b/src/qt/pen.cpp index e0313b6d1a..bf265dcd62 100644 --- a/src/qt/pen.cpp +++ b/src/qt/pen.cpp @@ -207,6 +207,8 @@ class wxPenRefData: public wxGDIRefData { m_qtPen.setCapStyle(Qt::RoundCap); m_qtPen.setJoinStyle(Qt::RoundJoin); + m_dashes = NULL; + m_dashesSize = 0; } wxPenRefData() @@ -307,8 +309,10 @@ void wxPen::SetDashes(int nb_dashes, const wxDash *dash) ((wxPenRefData *)m_refData)->m_dashesSize = nb_dashes; QVector dashes; - for (int i = 0; i < nb_dashes; i++) { - dashes << dash[i]; + if (dash) + { + for (int i = 0; i < nb_dashes; i++) + dashes << dash[i]; } M_PENDATA.setDashPattern(dashes);