Spreadsheet: get access to the sheet view from the view provider via Python

This commit is contained in:
wmayer
2021-11-13 21:43:58 +01:00
parent 43b3bfcb04
commit 7431bddea7
2 changed files with 18 additions and 1 deletions

View File

@@ -41,5 +41,10 @@ select(topLeft, bottomRight, flags): Select the specified range using the given
<UserDocu>Set the current active cell</UserDocu>
</Documentation>
</Methode>
<Methode Name="getView">
<Documentation>
<UserDocu>Get access to the sheet view</UserDocu>
</Documentation>
</Methode>
</PythonExport>
</GenerateModel>
</GenerateModel>

View File

@@ -94,6 +94,18 @@ PyObject* ViewProviderSpreadsheetPy::setCurrentIndex(PyObject* args)
return Py_None;
}
PyObject* ViewProviderSpreadsheetPy::getView(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
return nullptr;
ViewProviderSheet* vp = this->getViewProviderSheetPtr();
SheetView* sheetView = vp->getView();
if (sheetView)
return sheetView->getPyObject();
Py_RETURN_NONE;
}
PyObject *ViewProviderSpreadsheetPy::getCustomAttributes(const char* /*attr*/) const
{
return nullptr;