oleaut32: Simplify bitmap saving code.
This commit is contained in:
parent
4c88239742
commit
7493fdcc4d
|
@ -1749,6 +1749,7 @@ static HRESULT WINAPI OLEPictureImpl_Save(
|
||||||
HRESULT hResult = E_NOTIMPL;
|
HRESULT hResult = E_NOTIMPL;
|
||||||
void * pIconData;
|
void * pIconData;
|
||||||
unsigned int iDataSize;
|
unsigned int iDataSize;
|
||||||
|
DWORD header[2];
|
||||||
ULONG dummy;
|
ULONG dummy;
|
||||||
int iSerializeResult = 0;
|
int iSerializeResult = 0;
|
||||||
OLEPictureImpl *This = impl_from_IPersistStream(iface);
|
OLEPictureImpl *This = impl_from_IPersistStream(iface);
|
||||||
|
@ -1797,38 +1798,23 @@ static HRESULT WINAPI OLEPictureImpl_Save(
|
||||||
FIXME("(%p,%p,%d), PICTYPE_BITMAP (format UNKNOWN, using BMP?) not implemented!\n",This,pStm,fClearDirty);
|
FIXME("(%p,%p,%d), PICTYPE_BITMAP (format UNKNOWN, using BMP?) not implemented!\n",This,pStm,fClearDirty);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (iSerializeResult) {
|
|
||||||
/*
|
|
||||||
if (This->loadtime_magic != 0xdeadbeef) {
|
|
||||||
*/
|
|
||||||
if (1) {
|
|
||||||
DWORD header[2];
|
|
||||||
|
|
||||||
header[0] = (This->loadtime_magic != 0xdeadbeef) ? This->loadtime_magic : 0x0000746c;
|
if (!iSerializeResult)
|
||||||
header[1] = iDataSize;
|
{
|
||||||
IStream_Write(pStm, header, 2 * sizeof(DWORD), &dummy);
|
hResult = E_FAIL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
IStream_Write(pStm, pIconData, iDataSize, &dummy);
|
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This->data);
|
HeapFree(GetProcessHeap(), 0, This->data);
|
||||||
This->data = pIconData;
|
This->data = pIconData;
|
||||||
This->datalen = iDataSize;
|
This->datalen = iDataSize;
|
||||||
hResult = S_OK;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
if (This->loadtime_magic != 0xdeadbeef) {
|
|
||||||
*/
|
|
||||||
if (1) {
|
|
||||||
DWORD header[2];
|
|
||||||
|
|
||||||
header[0] = (This->loadtime_magic != 0xdeadbeef) ? This->loadtime_magic : 0x0000746c;
|
header[0] = (This->loadtime_magic != 0xdeadbeef) ? This->loadtime_magic : 0x0000746c;
|
||||||
header[1] = This->datalen;
|
header[1] = This->datalen;
|
||||||
IStream_Write(pStm, header, 2 * sizeof(DWORD), &dummy);
|
IStream_Write(pStm, header, 2 * sizeof(DWORD), &dummy);
|
||||||
}
|
|
||||||
IStream_Write(pStm, This->data, This->datalen, &dummy);
|
IStream_Write(pStm, This->data, This->datalen, &dummy);
|
||||||
hResult = S_OK;
|
hResult = S_OK;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case PICTYPE_METAFILE:
|
case PICTYPE_METAFILE:
|
||||||
FIXME("(%p,%p,%d), PICTYPE_METAFILE not implemented!\n",This,pStm,fClearDirty);
|
FIXME("(%p,%p,%d), PICTYPE_METAFILE not implemented!\n",This,pStm,fClearDirty);
|
||||||
|
|
Loading…
Reference in New Issue