diff options
Diffstat (limited to 'src/widgets/styles/qwindowsxpstyle.cpp')
-rw-r--r-- | src/widgets/styles/qwindowsxpstyle.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 0b33213378..8bd4f69d20 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -337,14 +337,14 @@ void QWindowsXPStylePrivate::cleanupHandleMap() HTHEME QWindowsXPStylePrivate::createTheme(int theme, HWND hwnd) { - if (theme < 0 || theme >= NThemes || !hwnd) { + if (Q_UNLIKELY(theme < 0 || theme >= NThemes || !hwnd)) { qWarning("%s: Invalid parameters #%d, %p", Q_FUNC_INFO, theme, hwnd); return 0; } if (!m_themes[theme]) { const wchar_t *name = themeNames[theme]; m_themes[theme] = pOpenThemeData(hwnd, name); - if (!m_themes[theme]) + if (Q_UNLIKELY(!m_themes[theme])) qErrnoWarning("%s: OpenThemeData() failed for theme %d (%s).", Q_FUNC_INFO, theme, qPrintable(themeName(theme))); } @@ -504,13 +504,13 @@ HBITMAP QWindowsXPStylePrivate::buffer(int w, int h) GdiFlush(); nullBitmap = (HBITMAP)SelectObject(bufferDC, bufferBitmap); - if (!bufferBitmap) { + if (Q_UNLIKELY(!bufferBitmap)) { qErrnoWarning("QWindowsXPStylePrivate::buffer(%dx%d), CreateDIBSection() failed.", w, h); bufferW = 0; bufferH = 0; return 0; } - if (!bufferPixels) { + if (Q_UNLIKELY(!bufferPixels)) { qErrnoWarning("QWindowsXPStylePrivate::buffer(%dx%d), CreateDIBSection() did not allocate pixel data.", w, h); bufferW = 0; bufferH = 0; |