MCPcopy Create free account
hub / github.com/KDE/labplot / newSpreadsheet

Method newSpreadsheet

src/frontend/MainWin.cpp:1982–1995  ·  view source on GitHub ↗

! adds a new Spreadsheet to the project. */

Source from the content-addressed store, hash-verified

1980 adds a new Spreadsheet to the project.
1981*/
1982void 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.

Callers

nothing calls this directly

Calls 3

addAspectToProjectMethod · 0.95
parentMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected