Skip to content

Commit

Permalink
Apply shoogens partly patch for #935
Browse files Browse the repository at this point in the history
Merge branch 'bugfix-importsvg' of git://github.com/5263/FreeCAD into releases/FreeCAD-0-13

Conflicts:
	src/Base/PreCompiled.h
  • Loading branch information
jriegel committed Jan 4, 2013
2 parents ef1190b + d374054 commit b6f284f
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 34 deletions.
60 changes: 30 additions & 30 deletions src/App/DocumentPyImp.cpp
Expand Up @@ -311,36 +311,36 @@ PyObject* DocumentPy::findObjects(PyObject *args)
char *sType="App::DocumentObject", *sName=0;
if (!PyArg_ParseTuple(args, "|ss",&sType, &sName)) // convert args: Python->C
return NULL; // NULL triggers exception

Base::Type type = Base::Type::fromName(sType);
if (type == Base::Type::badType()) {
PyErr_Format(PyExc_Exception, "'%s' is not a valid type", sType);
return NULL;
}

if (!type.isDerivedFrom(App::DocumentObject::getClassTypeId())) {
PyErr_Format(PyExc_Exception, "Type '%s' does not inherit from 'App::DocumentObject'", sType);
return NULL;
}

std::vector<DocumentObject*> res;

if (sName) {
try {
res = getDocumentPtr()->findObjects(type, sName);
}
catch (const boost::regex_error& e) {
PyErr_SetString(PyExc_RuntimeError, e.what());
return 0;
}
}
else {
res = getDocumentPtr()->getObjectsOfType(type);
}

Py_ssize_t index=0;
PyObject* list = PyList_New((Py_ssize_t)res.size());
for (std::vector<DocumentObject*>::const_iterator It = res.begin();It != res.end();++It, index++)

Base::Type type = Base::Type::fromName(sType);
if (type == Base::Type::badType()) {
PyErr_Format(PyExc_Exception, "'%s' is not a valid type", sType);
return NULL;
}

if (!type.isDerivedFrom(App::DocumentObject::getClassTypeId())) {
PyErr_Format(PyExc_Exception, "Type '%s' does not inherit from 'App::DocumentObject'", sType);
return NULL;
}

std::vector<DocumentObject*> res;

if (sName) {
try {
res = getDocumentPtr()->findObjects(type, sName);
}
catch (const boost::regex_error& e) {
PyErr_SetString(PyExc_RuntimeError, e.what());
return 0;
}
}
else {
res = getDocumentPtr()->getObjectsOfType(type);
}

Py_ssize_t index=0;
PyObject* list = PyList_New((Py_ssize_t)res.size());
for (std::vector<DocumentObject*>::const_iterator It = res.begin();It != res.end();++It, index++)
PyList_SetItem(list, index, (*It)->getPyObject());
return list;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Base/Uuid.cpp
Expand Up @@ -65,7 +65,6 @@ Uuid::~Uuid()
//**************************************************************************
// Get the UUID
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

std::string Uuid::CreateUuid(void)
{
#ifdef FC_OS_WIN32
Expand Down Expand Up @@ -108,3 +107,4 @@ std::string Uuid::CreateUuid(void)
#endif
return Uuid;
}

3 changes: 2 additions & 1 deletion src/Mod/Draft/importSVG.py
Expand Up @@ -887,7 +887,8 @@ def startElement(self, name, attrs):
rot90=FreeCAD.Matrix(0,-1,0,0,1,0) #90
m3=m3.multiply(rot90)
m3.move(c.multiply(-1))
sh.transform(m3)
sh.transformShape(m3)
#sh = sh.transformGeometry(m3)
if self.fill:
sh = Part.Wire([sh])
sh = Part.Face(sh)
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Drawing/Gui/Workbench.cpp
Expand Up @@ -65,6 +65,8 @@ Gui::MenuItem* Workbench::setupMenuBar() const
*part << "Drawing_Annotation";
*part << "Drawing_Clip";
*part << "Drawing_ExportPage";
*part << "Separator";
*part << "Drawing_ProjectShape";

return root;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Mesh/App/MeshPyImp.cpp
Expand Up @@ -127,9 +127,9 @@ PyObject* MeshPy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;


const MeshCore::MeshKernel& kernel = getMeshObjectPtr()->getKernel();
return new MeshPy(new MeshObject(kernel));
return new MeshPy(new MeshObject(kernel));
}

PyObject* MeshPy::read(PyObject *args)
Expand Down

0 comments on commit b6f284f

Please sign in to comment.