Windows: Remove unused function QWindowsBackingStore::rasterWindow().

It was only used to access the QWindow which can be retrieved
using QPlatformBackingStore::window(), potentially causing a crash
when  QWindowsBackingStore::resize() was called before the window
is shown.

Change-Id: I7c1bfce0f2c371d5d8847fd15fd1dc760b769a8f
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
This commit is contained in:
Friedemann Kleint 2014-01-24 10:02:35 +01:00 committed by The Qt Project
parent f4dd5344fb
commit 13cbcff097
2 changed files with 2 additions and 12 deletions

View File

@ -141,12 +141,12 @@ void QWindowsBackingStore::resize(const QSize &size, const QRegion &region)
#ifndef QT_NO_DEBUG_OUTPUT
if (QWindowsContext::verbose && lcQpaBackingStore().isDebugEnabled()) {
qCDebug(lcQpaBackingStore)
<< __FUNCTION__ << ' ' << rasterWindow()->window() << ' ' << size << ' ' << region
<< __FUNCTION__ << ' ' << window() << ' ' << size << ' ' << region
<< " from: " << (m_image.isNull() ? QSize() : m_image->image().size());
}
#endif
QImage::Format format = QWindowsNativeImage::systemFormat();
if (format == QImage::Format_RGB32 && rasterWindow()->window()->format().hasAlpha())
if (format == QImage::Format_RGB32 && window()->format().hasAlpha())
format = QImage::Format_ARGB32_Premultiplied;
QWindowsNativeImage *oldwni = m_image.data();
@ -196,14 +196,6 @@ void QWindowsBackingStore::beginPaint(const QRegion &region)
}
}
QWindowsWindow *QWindowsBackingStore::rasterWindow() const
{
if (const QWindow *w = window())
if (QPlatformWindow *pw = w->handle())
return static_cast<QWindowsWindow *>(pw);
return 0;
}
HDC QWindowsBackingStore::getDC() const
{
if (!m_image.isNull())

View File

@ -68,8 +68,6 @@ public:
HDC getDC() const;
private:
QWindowsWindow *rasterWindow() const;
QScopedPointer<QWindowsNativeImage> m_image;
};