[escher] Handle copy/cut event on Expression in selectable table view

This commit is contained in:
Émilie Feral
2018-06-06 14:40:04 +02:00
parent 24c9549866
commit ac9da8d559
18 changed files with 43 additions and 52 deletions

View File

@@ -96,23 +96,6 @@ bool HistoryController::handleEvent(Ion::Events::Event event) {
app()->setFirstResponder(editController);
return true;
}
if (event == Ion::Events::Copy || event == Ion::Events::Cut) {
HistoryViewCell * selectedCell = (HistoryViewCell *)selectableTableView()->selectedCell();
HistoryViewCell::SubviewType subviewType = selectedCell->selectedSubviewType();
int focusRow = selectedRow();
Calculation * calculation = m_calculationStore->calculationAtIndex(focusRow);
if (subviewType == HistoryViewCell::SubviewType::Input) {
Clipboard::sharedClipboard()->store(calculation->inputText());
} else {
ScrollableExactApproximateExpressionsView::SubviewType outputSubviewType = selectedCell->outputView()->selectedSubviewType();
if (outputSubviewType == ScrollableExactApproximateExpressionsView::SubviewType::ExactOutput) {
Clipboard::sharedClipboard()->store(calculation->exactOutputText());
} else {
Clipboard::sharedClipboard()->store(calculation->approximateOutputText());
}
}
return true;
}
return false;
}