_renderPM.c: move some labels to safer positions py33 ReportLab_3_0
authorrobin
Fri, 14 Feb 2014 13:54:18 +0000
branchpy33
changeset 4042 6382a792db9e
parent 4041 50576bcec131
child 4043 4dc5b3b6fbd5
_renderPM.c: move some labels to safer positions
src/rl_addons/renderPM/_renderPM.c
--- a/src/rl_addons/renderPM/_renderPM.c	Fri Feb 14 11:59:14 2014 +0000
+++ b/src/rl_addons/renderPM/_renderPM.c	Fri Feb 14 13:54:18 2014 +0000
@@ -844,10 +844,7 @@
 			obj0 = PyUnicode_DecodeUTF8(text, textlen,NULL);
 			if(!obj0) return NULL;
 			}
-		else{
-L0:			PyErr_SetString(PyExc_ValueError, "_renderPM.gstate_drawString: text must be bytes/unicode!");
-			return NULL;
-			}
+		else goto L0;
 		textlen = PyUnicode_GetSize(obj0);
 		utext = PyUnicode_AsUnicode(obj0);
 		_ft_data.pathMax = 0;
@@ -938,6 +935,9 @@
 	self->path = saved_path;
 	Py_INCREF(Py_None);
 	return Py_None;
+
+L0:	PyErr_SetString(PyExc_ValueError, "_renderPM.gstate_drawString: text must be bytes/unicode!");
+	return NULL;
 }
 
 static PyObject* _fmtPathElement(ArtBpath *p, char* name, int n)
@@ -1063,10 +1063,7 @@
 			obj0 = PyUnicode_DecodeUTF8(text, textlen,NULL);
 			if(!obj0) return NULL;
 			}
-		else{
-L0:			PyErr_SetString(PyExc_ValueError, "_renderPM.gstate_drawString: text must be bytes/unicode!");
-			return NULL;
-			}
+		else goto L0;
 		textlen = PyUnicode_GetSize(obj0);
 		utext = PyUnicode_AsUnicode(obj0);
 		_ft_data.pathMax = 0;
@@ -1146,6 +1143,9 @@
 	if(ft_font) art_free(_ft_data.path);
 #endif
 	return P;
+
+L0:	PyErr_SetString(PyExc_ValueError, "_renderPM.gstate_drawString: text must be bytes/unicode!");
+	return NULL;
 }
 
 static PyObject* gstate_setFont(gstateObject* self, PyObject* args)