! adds a new Spreadsheet to the project. */
| 1980 | adds a new Spreadsheet to the project. |
| 1981 | */ |
| 1982 | void MainWin::newSpreadsheet() { |
| 1983 | auto* spreadsheet = new Spreadsheet(i18n("Spreadsheet")); |
| 1984 | |
| 1985 | // if the current active window is a workbook or one of its children, |
| 1986 | // add the new matrix to the workbook |
| 1987 | auto* workbook = dynamic_cast<Workbook*>(m_currentAspect); |
| 1988 | if (!workbook) |
| 1989 | workbook = static_cast<Workbook*>(m_currentAspect->parent(AspectType::Workbook)); |
| 1990 | |
| 1991 | if (workbook) |
| 1992 | workbook->addChild(spreadsheet); |
| 1993 | else |
| 1994 | this->addAspectToProject(spreadsheet); |
| 1995 | } |
| 1996 | |
| 1997 | /*! |
| 1998 | adds a new Matrix to the project. |
nothing calls this directly
no test coverage detected