Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
26826d3a
Commit
26826d3a
authored
Jul 10, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use nameless unions/structs.
parent
a56fcef7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
22 deletions
+15
-22
clipboard.c
dlls/riched20/clipboard.c
+2
-4
editor.c
dlls/riched20/editor.c
+5
-7
richole.c
dlls/riched20/richole.c
+6
-7
writer.c
dlls/riched20/writer.c
+2
-4
No files found.
dlls/riched20/clipboard.c
View file @
26826d3a
...
...
@@ -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
;
...
...
dlls/riched20/editor.c
View file @
26826d3a
...
...
@@ -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
);
...
...
dlls/riched20/richole.c
View file @
26826d3a
...
...
@@ -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
);
...
...
dlls/riched20/writer.c
View file @
26826d3a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment