Commit b6f284f5 authored by jriegel's avatar jriegel
Browse files

Apply shoogens partly patch for #935

Merge branch 'bugfix-importsvg' of git://github.com/5263/FreeCAD into releases/FreeCAD-0-13

Conflicts:
	src/Base/PreCompiled.h
parents ef1190bf d374054f
......@@ -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;
}
......
......@@ -65,7 +65,6 @@ Uuid::~Uuid()
//**************************************************************************
// Get the UUID
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
std::string Uuid::CreateUuid(void)
{
#ifdef FC_OS_WIN32
......@@ -108,3 +107,4 @@ std::string Uuid::CreateUuid(void)
#endif
return Uuid;
}
......@@ -887,7 +887,8 @@ class svgHandler(xml.sax.ContentHandler):
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)
......
......@@ -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;
}
......
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment