gdiplus: Avoid needless gotos.

This commit is contained in:
Dmitry Timoshkov 2012-05-24 13:49:02 +09:00 committed by Alexandre Julliard
parent 4060716dc4
commit a33d34b83e
1 changed files with 9 additions and 10 deletions

View File

@ -151,15 +151,15 @@ static inline GpStatus clone_element(const region_element* element,
{ {
case RegionDataRect: case RegionDataRect:
(*element2)->elementdata.rect = element->elementdata.rect; (*element2)->elementdata.rect = element->elementdata.rect;
break; return Ok;
case RegionDataEmptyRect: case RegionDataEmptyRect:
case RegionDataInfiniteRect: case RegionDataInfiniteRect:
break; return Ok;
case RegionDataPath: case RegionDataPath:
(*element2)->elementdata.pathdata.pathheader = element->elementdata.pathdata.pathheader; (*element2)->elementdata.pathdata.pathheader = element->elementdata.pathdata.pathheader;
stat = GdipClonePath(element->elementdata.pathdata.path, stat = GdipClonePath(element->elementdata.pathdata.path,
&(*element2)->elementdata.pathdata.path); &(*element2)->elementdata.pathdata.path);
if (stat != Ok) goto clone_out; if (stat == Ok) return Ok;
break; break;
default: default:
(*element2)->elementdata.combine.left = NULL; (*element2)->elementdata.combine.left = NULL;
@ -167,16 +167,15 @@ static inline GpStatus clone_element(const region_element* element,
stat = clone_element(element->elementdata.combine.left, stat = clone_element(element->elementdata.combine.left,
&(*element2)->elementdata.combine.left); &(*element2)->elementdata.combine.left);
if (stat != Ok) goto clone_out; if (stat == Ok)
stat = clone_element(element->elementdata.combine.right, {
&(*element2)->elementdata.combine.right); stat = clone_element(element->elementdata.combine.right,
if (stat != Ok) goto clone_out; &(*element2)->elementdata.combine.right);
if (stat == Ok) return Ok;
}
break; break;
} }
return Ok;
clone_out:
delete_element(*element2); delete_element(*element2);
*element2 = NULL; *element2 = NULL;
return stat; return stat;