imagelist: style fixes

Dimitrie O. Paun dpaun at rogers.com
Wed Mar 2 15:00:34 CST 2005


ChangeLog
    Style fixes for consistent formatting.


Index: dlls/comctl32/imagelist.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/imagelist.c,v
retrieving revision 1.95
diff -u -r1.95 imagelist.c
--- dlls/comctl32/imagelist.c	24 Feb 2005 12:46:57 -0000	1.95
+++ dlls/comctl32/imagelist.c	2 Mar 2005 20:35:02 -0000
@@ -123,8 +123,7 @@
     if (hbmNewBitmap == 0)
         ERR("creating new image bitmap (x=%d y=%d)!\n", nNewWidth, cy);
 
-    if(himl->cCurImage)
-    {
+    if(himl->cCurImage) {
         hbmNull = SelectObject (hdcBitmap, hbmNewBitmap);
         BitBlt (hdcBitmap, 0, 0, himl->cCurImage * himl->cx, cy,
                 himl->hdcImage, 0, 0, SRCCOPY);
@@ -134,15 +133,13 @@
     DeleteObject (himl->hbmImage);
     himl->hbmImage = hbmNewBitmap;
 
-    if (himl->flags & ILC_MASK)
-    {
+    if (himl->flags & ILC_MASK) {
         hbmNewBitmap = CreateBitmap (nNewWidth, cy, 1, 1, NULL);
 
         if (hbmNewBitmap == 0)
             ERR("creating new mask bitmap!\n");
 
-	if(himl->cCurImage)
-	{
+	if(himl->cCurImage) {
 	    hbmNull = SelectObject (hdcBitmap, hbmNewBitmap);
 	    BitBlt (hdcBitmap, 0, 0, himl->cCurImage * himl->cx, cy,
 		    himl->hdcMask, 0, 0, SRCCOPY);
@@ -203,8 +200,7 @@
     BitBlt (himl->hdcImage, nStartX, 0, bmp.bmWidth, bmp.bmHeight,
         hdcBitmap, 0, 0, SRCCOPY);
 
-    if(himl->hbmMask)
-    {
+    if(himl->hbmMask) {
 	HDC hdcTemp;
 	HBITMAP hOldBitmapTemp;
 
@@ -306,13 +302,10 @@
 
 
     hOldBitmap = SelectObject(hdcBitmap, hBitmap);
-    if(himl->hbmMask)
-    {
+    if(himl->hbmMask) {
         hdcMask = himl->hdcMask;
         nMaskXOffset = nIndex * himl->cx;
-    }
-    else
-    {
+    } else {
         /*
             Create a temp Mask so we can remove the background of
             the Image (Windows does this even if there is no mask)
@@ -359,8 +352,7 @@
     */
     SelectObject(hdcBitmap, hOldBitmap);
     DeleteDC(hdcBitmap);
-    if(!himl->hbmMask)
-    {
+    if(!himl->hbmMask) {
         DeleteObject(hMaskBitmap);
         DeleteDC(hdcMask);
     }
@@ -508,8 +500,7 @@
         DeleteObject (hbmTempMask);
         DeleteObject (hbmTempImage);
         DeleteDC(hdcBmp);
-    }
-    else {
+    } else {
         /* copy image */
         StretchBlt   (himlDst->hdcImage, iDst * himlDst->cx, 0, himlDst->cx, himlDst->cy,
                       himlSrc->hdcImage, iSrc * himlSrc->cx, 0, himlSrc->cx, himlSrc->cy,
@@ -581,7 +572,7 @@
     himl->hdcImage = CreateCompatibleDC (0);
     if (!himl->hdcImage)
         goto cleanup;
-    if (himl->flags & ILC_MASK){
+    if (himl->flags & ILC_MASK) {
         himl->hdcMask = CreateCompatibleDC(0);
         if (!himl->hdcMask)
             goto cleanup;
@@ -1121,8 +1112,7 @@
             PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY );
             BitBlt(hImageDC, 0, 0, cx, cy, hMaskListDC, lx, ly, SRCPAINT);
             DeleteObject (SelectObject (hImageDC, hOldBrush));
-            if( bIsTransparent )
-            {
+            if( bIsTransparent ) {
                 BitBlt ( pimldp->hdcDst, pimldp->x,  pimldp->y, cx, cy, hImageDC, 0, 0, SRCAND);
                 bResult = TRUE;
                 goto end;
@@ -1137,8 +1127,7 @@
         COLORREF colour = RGB(0,0,0);
         HBRUSH hOldBrush;
 
-        if( !bIsTransparent )
-        {
+        if( !bIsTransparent ) {
             colour = pimldp->rgbBk;
             if( colour == CLR_DEFAULT )
                 colour = himl->clrBk;
@@ -1257,8 +1246,7 @@
     himlDst = ImageList_Create (himlSrc->cx, himlSrc->cy, himlSrc->flags,
                                 himlSrc->cInitial, himlSrc->cGrow);
 
-    if (himlDst)
-    {
+    if (himlDst) {
         BitBlt (himlDst->hdcImage, 0, 0, himlSrc->cCurImage * himlSrc->cx, himlSrc->cy,
                 himlSrc->hdcImage, 0, 0, SRCCOPY);
 
@@ -1647,8 +1635,7 @@
          the flag DI_DEFAULTSIZE is specified, cx becomes the
          system metric value for icons. If the flag is not specified
          the function sets the size to the height of the bitmap */
-        if (cx == 0)
-        {
+        if (cx == 0) {
             if (uFlags & DI_DEFAULTSIZE)
                 cx = GetSystemMetrics (SM_CXICON);
             else
@@ -1763,8 +1750,7 @@
 
     himlDst = ImageList_Create (cxDst, cyDst, ILC_MASK | ILC_COLOR, 1, 1);
 
-    if (himlDst)
-    {
+    if (himlDst) {
         nX1 = i1 * himl1->cx;
         nX2 = i2 * himl2->cx;
 
@@ -1772,8 +1758,7 @@
         BitBlt (himlDst->hdcImage, 0, 0, cxDst, cyDst, himl1->hdcImage, 0, 0, BLACKNESS);
         if (i1 >= 0 && i1 < himl1->cCurImage)
             BitBlt (himlDst->hdcImage, xOff1, yOff1, himl1->cx, himl1->cy, himl1->hdcImage, nX1, 0, SRCCOPY);
-        if (i2 >= 0 && i2 < himl2->cCurImage)
-        {
+        if (i2 >= 0 && i2 < himl2->cCurImage) {
             BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask , nX2, 0, SRCAND);
             BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcImage, nX2, 0, SRCPAINT);
         }
@@ -1835,9 +1820,10 @@
     bmihc->biSizeImage	= (longsperline*height)<<2;
 
     /* read the palette right after the end of the bitmapinfoheader */
-    if (palspace)
+    if (palspace) {
 	if (!SUCCEEDED(IStream_Read ( pstm, bmihc+1, palspace, NULL)))
 	    goto ret1;
+    }
 
     xdc = GetDC(0);
 #if 0 /* Magic for NxM -> 1x(N*M) not implemented for DIB Sections */
@@ -1876,7 +1862,7 @@
 	/* Copy the NxM bitmap into a 1x(N*M) bitmap we need, linewise */
 	/* Do not forget that windows bitmaps are bottom->top */
         TRACE("nRows=%d\n", nRows);
-        for (i=0; i < nRows; i++){
+        for (i=0; i < nRows; i++) {
             StretchDIBits(hBitmapDC, width*i, 0, width, cy, 0, cy*(nRows-1-i), width, cy, bits,
                 (BITMAPINFO*)bmihc, DIB_RGB_COLORS, SRCCOPY);
         }
@@ -1969,13 +1955,8 @@
 	}
     }
 
-    himl = ImageList_Create (
-		    ilHead.cx,
-		    ilHead.cy,
-		    ilHead.flags,
-		    1,		/* initial */
-		    ilHead.cGrow
-    );
+    himl = ImageList_Create ( ilHead.cx, ilHead.cy, 
+                              ilHead.flags, 1, ilHead.cGrow );
     if (!himl) {
 	DeleteObject(hbmColor);
 	DeleteObject(hbmMask);
@@ -1984,7 +1965,7 @@
     SelectObject(himl->hdcImage, hbmColor);
     DeleteObject(himl->hbmImage);
     himl->hbmImage = hbmColor;
-    if (hbmMask){
+    if (hbmMask) {
         SelectObject(himl->hdcMask, hbmMask);
         DeleteObject(himl->hbmMask);
         himl->hbmMask = hbmMask;
@@ -1993,7 +1974,7 @@
     himl->cMaxImage = ilHead.cMaxImage;
 
     ImageList_SetBkColor(himl,ilHead.bkcolor);
-    for (i=0;i<4;i++)
+    for (i=0; i<4; i++)
     	ImageList_SetOverlayImage(himl,ilHead.ovls[i],i+1);
     return himl;
 }
@@ -2174,8 +2155,7 @@
     StretchBlt (himl->hdcImage, i * himl->cx, 0, himl->cx, himl->cy,
                   hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
 
-    if (himl->hbmMask)
-    {
+    if (himl->hbmMask) {
         /* Replace Mask */
         SelectObject (hdcImage, hbmMask);
 
@@ -2511,8 +2491,7 @@
 	return FALSE;
     if (himl->cCurImage >= iImageCount)
 	return FALSE;
-    if (himl->cMaxImage > iImageCount)
-    {
+    if (himl->cMaxImage > iImageCount) {
         himl->cCurImage = iImageCount;
 	return TRUE;
     }
@@ -2524,8 +2503,7 @@
 
     hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount * himl->cx, himl->cy);
 
-    if (hbmNewBitmap != 0)
-    {
+    if (hbmNewBitmap != 0) {
         SelectObject (hdcBitmap, hbmNewBitmap);
 
 	/* copy images */
@@ -2545,12 +2523,10 @@
     else
 	ERR("Could not create new image bitmap !\n");
 
-    if (himl->hbmMask)
-    {
+    if (himl->hbmMask) {
         hbmNewBitmap = CreateBitmap (nNewCount * himl->cx, himl->cy,
                                        1, 1, NULL);
-        if (hbmNewBitmap != 0)
-        {
+        if (hbmNewBitmap != 0) {
             SelectObject (hdcBitmap, hbmNewBitmap);
 
 	    /* copy images */
@@ -2772,15 +2748,13 @@
     HBITMAP hbmNewBitmap;
     UINT ilc = (himl->flags & 0xFE);
 
-    if ((ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32) || ilc == ILC_COLOR)
-    {
+    if ((ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32) || ilc == ILC_COLOR) {
         VOID* bits;
         BITMAPINFO *bmi;
 
         TRACE("Creating DIBSection: %d Bits per Pixel\n", himl->uBitsPixel);
 
-	if (himl->uBitsPixel <= ILC_COLOR8)
-	{
+	if (himl->uBitsPixel <= ILC_COLOR8) {
 	    LPPALETTEENTRY pal;
 	    ULONG i, colors;
 	    BYTE temp;
@@ -2794,15 +2768,12 @@
 
 	    /* Swap colors returned by GetPaletteEntries so we can use them for
 	     * CreateDIBSection call. */
-	    for (i = 0; i < colors; i++)
-	    {
+	    for (i = 0; i < colors; i++) {
 	        temp = pal[i].peBlue;
 	        bmi->bmiColors[i].rgbRed = pal[i].peRed;
 	        bmi->bmiColors[i].rgbBlue = temp;
 	    }
-	}
-	else
-	{
+	} else {
 	    bmi = HeapAlloc(GetProcessHeap(), 0, sizeof(BITMAPINFOHEADER));
 	}
 
@@ -2821,9 +2792,7 @@
 	hbmNewBitmap = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, &bits, 0, 0);
 
 	HeapFree(GetProcessHeap(), 0, bmi);
-    }
-    else /*if (ilc == ILC_COLORDDB)*/
-    {
+    } else { /*if (ilc == ILC_COLORDDB)*/
         TRACE("Creating Bitmap: %d Bits per Pixel\n", himl->uBitsPixel);
 
         hbmNewBitmap = CreateBitmap (width, height, 1, himl->uBitsPixel, NULL);

-- 
Dimi.



More information about the wine-patches mailing list