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
176e4ba4
Commit
176e4ba4
authored
Oct 20, 2008
by
Kirill K. Smirnov
Committed by
Alexandre Julliard
Oct 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Whole picture object should be cloned in GdipCloneImage(), not just parent class 'image'.
parent
4736c993
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
21 deletions
+8
-21
image.c
dlls/gdiplus/image.c
+4
-21
image.c
dlls/gdiplus/tests/image.c
+4
-0
No files found.
dlls/gdiplus/image.c
View file @
176e4ba4
...
...
@@ -254,6 +254,7 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
HRESULT
hr
;
INT
size
;
LARGE_INTEGER
move
;
GpStatus
stat
=
GenericError
;
TRACE
(
"%p, %p
\n
"
,
image
,
cloneImage
);
...
...
@@ -264,15 +265,6 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
if
(
FAILED
(
hr
))
return
GenericError
;
*
cloneImage
=
GdipAlloc
(
sizeof
(
GpImage
));
if
(
!*
cloneImage
)
{
IStream_Release
(
stream
);
return
OutOfMemory
;
}
(
*
cloneImage
)
->
type
=
image
->
type
;
(
*
cloneImage
)
->
flags
=
image
->
flags
;
hr
=
IPicture_SaveAsFile
(
image
->
picture
,
stream
,
FALSE
,
&
size
);
if
(
FAILED
(
hr
))
{
...
...
@@ -286,21 +278,12 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
if
(
FAILED
(
hr
))
goto
out
;
hr
=
OleLoadPicture
(
stream
,
size
,
FALSE
,
&
IID_IPicture
,
(
LPVOID
*
)
&
(
*
cloneImage
)
->
picture
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to load image from stream
\n
"
);
goto
out
;
}
stat
=
GdipLoadImageFromStream
(
stream
,
cloneImage
);
if
(
stat
!=
Ok
)
WARN
(
"Failed to load image from stream
\n
"
);
IStream_Release
(
stream
);
return
Ok
;
out:
IStream_Release
(
stream
);
GdipFree
(
*
cloneImage
);
*
cloneImage
=
NULL
;
return
GenericError
;
return
stat
;
}
GpStatus
WINGDIPAPI
GdipCreateBitmapFromFile
(
GDIPCONST
WCHAR
*
filename
,
...
...
dlls/gdiplus/tests/image.c
View file @
176e4ba4
...
...
@@ -514,6 +514,10 @@ static void test_GdipCloneImage(void)
stat
=
GdipGetImageBounds
(
image_dest
,
&
rectF
,
&
unit
);
expect
(
Ok
,
stat
);
/* Treat FP values carefully */
ok
(
fabsf
(
rectF
.
Width
-
WIDTH
)
<
1e-5
,
"Expected: %d, got %.05f
\n
"
,
WIDTH
,
rectF
.
Width
);
ok
(
fabsf
(
rectF
.
Height
-
HEIGHT
)
<
1e-5
,
"Expected: %d, got %.05f
\n
"
,
HEIGHT
,
rectF
.
Height
);
stat
=
GdipDisposeImage
(
image_dest
);
expect
(
Ok
,
stat
);
}
...
...
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