Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 332 → Rev 331

/trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
6,10 → 6,7
PyObject *scribus_actualpage(PyObject *self, PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
{
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("CurrentPage()"));
return NULL;
}
if (!Carrier->HaveDoc)
return PyInt_FromLong(0L);
return PyInt_FromLong(static_cast<long>(Carrier->doc->ActPage->PageNr + 1));
18,10 → 15,7
PyObject *scribus_redraw(PyObject *self, PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
{
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("RedrawAll()"));
return NULL;
}
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
33,10 → 27,7
{
char *Name;
if (!PyArg_ParseTuple(args, "s", &Name))
{
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("SavePageAsEPS(filename)"));
return NULL;
}
if (!Carrier->HaveDoc)
return PyInt_FromLong(0L);
bool ret = Carrier->DoSaveAsEps(QString(Name));
48,10 → 39,7
{
int e;
if (!PyArg_ParseTuple(args, "i", &e))
{
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("DeletePage(pagenumber)"));
return NULL;
}
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
67,10 → 55,7
{
int e;
if (!PyArg_ParseTuple(args, "i", &e))
{
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("GotoPage(pagenumber)"));
return NULL;
}
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
87,10 → 72,7
int e;
char *name = "Normal";
if (!PyArg_ParseTuple(args, "i|s", &e, &name))
{
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("NewPage(pagenumber [, pagename])"));
return NULL;
}
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
110,10 → 92,7
PyObject *scribus_pagecount(PyObject *self, PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
{
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("PageCount()"));
return NULL;
}
if (!Carrier->HaveDoc)
return PyInt_FromLong(0L);
return PyInt_FromLong(static_cast<long>(Carrier->view->Pages.count()));
121,16 → 100,14
 
PyObject *scribus_pagedimension(PyObject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
{
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("PageDimension()"));
if (!PyArg_ParseTuple(args, "")) {
return NULL;
}
if (!Carrier->HaveDoc)
{
Py_INCREF(Py_None);
if (!Carrier->HaveDoc) {
Py_INCREF(Py_None);
return Py_None;
}
PyObject *t;
t = Py_BuildValue(
"(dd)",
143,10 → 120,7
PyObject *scribus_getpageitems(PyObject *self, PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
{
PyErr_SetString(PyExc_Exception, ERRPARAM + QString("GetPageItems()"));
return NULL;
}
if ((!Carrier->HaveDoc) || (Carrier->doc->ActPage->Items.count() == 0))
return Py_BuildValue((char*)"[]");
PyObject *l = PyList_New(Carrier->doc->ActPage->Items.count());
157,7 → 131,7
Carrier->doc->ActPage->Items.at(i)->AnName.ascii(),
Carrier->doc->ActPage->Items.at(i)->PType,
Carrier->doc->ActPage->Items.at(i)->ItemNr
);
);
PyList_SetItem(l, i, row);
} // for
return l;