+ support of unicode names for sketch constraints
This commit is contained in:
@@ -318,10 +318,13 @@ PyObject* SketchObjectPy::delConstraint(PyObject *args)
|
||||
PyObject* SketchObjectPy::renameConstraint(PyObject *args)
|
||||
{
|
||||
int Index;
|
||||
char* Name;
|
||||
if (!PyArg_ParseTuple(args, "is", &Index, &Name))
|
||||
char* utf8Name;
|
||||
if (!PyArg_ParseTuple(args, "iet", &Index, "utf-8", &utf8Name))
|
||||
return 0;
|
||||
|
||||
std::string Name = utf8Name;
|
||||
PyMem_Free(utf8Name);
|
||||
|
||||
if (this->getSketchObjectPtr()->Constraints.getSize() <= Index) {
|
||||
std::stringstream str;
|
||||
str << "Not able to rename a constraint with the given index: " << Index;
|
||||
@@ -329,7 +332,7 @@ PyObject* SketchObjectPy::renameConstraint(PyObject *args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strcmp(Name, "") != 0) {
|
||||
if (!Name.empty()) {
|
||||
|
||||
if (!Sketcher::PropertyConstraintList::validConstraintName(Name)) {
|
||||
std::stringstream str;
|
||||
|
||||
Reference in New Issue
Block a user