r23693 by jghali - Move a few style related functions from cmdobj.* to cmdstyle.*

scribus-commit scribus-commit at lists.scribus.net
Tue May 5 16:26:40 UTC 2020


Author: jghali
Date: Tue May  5 16:26:40 2020
New Revision: 23693

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23693
Log:
Move a few style related functions from cmdobj.* to cmdstyle.*

Modified:
    trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.h
    trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23693&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp	Tue May  5 16:26:40 2020
@@ -813,48 +813,6 @@
 	Py_RETURN_NONE;
 }
 
-/*
- * Craig Ringer, 2004-09-09
- * Enumerate all known paragraph styles
- */
-PyObject *scribus_getstylenames(PyObject* /* self */)
-{
-	PyObject *styleList;
-	if (!checkHaveDocument())
-		return nullptr;
-	const auto& paragraphStyles = ScCore->primaryMainWindow()->doc->paragraphStyles();
-
-	styleList = PyList_New(0);
-	for (int i = 0; i < paragraphStyles.count(); ++i)
-	{
-		if (PyList_Append(styleList, PyUnicode_FromString(paragraphStyles[i].name().toUtf8())))
-		{
-			// An exception will have already been set by PyList_Append apparently.
-			return nullptr;
-		}
-	}
-	return styleList;
-}
-
-PyObject *scribus_getcharstylenames(PyObject* /* self */)
-{
-	PyObject *charStyleList;
-	if (!checkHaveDocument())
-		return nullptr;
-	const auto& charStyles = ScCore->primaryMainWindow()->doc->charStyles();
-
-	charStyleList = PyList_New(0);
-	for (int i = 0; i < charStyles.count(); ++i)
-	{
-		if (PyList_Append(charStyleList, PyUnicode_FromString(charStyles[i].name().toUtf8())))
-		{
-			// An exception will have already been set by PyList_Append apparently.
-			return nullptr;
-		}
-	}
-	return charStyleList;
-}
-
 PyObject *scribus_duplicateobject(PyObject * /* self */, PyObject *args)
 {
 	char* name = const_cast<char*>("");
@@ -929,10 +887,8 @@
 	  << scribus_deleteobj__doc__
 	  << scribus_duplicateobject__doc__
 	  << scribus_getcharacterstyle__doc__
-	  << scribus_getcharstylenames__doc__
 	  << scribus_getparagraphstyle__doc__
 	  << scribus_getstyle__doc__
-	  << scribus_getstylenames__doc__
 	  << scribus_newellipse__doc__
 	  << scribus_newimage__doc__
 	  << scribus_newline__doc__

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23693&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.h	Tue May  5 16:26:40 2020
@@ -327,27 +327,6 @@
 PyObject *scribus_setcharstyle(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
-PyDoc_STRVAR(scribus_getstylenames__doc__,
-QT_TR_NOOP("getAllStyles() -> list\n\
-\n\
-Return a list of the names of all paragraph styles in the current document.\n\
-"));
-/**
- Craig Ringer, 2004-09-09
- Enumerate all known paragraph styles
-*/
-PyObject *scribus_getstylenames(PyObject * /*self*/);
-
-/*! docstring */
-PyDoc_STRVAR(scribus_getcharstylenames__doc__,
-QT_TR_NOOP("getCharStyles() -> list\n\
-\n\
-Return a list of the names of all character styles in the current document.\n\
-"));
-PyObject *scribus_getcharstylenames(PyObject * /*self*/);
-
-
-/*! docstring */
 PyDoc_STRVAR(scribus_duplicateobject__doc__,
 QT_TR_NOOP("duplicateObject([\"name\"]) -> string\n\
 \n\

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23693&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp	Tue May  5 16:26:40 2020
@@ -396,6 +396,47 @@
 	Py_RETURN_NONE;
 }
 
+/*
+ * Craig Ringer, 2004-09-09
+ * Enumerate all known paragraph styles
+ */
+PyObject *scribus_getstylenames(PyObject* /* self */)
+{
+	PyObject *styleList;
+	if (!checkHaveDocument())
+		return nullptr;
+	const auto& paragraphStyles = ScCore->primaryMainWindow()->doc->paragraphStyles();
+
+	styleList = PyList_New(0);
+	for (int i = 0; i < paragraphStyles.count(); ++i)
+	{
+		if (PyList_Append(styleList, PyUnicode_FromString(paragraphStyles[i].name().toUtf8())))
+		{
+			// An exception will have already been set by PyList_Append apparently.
+			return nullptr;
+		}
+	}
+	return styleList;
+}
+
+PyObject *scribus_getcharstylenames(PyObject* /* self */)
+{
+	PyObject *charStyleList;
+	if (!checkHaveDocument())
+		return nullptr;
+	const auto& charStyles = ScCore->primaryMainWindow()->doc->charStyles();
+
+	charStyleList = PyList_New(0);
+	for (int i = 0; i < charStyles.count(); ++i)
+	{
+		if (PyList_Append(charStyleList, PyUnicode_FromString(charStyles[i].name().toUtf8())))
+		{
+			// An exception will have already been set by PyList_Append apparently.
+			return nullptr;
+		}
+	}
+	return charStyleList;
+}
 
 /*! HACK: this removes "warning: 'blah' defined but not used" compiler warnings
 with header files structure untouched (docstrings are kept near declarations)
@@ -405,5 +446,7 @@
 	QStringList s;
 	s  << scribus_createcharstyle__doc__
 	   << scribus_createcustomlinestyle__doc__
-	   << scribus_createparagraphstyle__doc__;
-}
+	   << scribus_createparagraphstyle__doc__
+	   << scribus_getcharstylenames__doc__
+	   << scribus_getstylenames__doc__;
+}

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23693&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h	Tue May  5 16:26:40 2020
@@ -107,5 +107,25 @@
 "));
 PyObject *scribus_createcustomlinestyle(PyObject * /* self */, PyObject* args);
 
+/*! docstring */
+PyDoc_STRVAR(scribus_getstylenames__doc__,
+QT_TR_NOOP("getAllStyles() -> list\n\
+\n\
+Return a list of the names of all paragraph styles in the current document.\n\
+"));
+/**
+ Craig Ringer, 2004-09-09
+ Enumerate all known paragraph styles
+*/
+PyObject *scribus_getstylenames(PyObject * /*self*/);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_getcharstylenames__doc__,
+QT_TR_NOOP("getCharStyles() -> list\n\
+\n\
+Return a list of the names of all character styles in the current document.\n\
+"));
+PyObject *scribus_getcharstylenames(PyObject * /*self*/);
+
 #endif
 




More information about the scribus-commit mailing list