diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-08-04 16:44:52 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-08-04 17:05:47 -0300 |
commit | 4a73d09fa2480cd6ef84309c0ca7fe295442b472 (patch) | |
tree | 16a0b2d78d97cd2032091eb703e73c4b19c927ed | |
parent | 5c2551705ae6ecfb7baa1c71cfbc4bdbf012943d (diff) |
C++ wrapper code is generated for functions whose visibility was modified to private.
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Reviewed by Renato Araújo <renato.filho@openbossa.org>
-rw-r--r-- | cppgenerator.cpp | 5 | ||||
-rw-r--r-- | headergenerator.cpp | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp index f3ca270da..9d409c161 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -204,7 +204,8 @@ void CppGenerator::generateClass(QTextStream &s, const AbstractMetaClass *metaCl s << endl; foreach (const AbstractMetaFunction* func, filterFunctions(metaClass)) { - if (func->isPrivate() || (func->isModifiedRemoved() && !func->isAbstract())) + if ((func->isPrivate() && !visibilityModifiedToPrivate(func)) + || (func->isModifiedRemoved() && !func->isAbstract())) continue; if (func->isConstructor() && !func->isCopyConstructor() && !func->isUserAdded()) writeConstructorNative(s, func); @@ -666,7 +667,7 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu s << INDENT << "if (" << PYTHON_RETURN_VAR << "->ob_refcnt < 2) {" << endl; { Indentation indent(INDENT); - s << INDENT << "PyErr_SetString(PyExc_ReferenceError, \"Returning last python reference on virutal function: " + s << INDENT << "PyErr_SetString(PyExc_ReferenceError, \"Returning last python reference on virutal function: " << func->ownerClass()->name() << "." << func->name() << "\");" << endl; s << INDENT << "PyErr_Print();" << endl; s << INDENT << "assert(false);" << endl; diff --git a/headergenerator.cpp b/headergenerator.cpp index d5fab6bd9..2176baf6c 100644 --- a/headergenerator.cpp +++ b/headergenerator.cpp @@ -175,7 +175,8 @@ void HeaderGenerator::writeFunction(QTextStream& s, const AbstractMetaFunction* #endif // pure virtual functions need a default implementation - if (func->isPrivate() || (func->isModifiedRemoved() && !func->isAbstract())) + if ((func->isPrivate() && !visibilityModifiedToPrivate(func)) + || (func->isModifiedRemoved() && !func->isAbstract())) return; #ifdef AVOID_PROTECTED_HACK |