Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 24763 → Rev 24764

/trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
385,6 → 385,24
return PyFloat_FromDouble(static_cast<double>(item->currentStyle().lineSpacing()));
}
 
PyObject *scribus_getlinespacingmode(PyObject* /* self */, PyObject* args)
{
char *Name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
return nullptr;
if (!checkHaveDocument())
return nullptr;
PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
if (item == nullptr)
return nullptr;
if (!item->isTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get line spacing mode of non-text frame.","python error").toLocal8Bit().constData());
return nullptr;
}
return PyFloat_FromDouble(static_cast<double>(item->currentStyle().lineSpacingMode()));
}
 
PyObject *scribus_gettextdistances(PyObject* /* self */, PyObject* args)
{
char *Name = const_cast<char*>("");
/trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.h
198,6 → 198,15
PyObject *scribus_getlinespacing(PyObject * /*self*/, PyObject* args);
 
/*! docstring */
PyDoc_STRVAR(scribus_getlinespacingmode__doc__,
QT_TR_NOOP("getLineSpacingMode([\"name\"]) -> float\n\
\n\
Returns the line spacing mode of the text frame \"name\". If \"name\" is not given the currently selected item is used.\n\
"));
/*! Get line spacing mode*/
PyObject *scribus_getlinespacingmode(PyObject * /*self*/, PyObject* args);
 
/*! docstring */
PyDoc_STRVAR(scribus_gettextdistances__doc__,
QT_TR_NOOP("getTextDistances([\"name\"]) -> tuple\n\
\n\
/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
379,6 → 379,7
{const_cast<char*>("getLineJoin"), scribus_getlinejoin, METH_VARARGS, tr(scribus_getlinejoin__doc__)},
{const_cast<char*>("getLineShade"), scribus_getlineshade, METH_VARARGS, tr(scribus_getlineshade__doc__)},
{const_cast<char*>("getLineSpacing"), scribus_getlinespacing, METH_VARARGS, tr(scribus_getlinespacing__doc__)},
{const_cast<char*>("getLineSpacingMode"), scribus_getlinespacingmode, METH_VARARGS, tr(scribus_getlinespacingmode__doc__)},
{const_cast<char*>("getLineStyle"), scribus_getlinestyle, METH_VARARGS, tr(scribus_getlinestyle__doc__)},
{const_cast<char*>("getLineStyles"), (PyCFunction)scribus_getlinestyles, METH_VARARGS, tr(scribus_getlinestyles__doc__)},
{const_cast<char*>("getLineTransparency"), scribus_getlinetransparency, METH_VARARGS, tr(scribus_getlinetransparency__doc__)},
/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdtext.cpp
385,6 → 385,25
return PyFloat_FromDouble(static_cast<double>(item->currentStyle().lineSpacing()));
}
 
 
PyObject *scribus_getlinespacingmode(PyObject* /* self */, PyObject* args)
{
char *Name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
return nullptr;
if (!checkHaveDocument())
return nullptr;
PageItem *item = GetUniqueItem(QString::fromUtf8(Name));
if (item == nullptr)
return nullptr;
if (!item->isTextFrame())
{
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot get line spacing mode of non-text frame.","python error").toLocal8Bit().constData());
return nullptr;
}
return PyFloat_FromDouble(static_cast<double>(item->currentStyle().lineSpacingMode()));
}
 
PyObject *scribus_gettextdistances(PyObject* /* self */, PyObject* args)
{
char *Name = const_cast<char*>("");
1548,6 → 1567,7
<< scribus_getframetext__doc__
<< scribus_getlastlinkedframe__doc__
<< scribus_getlinespacing__doc__
<< scribus_getlinespacingmode__doc__
<< scribus_getnextlinkedframe__doc__
<< scribus_getprevlinkedframe__doc__
<< scribus_gettext__doc__ // Deprecated
/trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptplugin.cpp
379,6 → 379,7
{const_cast<char*>("getLineJoin"), scribus_getlinejoin, METH_VARARGS, tr(scribus_getlinejoin__doc__)},
{const_cast<char*>("getLineShade"), scribus_getlineshade, METH_VARARGS, tr(scribus_getlineshade__doc__)},
{const_cast<char*>("getLineSpacing"), scribus_getlinespacing, METH_VARARGS, tr(scribus_getlinespacing__doc__)},
{const_cast<char*>("getLineSpacingMode"), scribus_getlinespacingmode, METH_VARARGS, tr(scribus_getlinespacingmode__doc__)},
{const_cast<char*>("getLineStyle"), scribus_getlinestyle, METH_VARARGS, tr(scribus_getlinestyle__doc__)},
{const_cast<char*>("getLineStyles"), (PyCFunction)scribus_getlinestyles, METH_VARARGS, tr(scribus_getlinestyles__doc__)},
{const_cast<char*>("getLineTransparency"), scribus_getlinetransparency, METH_VARARGS, tr(scribus_getlinetransparency__doc__)},