r24147 by jghali - Code style fixes

scribus-commit scribus-commit at lists.scribus.net
Sun Nov 1 03:50:28 UTC 2020


Author: jghali
Date: Sun Nov  1 03:50:28 2020
New Revision: 24147

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24147
Log:
Code style fixes

Modified:
    trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.cpp

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24147&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp	Sun Nov  1 03:50:28 2020
@@ -434,17 +434,20 @@
 	if (item == nullptr)
 		return nullptr;
 
-	if (!PyList_Check(attr)) {
+	if (!PyList_Check(attr))
+	{
 		PyErr_SetString(PyExc_TypeError, "argument must be list.");
 		return nullptr;
 	}
 
 	ObjAttrVector attributes;
 	int n = PyList_Size(attr);
-	for (int i=0; i<n; ++i) {
+	for (int i = 0; i < n; ++i)
+	{
 		PyObject *tmp = PyList_GetItem(attr, i);
-		if (!PyDict_Check(tmp)) {
-			PyErr_SetString(PyExc_TypeError, "elemets of 'attr' must be dictionary.");
+		if (!PyDict_Check(tmp))
+		{
+			PyErr_SetString(PyExc_TypeError, "elements of 'attr' must be dictionary.");
 			return nullptr;
 		}
 		ObjectAttribute blank;
@@ -452,7 +455,8 @@
 		const char* data;
 
 		val = PyDict_GetItemString(tmp, "Name");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'Name' key.");
 			return nullptr;
 		}
@@ -462,7 +466,8 @@
 		blank.name = QString::fromUtf8(data);
 
 		val = PyDict_GetItemString(tmp, "Type");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'Type' key.");
 			return nullptr;
 		}
@@ -472,7 +477,8 @@
 		blank.type = QString::fromUtf8(data);
 
 		val = PyDict_GetItemString(tmp, "Value");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'Value' key.");
 			return nullptr;
 		}
@@ -482,7 +488,8 @@
 		blank.value = QString::fromUtf8(data);
 
 		val = PyDict_GetItemString(tmp, "Parameter");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'Parameter' key.");
 			return nullptr;
 		}
@@ -492,7 +499,8 @@
 		blank.parameter = QString::fromUtf8(data);
 
 		val = PyDict_GetItemString(tmp, "Relationship");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'Relationship' key.");
 			return nullptr;
 		}
@@ -502,7 +510,8 @@
 		blank.relationship = QString::fromUtf8(data);
 
 		val = PyDict_GetItemString(tmp, "RelationshipTo");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'RelationshipTo' key.");
 			return nullptr;
 		}
@@ -512,7 +521,8 @@
 		blank.relationshipto = QString::fromUtf8(data);
 
 		val = PyDict_GetItemString(tmp, "AutoAddTo");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'AutoAddTo' key.");
 			return nullptr;
 		}

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24147&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdsetprop.cpp	Sun Nov  1 03:50:28 2020
@@ -434,17 +434,20 @@
 	if (item == nullptr)
 		return nullptr;
 
-	if (!PyList_Check(attr)) {
+	if (!PyList_Check(attr))
+	{
 		PyErr_SetString(PyExc_TypeError, "argument must be list.");
 		return nullptr;
 	}
 
 	ObjAttrVector attributes;
 	int n = PyList_Size(attr);
-	for (int i=0; i<n; ++i) {
+	for (int i = 0; i < n; ++i)
+	{
 		PyObject *tmp = PyList_GetItem(attr, i);
-		if (!PyDict_Check(tmp)) {
-			PyErr_SetString(PyExc_TypeError, "elemets of 'attr' must be dictionary.");
+		if (!PyDict_Check(tmp))
+		{
+			PyErr_SetString(PyExc_TypeError, "elements of 'attr' must be dictionary.");
 			return nullptr;
 		}
 		ObjectAttribute blank;
@@ -452,7 +455,8 @@
 		char* data;
 
 		val = PyDict_GetItemString(tmp, "Name");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'Name' key.");
 			return nullptr;
 		}
@@ -462,7 +466,8 @@
 		blank.name = QString(data);
 
 		val = PyDict_GetItemString(tmp, "Type");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'Type' key.");
 			return nullptr;
 		}
@@ -472,7 +477,8 @@
 		blank.type = QString(data);
 
 		val = PyDict_GetItemString(tmp, "Value");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'Value' key.");
 			return nullptr;
 		}
@@ -482,7 +488,8 @@
 		blank.value = QString(data);
 
 		val = PyDict_GetItemString(tmp, "Parameter");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'Parameter' key.");
 			return nullptr;
 		}
@@ -492,7 +499,8 @@
 		blank.parameter = QString(data);
 
 		val = PyDict_GetItemString(tmp, "Relationship");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'Relationship' key.");
 			return nullptr;
 		}
@@ -502,7 +510,8 @@
 		blank.relationship = QString(data);
 
 		val = PyDict_GetItemString(tmp, "RelationshipTo");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'RelationshipTo' key.");
 			return nullptr;
 		}
@@ -512,7 +521,8 @@
 		blank.relationshipto = QString(data);
 
 		val = PyDict_GetItemString(tmp, "AutoAddTo");
-		if (!val) {
+		if (!val)
+		{
 			PyErr_SetString(PyExc_TypeError, "attribute does not have 'AutoAddTo' key.");
 			return nullptr;
 		}




More information about the scribus-commit mailing list