Commit 26826d3a authored by Alexandre Julliard's avatar Alexandre Julliard

riched20: Use nameless unions/structs.

parent a56fcef7
......@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#include "editor.h"
WINE_DEFAULT_DEBUG_CHANNEL(richedit);
......@@ -226,9 +224,9 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor
return DV_E_TYMED;
if(This->unicode && pformatetc->cfFormat == CF_UNICODETEXT)
pmedium->u.hGlobal = This->unicode;
pmedium->hGlobal = This->unicode;
else if(This->rtf && pformatetc->cfFormat == cfRTF)
pmedium->u.hGlobal = This->rtf;
pmedium->hGlobal = This->rtf;
else
return DV_E_FORMATETC;
......
......@@ -224,8 +224,6 @@
*
*/
#define NONAMELESSUNION
#include "editor.h"
#include "commdlg.h"
#include "winreg.h"
......@@ -1129,13 +1127,13 @@ static HRESULT insert_static_object(ME_TextEditor *editor, HENHMETAFILE hemf, HB
if (hemf)
{
stgm.tymed = TYMED_ENHMF;
stgm.u.hEnhMetaFile = hemf;
stgm.hEnhMetaFile = hemf;
fm.cfFormat = CF_ENHMETAFILE;
}
else if (hbmp)
{
stgm.tymed = TYMED_GDI;
stgm.u.hBitmap = hbmp;
stgm.hBitmap = hbmp;
fm.cfFormat = CF_BITMAP;
}
else return E_FAIL;
......@@ -2205,7 +2203,7 @@ static HRESULT paste_rtf(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med)
ME_GlobalDestStruct gds;
HRESULT hr;
gds.hData = med->u.hGlobal;
gds.hData = med->hGlobal;
gds.nLength = 0;
es.dwCookie = (DWORD_PTR)&gds;
es.pfnCallback = ME_ReadFromHGLOBALRTF;
......@@ -2220,7 +2218,7 @@ static HRESULT paste_text(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med)
ME_GlobalDestStruct gds;
HRESULT hr;
gds.hData = med->u.hGlobal;
gds.hData = med->hGlobal;
gds.nLength = 0;
es.dwCookie = (DWORD_PTR)&gds;
es.pfnCallback = ME_ReadFromHGLOBALUnicode;
......@@ -2234,7 +2232,7 @@ static HRESULT paste_emf(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med)
HRESULT hr;
SIZEL sz = {0, 0};
hr = insert_static_object( editor, med->u.hEnhMetaFile, NULL, &sz );
hr = insert_static_object( editor, med->hEnhMetaFile, NULL, &sz );
if (SUCCEEDED(hr))
{
ME_CommitUndo( editor );
......
......@@ -21,7 +21,6 @@
#include <stdarg.h>
#define NONAMELESSUNION
#define COBJMACROS
#include "windef.h"
......@@ -5762,12 +5761,12 @@ void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize)
switch (stgm.tymed)
{
case TYMED_GDI:
GetObjectW(stgm.u.hBitmap, sizeof(dibsect), &dibsect);
GetObjectW(stgm.hBitmap, sizeof(dibsect), &dibsect);
pSize->cx = dibsect.dsBm.bmWidth;
pSize->cy = dibsect.dsBm.bmHeight;
break;
case TYMED_ENHMF:
GetEnhMetaFileHeader(stgm.u.hEnhMetaFile, sizeof(emh), &emh);
GetEnhMetaFileHeader(stgm.hEnhMetaFile, sizeof(emh), &emh);
pSize->cx = emh.rclBounds.right - emh.rclBounds.left;
pSize->cy = emh.rclBounds.bottom - emh.rclBounds.top;
break;
......@@ -5854,9 +5853,9 @@ void draw_ole( ME_Context *c, int x, int y, ME_Run *run, BOOL selected )
switch (stgm.tymed)
{
case TYMED_GDI:
GetObjectW(stgm.u.hBitmap, sizeof(dibsect), &dibsect);
GetObjectW(stgm.hBitmap, sizeof(dibsect), &dibsect);
hMemDC = CreateCompatibleDC(c->hDC);
old_bm = SelectObject(hMemDC, stgm.u.hBitmap);
old_bm = SelectObject(hMemDC, stgm.hBitmap);
if (has_size)
{
convert_sizel(c, &run->reobj->obj.sizel, &sz);
......@@ -5876,7 +5875,7 @@ void draw_ole( ME_Context *c, int x, int y, ME_Run *run, BOOL selected )
DeleteDC(hMemDC);
break;
case TYMED_ENHMF:
GetEnhMetaFileHeader(stgm.u.hEnhMetaFile, sizeof(emh), &emh);
GetEnhMetaFileHeader(stgm.hEnhMetaFile, sizeof(emh), &emh);
if (has_size)
{
convert_sizel(c, &run->reobj->obj.sizel, &sz);
......@@ -5894,7 +5893,7 @@ void draw_ole( ME_Context *c, int x, int y, ME_Run *run, BOOL selected )
rc.top = y - sz.cy;
rc.right = x + sz.cx;
rc.bottom = y;
PlayEnhMetaFile(c->hDC, stgm.u.hEnhMetaFile, &rc);
PlayEnhMetaFile(c->hDC, stgm.hEnhMetaFile, &rc);
break;
default:
FIXME("Unsupported tymed %ld\n", stgm.tymed);
......
......@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#include "editor.h"
#include "rtf.h"
......@@ -953,13 +951,13 @@ static BOOL stream_out_graphics( ME_TextEditor *editor, ME_OutStream *stream,
if (FAILED(hr)) goto done;
if (med.tymed != TYMED_ENHMF) goto done;
size = GetEnhMetaFileBits( med.u.hEnhMetaFile, 0, NULL );
size = GetEnhMetaFileBits( med.hEnhMetaFile, 0, NULL );
if (size < FIELD_OFFSET(ENHMETAHEADER, cbPixelFormat)) goto done;
emf_bits = HeapAlloc( GetProcessHeap(), 0, size );
if (!emf_bits) goto done;
size = GetEnhMetaFileBits( med.u.hEnhMetaFile, size, (BYTE *)emf_bits );
size = GetEnhMetaFileBits( med.hEnhMetaFile, size, (BYTE *)emf_bits );
if (size < FIELD_OFFSET(ENHMETAHEADER, cbPixelFormat)) goto done;
/* size_in_pixels = (frame_size / 100) * szlDevice / szlMillimeters
......
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