Commit f9923d6b authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

uxtheme: Remove a redundant condition check.

The sizingtype check is redundant because it can only be ST_TRUESIZE, ST_STRETCH or ST_TILE and the check is already in the not ST_TRUESIZE branch. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d987c277
...@@ -710,6 +710,7 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId, ...@@ -710,6 +710,7 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, RECT *pRect, int iStateId, RECT *pRect,
const DTBGOPTS *pOptions) const DTBGOPTS *pOptions)
{ {
int destCenterWidth, srcCenterWidth, destCenterHeight, srcCenterHeight;
HRESULT hr = S_OK; HRESULT hr = S_OK;
HBITMAP bmpSrc; HBITMAP bmpSrc;
HGDIOBJ oldSrc; HGDIOBJ oldSrc;
...@@ -825,68 +826,66 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId, ...@@ -825,68 +826,66 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId,
goto draw_error; goto draw_error;
} }
if ((sizingtype == ST_STRETCH) || (sizingtype == ST_TILE)) { destCenterWidth = dstSize.x - (sm.cxLeftWidth + sm.cxRightWidth);
int destCenterWidth = dstSize.x - (sm.cxLeftWidth + sm.cxRightWidth); srcCenterWidth = srcSize.x - (sm.cxLeftWidth + sm.cxRightWidth);
int srcCenterWidth = srcSize.x - (sm.cxLeftWidth + sm.cxRightWidth); destCenterHeight = dstSize.y - (sm.cyTopHeight + sm.cyBottomHeight);
int destCenterHeight = dstSize.y - (sm.cyTopHeight + sm.cyBottomHeight); srcCenterHeight = srcSize.y - (sm.cyTopHeight + sm.cyBottomHeight);
int srcCenterHeight = srcSize.y - (sm.cyTopHeight + sm.cyBottomHeight);
if(destCenterWidth > 0) {
if(destCenterWidth > 0) { /* Center top */
/* Center top */ if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, 0,
if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, 0, destCenterWidth, sm.cyTopHeight,
destCenterWidth, sm.cyTopHeight, hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top,
hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top, srcCenterWidth, sm.cyTopHeight,
srcCenterWidth, sm.cyTopHeight, sizingtype, transparent, transparentcolor)) {
sizingtype, transparent, transparentcolor)) { hr = HRESULT_FROM_WIN32(GetLastError());
hr = HRESULT_FROM_WIN32(GetLastError()); goto draw_error;
goto draw_error;
}
/* Center bottom */
if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, dstSize.y-sm.cyBottomHeight,
destCenterWidth, sm.cyBottomHeight,
hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.bottom-sm.cyBottomHeight,
srcCenterWidth, sm.cyBottomHeight,
sizingtype, transparent, transparentcolor)) {
hr = HRESULT_FROM_WIN32(GetLastError());
goto draw_error;
}
} }
if(destCenterHeight > 0) { /* Center bottom */
/* Left center */ if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, dstSize.y-sm.cyBottomHeight,
if(!UXTHEME_SizedBlt (hdcDst, 0, sm.cyTopHeight, destCenterWidth, sm.cyBottomHeight,
sm.cxLeftWidth, destCenterHeight, hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.bottom-sm.cyBottomHeight,
hdcSrc, rcSrc.left, rcSrc.top+sm.cyTopHeight, srcCenterWidth, sm.cyBottomHeight,
sm.cxLeftWidth, srcCenterHeight, sizingtype, transparent, transparentcolor)) {
sizingtype, hr = HRESULT_FROM_WIN32(GetLastError());
transparent, transparentcolor)) { goto draw_error;
hr = HRESULT_FROM_WIN32(GetLastError()); }
goto draw_error; }
} if(destCenterHeight > 0) {
/* Right center */ /* Left center */
if(!UXTHEME_SizedBlt (hdcDst, dstSize.x-sm.cxRightWidth, sm.cyTopHeight, if(!UXTHEME_SizedBlt (hdcDst, 0, sm.cyTopHeight,
sm.cxRightWidth, destCenterHeight, sm.cxLeftWidth, destCenterHeight,
hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top+sm.cyTopHeight, hdcSrc, rcSrc.left, rcSrc.top+sm.cyTopHeight,
sm.cxRightWidth, srcCenterHeight, sm.cxLeftWidth, srcCenterHeight,
sizingtype,
transparent, transparentcolor)) {
hr = HRESULT_FROM_WIN32(GetLastError());
goto draw_error;
}
/* Right center */
if(!UXTHEME_SizedBlt (hdcDst, dstSize.x-sm.cxRightWidth, sm.cyTopHeight,
sm.cxRightWidth, destCenterHeight,
hdcSrc, rcSrc.right-sm.cxRightWidth, rcSrc.top+sm.cyTopHeight,
sm.cxRightWidth, srcCenterHeight,
sizingtype, transparent, transparentcolor)) {
hr = HRESULT_FROM_WIN32(GetLastError());
goto draw_error;
}
}
if(destCenterHeight > 0 && destCenterWidth > 0) {
BOOL borderonly = FALSE;
GetThemeBool(hTheme, iPartId, iStateId, TMT_BORDERONLY, &borderonly);
if(!borderonly) {
/* Center */
if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, sm.cyTopHeight,
destCenterWidth, destCenterHeight,
hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top+sm.cyTopHeight,
srcCenterWidth, srcCenterHeight,
sizingtype, transparent, transparentcolor)) { sizingtype, transparent, transparentcolor)) {
hr = HRESULT_FROM_WIN32(GetLastError()); hr = HRESULT_FROM_WIN32(GetLastError());
goto draw_error; goto draw_error;
} }
} }
if(destCenterHeight > 0 && destCenterWidth > 0) {
BOOL borderonly = FALSE;
GetThemeBool(hTheme, iPartId, iStateId, TMT_BORDERONLY, &borderonly);
if(!borderonly) {
/* Center */
if(!UXTHEME_SizedBlt (hdcDst, sm.cxLeftWidth, sm.cyTopHeight,
destCenterWidth, destCenterHeight,
hdcSrc, rcSrc.left+sm.cxLeftWidth, rcSrc.top+sm.cyTopHeight,
srcCenterWidth, srcCenterHeight,
sizingtype, transparent, transparentcolor)) {
hr = HRESULT_FROM_WIN32(GetLastError());
goto draw_error;
}
}
}
} }
draw_error: draw_error:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment