[Wine-patches] [eter-2.0.0 2/3] oleaut32: OleCreatePictureIndirect should set loadtime_format for a bitmap. [eterbug #8463]

Dmitry Timoshkov dtimoshkov на etersoft.ru
Пт Май 18 07:23:41 MSK 2012


---
 dlls/oleaut32/olepicture.c |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index f6a184f..62f9f6d 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -70,6 +70,12 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(olepicture);
 
+#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
+
 #include "pshpack1.h"
 
 /* Header for Aldus Placable Metafiles - a standard metafile follows */
@@ -214,6 +220,8 @@ static void OLEPictureImpl_SetBitmap(OLEPictureImpl *This)
   This->origWidth = bm.bmWidth;
   This->origHeight = bm.bmHeight;
 
+  TRACE("width %d, height %d, bpp %d\n", bm.bmWidth, bm.bmHeight, bm.bmBitsPixel);
+
   /* The width and height are stored in HIMETRIC units (0.01 mm),
      so we take our pixel width divide by pixels per inch and
      multiply by 25.4 * 100 */
@@ -224,6 +232,8 @@ static void OLEPictureImpl_SetBitmap(OLEPictureImpl *This)
   This->himetricHeight = ypixels_to_himetric(bm.bmHeight, hdcRef);
   This->stock_bitmap = GetCurrentObject( hdcRef, OBJ_BITMAP );
 
+  This->loadtime_format = BITMAP_FORMAT_BMP;
+
   DeleteDC(hdcRef);
 }
 
@@ -1315,17 +1325,6 @@ 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.
-- 
1.7.10.1



Подробная информация о списке рассылки Wine-patches