fix CIDs 154873, 154874, 153875, 153876, 154883, 154884, 154886

This commit is contained in:
wmayer
2016-12-18 13:27:34 +01:00
parent 5e0a972999
commit df8f7cfb7e
5 changed files with 21 additions and 12 deletions

View File

@@ -21,7 +21,7 @@ std::string DrawProjGroupPy::representation(void) const
PyObject* DrawProjGroupPy::addProjection(PyObject* args)
{
const char* projType;
char* projType;
if (!PyArg_ParseTuple(args, "s", &projType)) {
throw Py::Exception();
@@ -30,13 +30,17 @@ PyObject* DrawProjGroupPy::addProjection(PyObject* args)
DrawProjGroup* projGroup = getDrawProjGroupPtr();
App::DocumentObject* docObj = projGroup->addProjection(projType);
TechDraw::DrawProjGroupItem* newProj = dynamic_cast<TechDraw::DrawProjGroupItem *>( docObj );
if (!newProj) {
PyErr_SetString(PyExc_TypeError, "wrong type for adding projection");
return nullptr;
}
return new DrawProjGroupItemPy(newProj);
}
PyObject* DrawProjGroupPy::removeProjection(PyObject* args)
{
const char* projType;
char* projType;
if (!PyArg_ParseTuple(args, "s", &projType)) {
throw Py::Exception();
@@ -45,7 +49,7 @@ PyObject* DrawProjGroupPy::removeProjection(PyObject* args)
DrawProjGroup* projGroup = getDrawProjGroupPtr();
int i = projGroup->removeProjection(projType);
return PyInt_FromLong((long) i);;
return PyInt_FromLong((long) i);
}
PyObject* DrawProjGroupPy::purgeProjections(PyObject* /*args*/)
@@ -53,12 +57,12 @@ PyObject* DrawProjGroupPy::purgeProjections(PyObject* /*args*/)
DrawProjGroup* projGroup = getDrawProjGroupPtr();
int i = projGroup->purgeProjections();
return PyInt_FromLong((long) i);;
return PyInt_FromLong((long) i);
}
PyObject* DrawProjGroupPy::getItemByLabel(PyObject* args)
{
const char* projType;
char* projType;
if (!PyArg_ParseTuple(args, "s", &projType)) {
throw Py::Exception();
@@ -67,6 +71,10 @@ PyObject* DrawProjGroupPy::getItemByLabel(PyObject* args)
DrawProjGroup* projGroup = getDrawProjGroupPtr();
App::DocumentObject* docObj = projGroup->getProjObj(projType);
TechDraw::DrawProjGroupItem* newProj = dynamic_cast<TechDraw::DrawProjGroupItem *>( docObj );
if (!newProj) {
PyErr_SetString(PyExc_TypeError, "wrong type for getting item");
return nullptr;
}
return new DrawProjGroupItemPy(newProj);
}
@@ -74,7 +82,7 @@ PyObject* DrawProjGroupPy::getItemByLabel(PyObject* args)
//TODO: this is no longer required?
PyObject* DrawProjGroupPy::setViewOrientation(PyObject* args)
{
const char* projType;
char* projType;
PyObject* pcObj;
if (!PyArg_ParseTuple(args, "Os", &pcObj,&projType))
throw Py::Exception();