Fix m_qtPainter not being initialised in wxCairoContext ctor

For some reason one of the overloads of the c'tor left the m_qtPainter
field set to NULL rather than asking the wxDC for it's painter.

The rest of the class assumes the painter is not NULL.

Closes https://github.com/wxWidgets/wxWidgets/pull/1075
This commit is contained in:
Graham Dawes
2018-12-14 10:12:35 +00:00
committed by Vadim Zeitlin
parent db15e99884
commit 8fa32a40a9

View File

@@ -1869,7 +1869,7 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxWindowDC&
#endif
#ifdef __WXQT__
m_qtPainter = (QPainter*) dc.GetHandle();
m_qtPainter = static_cast<QPainter*>(dc.GetHandle());
// create a internal buffer (fallback if cairo_qt_surface is missing)
m_qtImage = new QImage(width, height, QImage::Format_ARGB32_Premultiplied);
// clear the buffer to be painted over the current contents
@@ -2084,7 +2084,7 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxMemoryDC&
#endif
#ifdef __WXQT__
m_qtPainter = NULL;
m_qtPainter = static_cast<QPainter*>(dc.GetHandle());
// create a internal buffer (fallback if cairo_qt_surface is missing)
m_qtImage = new QImage(width, height, QImage::Format_ARGB32_Premultiplied);
// clear the buffer to be painted over the current contents