Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 23692 → Rev 23693

/trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
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__
/trunk/Scribus/scribus/plugins/scriptplugin/cmdobj.h
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\
/trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp
396,7 → 396,48
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)
PV */
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__;
}
/trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h
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