gdiplus: Don't modify container list if container restoration fails.
This commit is contained in:
parent
099f031051
commit
a06c2570e5
|
@ -3400,7 +3400,7 @@ GpStatus WINGDIPAPI GdipComment(GpGraphics *graphics, UINT sizeData, GDIPCONST B
|
||||||
return NotImplemented;
|
return NotImplemented;
|
||||||
}
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipEndContainer(GpGraphics *graphics, GraphicsState state)
|
GpStatus WINGDIPAPI GdipEndContainer(GpGraphics *graphics, GraphicsContainer state)
|
||||||
{
|
{
|
||||||
GpStatus sts;
|
GpStatus sts;
|
||||||
GraphicsContainerItem *container, *container2;
|
GraphicsContainerItem *container, *container2;
|
||||||
|
@ -3419,6 +3419,10 @@ GpStatus WINGDIPAPI GdipEndContainer(GpGraphics *graphics, GraphicsState state)
|
||||||
if(&container->entry == &graphics->containers)
|
if(&container->entry == &graphics->containers)
|
||||||
return Ok;
|
return Ok;
|
||||||
|
|
||||||
|
sts = restore_container(graphics, container);
|
||||||
|
if(sts != Ok)
|
||||||
|
return sts;
|
||||||
|
|
||||||
/* remove all of the containers on top of the found container */
|
/* remove all of the containers on top of the found container */
|
||||||
LIST_FOR_EACH_ENTRY_SAFE(container, container2, &graphics->containers, GraphicsContainerItem, entry){
|
LIST_FOR_EACH_ENTRY_SAFE(container, container2, &graphics->containers, GraphicsContainerItem, entry){
|
||||||
if(container->contid == state)
|
if(container->contid == state)
|
||||||
|
@ -3428,10 +3432,9 @@ GpStatus WINGDIPAPI GdipEndContainer(GpGraphics *graphics, GraphicsState state)
|
||||||
}
|
}
|
||||||
|
|
||||||
list_remove(&container->entry);
|
list_remove(&container->entry);
|
||||||
sts = restore_container(graphics, container);
|
|
||||||
delete_container(container);
|
delete_container(container);
|
||||||
|
|
||||||
return sts;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
GpStatus WINGDIPAPI GdipScaleWorldTransform(GpGraphics *graphics, REAL sx,
|
GpStatus WINGDIPAPI GdipScaleWorldTransform(GpGraphics *graphics, REAL sx,
|
||||||
|
|
Loading…
Reference in New Issue