Commit a4ab858a authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

gdiplus: GdipCreateMetafileFromWmfFile will also load EMFs.

parent aac33dab
......@@ -2361,13 +2361,20 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete,
GpStatus WINGDIPAPI GdipCreateMetafileFromWmfFile(GDIPCONST WCHAR *file,
GDIPCONST WmfPlaceableFileHeader * placeable, GpMetafile **metafile)
{
HMETAFILE hmf = GetMetaFileW(file);
HMETAFILE hmf;
HENHMETAFILE emf;
TRACE("(%s, %p, %p)\n", debugstr_w(file), placeable, metafile);
if(!hmf) return InvalidParameter;
hmf = GetMetaFileW(file);
if(hmf)
return GdipCreateMetafileFromWmf(hmf, TRUE, placeable, metafile);
return GdipCreateMetafileFromWmf(hmf, TRUE, placeable, metafile);
emf = GetEnhMetaFileW(file);
if(emf)
return GdipCreateMetafileFromEmf(emf, TRUE, metafile);
return GenericError;
}
GpStatus WINGDIPAPI GdipCreateMetafileFromFile(GDIPCONST WCHAR *file,
......
......@@ -2702,6 +2702,7 @@ static void test_fillpath(void)
{
static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0};
static const GpRectF frame = {0.0, 0.0, 100.0, 100.0};
static const WCHAR winetestemfW[] = {'w','i','n','e','t','e','s','t','.','e','m','f',0};
GpMetafile *metafile;
GpGraphics *graphics;
......@@ -2745,10 +2746,26 @@ static void test_fillpath(void)
expect(Ok, stat);
check_emfplus(hemf, fill_path_records, "fill path");
/* write to disk */
DeleteEnhMetaFile(CopyEnhMetaFileW(hemf, winetestemfW));
DeleteEnhMetaFile(hemf);
stat = GdipDisposeImage((GpImage*)metafile);
expect(Ok, stat);
/* should succeed when given path to an EMF */
stat = GdipCreateMetafileFromWmfFile(winetestemfW, NULL, &metafile);
expect(Ok, stat);
stat = GdipDisposeImage((GpImage*)metafile);
expect(Ok, stat);
DeleteFileW(winetestemfW);
stat = GdipCreateMetafileFromWmfFile(winetestemfW, NULL, &metafile);
expect(GenericError, stat);
}
START_TEST(metafile)
......
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