diff --git a/src/Mod/Spreadsheet/App/PropertySheetPy.xml b/src/Mod/Spreadsheet/App/PropertySheetPy.xml index 14125a8540..4ee484140d 100644 --- a/src/Mod/Spreadsheet/App/PropertySheetPy.xml +++ b/src/Mod/Spreadsheet/App/PropertySheetPy.xml @@ -15,5 +15,17 @@ Internal spreadsheet object + + diff --git a/src/Mod/Spreadsheet/App/PropertySheetPyImp.cpp b/src/Mod/Spreadsheet/App/PropertySheetPyImp.cpp index 1313ed80b4..fff334e8b8 100644 --- a/src/Mod/Spreadsheet/App/PropertySheetPyImp.cpp +++ b/src/Mod/Spreadsheet/App/PropertySheetPyImp.cpp @@ -31,23 +31,6 @@ using namespace Spreadsheet; -struct PropertySheetPyInit { - - PyMappingMethods methods; - - PropertySheetPyInit() { - methods.mp_length = 0; - methods.mp_ass_subscript = 0; - methods.mp_subscript = [](PyObject *o, PyObject *key) { - return static_cast(o)->getPropertySheetPtr()->getPyValue(key); - }; - - PropertySheetPy::Type.tp_as_mapping = &methods; - } -}; - -static PropertySheetPyInit _PropertySheetPyInit; - // returns a string which represents the object e.g. when printed in python std::string PropertySheetPy::representation(void) const { @@ -66,9 +49,14 @@ int PropertySheetPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/) return 0; } +PyObject * PropertySheetPy::mapping_subscript(PyObject * o, PyObject *key) +{ + return static_cast(o)->getPropertySheetPtr()->getPyValue(key); +} + PyObject *PropertySheetPy::getCustomAttributes(const char* /*attr*/) const { - return 0; + return nullptr; } int PropertySheetPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)