+ implement missing methods of Python API for SelectionObject

This commit is contained in:
wmayer
2015-05-21 12:45:36 +02:00
parent d2740d6a7d
commit 8a35c47465
5 changed files with 80 additions and 43 deletions

View File

@@ -49,9 +49,9 @@ SelectionObject::~SelectionObject()
const App::DocumentObject * SelectionObject::getObject(void) const
{
if (DocName != "") {
if (!DocName.empty()) {
App::Document *doc = App::GetApplication().getDocument(DocName.c_str());
if (doc && FeatName != "")
if (doc && !FeatName.empty())
return doc->getObject(FeatName.c_str());
}
return 0;
@@ -59,9 +59,9 @@ const App::DocumentObject * SelectionObject::getObject(void) const
App::DocumentObject * SelectionObject::getObject(void)
{
if (DocName != "") {
if (!DocName.empty()) {
App::Document *doc = App::GetApplication().getDocument(DocName.c_str());
if (doc && FeatName != "")
if (doc && !FeatName.empty())
return doc->getObject(FeatName.c_str());
}
return 0;
@@ -93,9 +93,7 @@ std::string SelectionObject::getAsPropertyLinkSubString(void)const
return buf;
}
PyObject* SelectionObject::getPyObject()
{
return new SelectionObjectPy(new SelectionObject(*this));
}