Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 23696 → Rev 23697

/trunk/Scribus/doc/en/scripterapi-styles.html
187,6 → 187,10
<dd><code>getAllStyles() -&gt; list</code>
<p>Deprecated, use getParagraphStyles() instead.</p></dd>
 
<dt><a name="-getCellStyles"><strong>getCellStyles</strong></a>(...)</dt>
<dd><code>getCellStyles() -&gt; list</code>
<p>Return a list of the names of all cell styles in the current document.</p></dd>
 
<dt><a name="-getCharStyles"><strong>getCharStyles</strong></a>(...)</dt>
<dd><code>getCharStyles() -&gt; list</code>
<p>Return a list of the names of all character styles in the current document.</p></dd>
199,6 → 203,10
<dd><code>getParagraphStyles() -&gt; list</code>
<p>Return a list of the names of all paragraph styles in the current document.</p></dd>
 
<dt><a name="-getTableStyles"><strong>getTableStyles</strong></a>(...)</dt>
<dd><code>getTableStyles() -&gt; list</code>
<p>Return a list of the names of all table styles in the current document.</p></dd>
 
</dl>
</body>
</html>
/trunk/Scribus/doc/fr/scripterapi-styles.html
184,6 → 184,10
<dd><tt>getAllStyles() -&gt; liste</tt>
<p>Obsolète. Veuillez utiliser getParagraphStyles() en lieu et place.</p></dd>
 
<dt><a name="-getCellStyles"><strong>getCellStyles</strong></a>(...)</dt>
<dd><tt>getCellStyles() -&gt; liste</tt>
<p>Retourne une liste des noms de l'ensemble des styles de cellule du document courant.</p></dd>
 
<dt><a name="-getCharStyles"><strong>getCharStyles</strong></a>(...)</dt>
<dd><tt>getCharStyles() -&gt; liste</tt>
<p>Retourne une liste des noms de l'ensemble des styles de caractère du document courant.</p></dd>
196,6 → 200,10
<dd><tt>getParagraphStyles() -&gt; liste</tt>
<p>Retourne une liste des noms de l'ensemble des styles de paragraphe du document courant.</p></dd>
 
<dt><a name="-getTableStyles"><strong>getTableStyles</strong></a>(...)</dt>
<dd><tt>getTableStyles() -&gt; liste</tt>
<p>Retourne une liste des noms de l'ensemble des styles de tableau du document courant.</p></dd>
 
</dl>
</body>
</html>
/trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.cpp
419,6 → 419,9
return styleList;
}
 
/*
* Enumerate all known character styles
*/
PyObject *scribus_getcharstylenames(PyObject* /* self */)
{
if (!checkHaveDocument())
438,6 → 441,9
return charStyleList;
}
 
/*
* Enumerate all known line styles
*/
PyObject *scribus_getlinestyles(PyObject* /* self */)
{
if (!checkHaveDocument())
458,6 → 464,50
return lineStyleList;
}
 
/*
* Enumerate all known cell styles
*/
PyObject *scribus_getcellstyles(PyObject* /* self */)
{
if (!checkHaveDocument())
return nullptr;
const auto& cellStyles = ScCore->primaryMainWindow()->doc->cellStyles();
 
PyObject *styleList = PyList_New(0);
for (int i = 0; i < cellStyles.count(); ++i)
{
const QString& cellStyleName = cellStyles[i].name();
if (PyList_Append(styleList, PyUnicode_FromString(cellStyleName.toUtf8())))
{
// An exception will have already been set by PyList_Append apparently.
return nullptr;
}
}
return styleList;
}
 
/*
* Enumerate all known table styles
*/
PyObject *scribus_gettablestyles(PyObject* /* self */)
{
if (!checkHaveDocument())
return nullptr;
const auto& tableStyles = ScCore->primaryMainWindow()->doc->tableStyles();
 
PyObject *styleList = PyList_New(0);
for (int i = 0; i < tableStyles.count(); ++i)
{
const QString& tableStyleName = tableStyles[i].name();
if (PyList_Append(styleList, PyUnicode_FromString(tableStyleName.toUtf8())))
{
// An exception will have already been set by PyList_Append apparently.
return nullptr;
}
}
return styleList;
}
 
/*! HACK: this removes "warning: 'blah' defined but not used" compiler warnings
with header files structure untouched (docstrings are kept near declarations)
PV */
/trunk/Scribus/scribus/plugins/scriptplugin/cmdstyle.h
133,7 → 133,6
"));
PyObject *scribus_getcharstylenames(PyObject * /*self*/);
 
 
/*! docstring */
PyDoc_STRVAR(scribus_getlinestyles__doc__,
QT_TR_NOOP("getLineStyles() -> list\n\
142,5 → 141,21
"));
PyObject *scribus_getlinestyles(PyObject * /*self*/);
 
/*! docstring */
PyDoc_STRVAR(scribus_getcellstyles__doc__,
QT_TR_NOOP("getCellStyles() -> list\n\
\n\
Return a list of the names of all cell styles in the current document.\n\
"));
PyObject *scribus_getcellstyles(PyObject * /*self*/);
 
/*! docstring */
PyDoc_STRVAR(scribus_gettablestyles__doc__,
QT_TR_NOOP("getTableStyles() -> list\n\
\n\
Return a list of the names of all table styles in the current document.\n\
"));
PyObject *scribus_gettablestyles(PyObject * /*self*/);
 
#endif
 
/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
335,6 → 335,7
{const_cast<char*>("getAllStyles"), (PyCFunction)scribus_getparagraphstyles, METH_NOARGS, tr(scribus_getallstyles__doc__)}, //Deprecated
{const_cast<char*>("getAllText"), scribus_getalltext, METH_VARARGS, tr(scribus_getalltext__doc__)},
{const_cast<char*>("getCellStyle"), scribus_getcellstyle, METH_VARARGS, tr(scribus_getcellstyle__doc__)},
{const_cast<char*>("getCellStyles"), (PyCFunction)scribus_getcellstyles, METH_VARARGS, tr(scribus_getcellstyles__doc__)},
{const_cast<char*>("getCellColumnSpan"), scribus_getcellcolumnspan, METH_VARARGS, tr(scribus_getcellcolumnspan__doc__)},
{const_cast<char*>("getCellRowSpan"), scribus_getcellrowspan, METH_VARARGS, tr(scribus_getcellrowspan__doc__)},
{const_cast<char*>("getCellFillColor"), scribus_getcellfillcolor, METH_VARARGS, tr(scribus_getcellfillcolor__doc__)},
400,6 → 401,7
{const_cast<char*>("getTableColumns"), scribus_gettablecolumns, METH_VARARGS, tr(scribus_gettablecolumns__doc__)},
{const_cast<char*>("getTableColumnWidth"), scribus_gettablecolumnwidth, METH_VARARGS, tr(scribus_gettablecolumnwidth__doc__)},
{const_cast<char*>("getTableStyle"), scribus_gettablestyle, METH_VARARGS, tr(scribus_gettablestyle__doc__)},
{const_cast<char*>("getTableStyles"), (PyCFunction)scribus_gettablestyles, METH_VARARGS, tr(scribus_gettablestyles__doc__)},
{const_cast<char*>("getTableFillColor"), scribus_gettablefillcolor, METH_VARARGS, tr(scribus_gettablefillcolor__doc__)},
{const_cast<char*>("getText"), scribus_getframetext, METH_VARARGS, tr(scribus_gettext__doc__)}, // Deprecated
{const_cast<char*>("getTextColor"), scribus_gettextcolor, METH_VARARGS, tr(scribus_gettextcolor__doc__)},