[calculation] Display exact and approximate results

Change-Id: Id5fe5b5db464c45f09bd1a1285def95e738a78c7
This commit is contained in:
Émilie Feral
2017-10-27 17:30:03 +02:00
parent 6c51c584f2
commit 5fd8fda4b1
17 changed files with 273 additions and 22 deletions

View File

@@ -47,7 +47,12 @@ bool HistoryController::handleEvent(Ion::Events::Event event) {
if (subviewType == HistoryViewCell::SubviewType::Input) {
editController->insertTextBody(calculation->inputText());
} else {
editController->insertTextBody(calculation->outputText());
OutputExpressionsView::SubviewType outputSubviewType = selectedCell->outputView()->selectedSubviewType();
if (outputSubviewType == OutputExpressionsView::SubviewType::ExactOutput) {
editController->insertTextBody(calculation->exactOutputText());
} else {
editController->insertTextBody(calculation->approximateOutputText());
}
}
return true;
}
@@ -97,7 +102,12 @@ bool HistoryController::handleEvent(Ion::Events::Event event) {
if (subviewType == HistoryViewCell::SubviewType::Input) {
Clipboard::sharedClipboard()->store(calculation->inputText());
} else {
Clipboard::sharedClipboard()->store(calculation->outputText());
OutputExpressionsView::SubviewType outputSubviewType = selectedCell->outputView()->selectedSubviewType();
if (outputSubviewType == OutputExpressionsView::SubviewType::ExactOutput) {
Clipboard::sharedClipboard()->store(calculation->exactOutputText());
} else {
Clipboard::sharedClipboard()->store(calculation->approximateOutputText());
}
}
return true;
}