[PATCH 5/6] OLE: Use BITMAP_FORMAT_* flags consistently.
Nathan Beckmann
nathan.beckmann at gmail.com
Sun Feb 24 09:57:18 CST 2008
---
dlls/oleaut32/olepicture.c | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index bf9213b..5b8531f 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -1744,6 +1744,17 @@ static HRESULT OLEPictureImpl_LoadAPM(OLEPictureImpl *This,
}
/************************************************************************
+ * BITMAP FORMAT FLAGS -
+ * Flags that differentiate between different types of bitmaps.
+ */
+
+#define BITMAP_FORMAT_BMP 0x4d42 /* "BM" */
+#define BITMAP_FORMAT_JPEG 0xd8ff /* ?? */
+#define BITMAP_FORMAT_GIF 0x4947 /* ?? */
+#define BITMAP_FORMAT_PNG 0x5089 /* ?? */
+#define BITMAP_FORMAT_APM 0xcdd7 /* ?? */
+
+/************************************************************************
* OLEPictureImpl_IPersistStream_Load (IUnknown)
*
* Loads the binary data from the IStream. Starts at current position.
@@ -1889,19 +1900,19 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
This->loadtime_format = magic;
switch (magic) {
- case 0x4947: /* GIF */
+ case BITMAP_FORMAT_GIF: /* GIF */
hr = OLEPictureImpl_LoadGif(This, xbuf, xread);
break;
- case 0xd8ff: /* JPEG */
+ case BITMAP_FORMAT_JPEG: /* JPEG */
hr = OLEPictureImpl_LoadJpeg(This, xbuf, xread);
break;
- case 0x4d42: /* Bitmap */
+ case BITMAP_FORMAT_BMP: /* Bitmap */
hr = OLEPictureImpl_LoadDIB(This, xbuf, xread);
break;
- case 0x5089: /* PNG */
+ case BITMAP_FORMAT_PNG: /* PNG */
hr = OLEPictureImpl_LoadPNG(This, xbuf, xread);
break;
- case 0xcdd7: /* APM */
+ case BITMAP_FORMAT_APM: /* APM */
hr = OLEPictureImpl_LoadAPM(This, xbuf, xread);
break;
case 0x0000: { /* ICON , first word is dwReserved */
@@ -2157,11 +2168,6 @@ static int serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
* Detect which picture format to use based on a file's extension.
*/
-#define BITMAP_FORMAT_BMP 0x4d42 /* "BM */
-#define BITMAP_FORMAT_JPEG 0xd8ff /* ?? */
-#define BITMAP_FORMAT_GIF 0x4947 /* ?? */
-#define BITMAP_FORMAT_PNG 0x5089 /* ?? */
-
static unsigned int picture_format_from_filename(WCHAR* filename)
{
WCHAR* end_of_filename;
--
1.5.4.2
More information about the wine-patches
mailing list