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

Method maskSelection

src/frontend/spreadsheet/SpreadsheetView.cpp:2049–2079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2047}
2048
2049void SpreadsheetView::maskSelection() {
2050 int first = firstSelectedRow();
2051 if (first < 0)
2052 return;
2053 int last = lastSelectedRow();
2054
2055 WAIT_CURSOR;
2056 m_spreadsheet->beginMacro(i18n("%1: mask selected cells", m_spreadsheet->name()));
2057
2058 // suppress the data changed signal in all selected columns, will be emitted once per column at the end
2059 const auto& columns = selectedColumns(false);
2060 for (auto* column : columns)
2061 column->setSuppressDataChangedSignal(true);
2062
2063 // mask the selected cells
2064 for (auto* column : columns) {
2065 int col = m_spreadsheet->indexOfChild<Column>(column);
2066 for (int row = first; row <= last; row++)
2067 if (isCellSelected(row, col))
2068 column->setMasked(row);
2069
2070 column->setSuppressDataChangedSignal(false);
2071 column->setChanged();
2072 }
2073
2074 // some cells were masked, enable the "clear masks" action
2075 action_clear_masks->setEnabled(true);
2076
2077 m_spreadsheet->endMacro();
2078 RESET_CURSOR;
2079}
2080
2081void SpreadsheetView::unmaskSelection() {
2082 int first = firstSelectedRow();

Callers

nothing calls this directly

Calls 7

beginMacroMethod · 0.80
setMaskedMethod · 0.80
endMacroMethod · 0.80
nameMethod · 0.45
setChangedMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected