Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9cf2bd9d
Commit
9cf2bd9d
authored
Oct 31, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Oct 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: There's no need to store a separate clip format for the data.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c3fe4b87
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
datacache.c
dlls/ole32/datacache.c
+7
-15
No files found.
dlls/ole32/datacache.c
View file @
9cf2bd9d
...
...
@@ -101,8 +101,6 @@ typedef struct DataCacheEntry
struct
list
entry
;
/* format of this entry */
FORMATETC
fmtetc
;
/* the clipboard format of the data */
CLIPFORMAT
data_cf
;
/* cached data */
STGMEDIUM
stgmedium
;
/*
...
...
@@ -351,7 +349,6 @@ static BOOL init_cache_entry(DataCacheEntry *entry, const FORMATETC *fmt, DWORD
hr
=
copy_formatetc
(
&
entry
->
fmtetc
,
fmt
);
if
(
FAILED
(
hr
))
return
FALSE
;
entry
->
data_cf
=
0
;
entry
->
stgmedium
.
tymed
=
TYMED_NULL
;
entry
->
stgmedium
.
pUnkForRelease
=
NULL
;
entry
->
stream
=
NULL
;
...
...
@@ -637,7 +634,6 @@ static HRESULT load_mf_pict( DataCacheEntry *cache_entry, IStream *stm )
GlobalUnlock
(
hmfpict
);
if
(
SUCCEEDED
(
hr
))
{
cache_entry
->
data_cf
=
cache_entry
->
fmtetc
.
cfFormat
;
cache_entry
->
stgmedium
.
tymed
=
TYMED_MFPICT
;
cache_entry
->
stgmedium
.
u
.
hMetaFilePict
=
hmfpict
;
}
...
...
@@ -722,7 +718,6 @@ static HRESULT load_dib( DataCacheEntry *cache_entry, IStream *stm )
GlobalUnlock
(
hglobal
);
cache_entry
->
data_cf
=
cache_entry
->
fmtetc
.
cfFormat
;
cache_entry
->
stgmedium
.
tymed
=
TYMED_HGLOBAL
;
cache_entry
->
stgmedium
.
u
.
hGlobal
=
hglobal
;
...
...
@@ -803,7 +798,7 @@ static HRESULT DataCacheEntry_Save(DataCacheEntry *cache_entry, IStorage *storag
if
(
FAILED
(
hr
))
return
hr
;
hr
=
write_clipformat
(
pres_stream
,
cache_entry
->
data_cf
);
hr
=
write_clipformat
(
pres_stream
,
cache_entry
->
fmtetc
.
cfFormat
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -819,7 +814,7 @@ static HRESULT DataCacheEntry_Save(DataCacheEntry *cache_entry, IStorage *storag
header
.
dwSize
=
0
;
/* size the data */
switch
(
cache_entry
->
data_cf
)
switch
(
cache_entry
->
fmtetc
.
cfFormat
)
{
case
CF_METAFILEPICT
:
{
...
...
@@ -854,7 +849,7 @@ static HRESULT DataCacheEntry_Save(DataCacheEntry *cache_entry, IStorage *storag
}
/* get the data */
switch
(
cache_entry
->
data_cf
)
switch
(
cache_entry
->
fmtetc
.
cfFormat
)
{
case
CF_METAFILEPICT
:
{
...
...
@@ -983,7 +978,6 @@ static HRESULT DataCacheEntry_SetData(DataCacheEntry *cache_entry,
cache_entry
->
dirty
=
TRUE
;
ReleaseStgMedium
(
&
cache_entry
->
stgmedium
);
cache_entry
->
data_cf
=
cache_entry
->
fmtetc
.
cfFormat
?
cache_entry
->
fmtetc
.
cfFormat
:
formatetc
->
cfFormat
;
if
(
formatetc
->
cfFormat
==
CF_BITMAP
)
{
...
...
@@ -1001,8 +995,7 @@ static HRESULT DataCacheEntry_SetData(DataCacheEntry *cache_entry,
return
S_OK
;
}
else
return
copy_stg_medium
(
cache_entry
->
data_cf
,
&
cache_entry
->
stgmedium
,
stgmedium
);
return
copy_stg_medium
(
cache_entry
->
fmtetc
.
cfFormat
,
&
cache_entry
->
stgmedium
,
stgmedium
);
}
static
HRESULT
DataCacheEntry_GetData
(
DataCacheEntry
*
cache_entry
,
FORMATETC
*
fmt
,
STGMEDIUM
*
stgmedium
)
...
...
@@ -1023,13 +1016,12 @@ static HRESULT DataCacheEntry_GetData(DataCacheEntry *cache_entry, FORMATETC *fm
stgmedium
->
pUnkForRelease
=
NULL
;
return
S_OK
;
}
return
copy_stg_medium
(
cache_entry
->
data_cf
,
stgmedium
,
&
cache_entry
->
stgmedium
);
return
copy_stg_medium
(
cache_entry
->
fmtetc
.
cfFormat
,
stgmedium
,
&
cache_entry
->
stgmedium
);
}
static
inline
HRESULT
DataCacheEntry_DiscardData
(
DataCacheEntry
*
cache_entry
)
{
ReleaseStgMedium
(
&
cache_entry
->
stgmedium
);
cache_entry
->
data_cf
=
cache_entry
->
fmtetc
.
cfFormat
;
return
S_OK
;
}
...
...
@@ -1844,7 +1836,7 @@ static HRESULT WINAPI DataCache_Draw(
if
(
pfnContinue
&&
!
pfnContinue
(
dwContinue
))
return
E_ABORT
;
switch
(
cache_entry
->
data_cf
)
switch
(
cache_entry
->
fmtetc
.
cfFormat
)
{
case
CF_METAFILEPICT
:
{
...
...
@@ -2103,7 +2095,7 @@ static HRESULT WINAPI DataCache_GetExtent(
continue
;
switch
(
cache_entry
->
data_cf
)
switch
(
cache_entry
->
fmtetc
.
cfFormat
)
{
case
CF_METAFILEPICT
:
{
...
...
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