From 4de1b39b4f428200241f726fe32d77a1f6bcc30a Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 1 Aug 2016 13:17:47 -0300 Subject: [PATCH] Spreadsheet: Made SheetPython inherit python object from Sheet --- src/Mod/Spreadsheet/App/Sheet.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mod/Spreadsheet/App/Sheet.cpp b/src/Mod/Spreadsheet/App/Sheet.cpp index d7e2e8192..927785d9c 100644 --- a/src/Mod/Spreadsheet/App/Sheet.cpp +++ b/src/Mod/Spreadsheet/App/Sheet.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -1345,6 +1346,13 @@ PROPERTY_SOURCE_TEMPLATE(Spreadsheet::SheetPython, Spreadsheet::Sheet) template<> const char* Spreadsheet::SheetPython::getViewProviderName(void) const { return "SpreadsheetGui::ViewProviderSheet"; } +template<> PyObject* Spreadsheet::SheetPython::getPyObject(void) { + if (PythonObject.is(Py::_None())) { + // ref counter is set to 1 + PythonObject = Py::Object(new FeaturePythonPyT(this),true); + } + return Py::new_reference_to(PythonObject); +} /// @endcond // explicit template instantiation