[apps/calculation/edit_expression_controller] view() does not return nullptr

This commit is contained in:
Ruben Dashyan
2019-09-30 11:38:48 +02:00
committed by Léa Saviot
parent 227c9a8d68
commit 59e6c9d324

View File

@@ -94,12 +94,10 @@ bool EditExpressionController::layoutFieldDidAbortEditing(::LayoutField * layout
void EditExpressionController::layoutFieldDidChangeSize(::LayoutField * layoutField) {
/* Reload the view only if the ExpressionField height actually changes, i.e.
* not if the height is already maximal and stays maximal. */
if (view()) {
bool newInputViewHeightIsMaximal = static_cast<ContentView *>(view())->expressionField()->heightIsMaximal();
if (!m_inputViewHeightIsMaximal || !newInputViewHeightIsMaximal) {
m_inputViewHeightIsMaximal = newInputViewHeightIsMaximal;
reloadView();
}
bool newInputViewHeightIsMaximal = static_cast<ContentView *>(view())->expressionField()->heightIsMaximal();
if (!m_inputViewHeightIsMaximal || !newInputViewHeightIsMaximal) {
m_inputViewHeightIsMaximal = newInputViewHeightIsMaximal;
reloadView();
}
}