From b7b8acbe1ece19b7fca6dd284d9f6854218c918c Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Thu, 30 Jan 2020 16:48:43 +1300 Subject: [PATCH] CellML Text view: slight improvement to our lexer. --- .../editing/CellMLTextView/src/cellmltextviewlexer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/editing/CellMLTextView/src/cellmltextviewlexer.cpp b/src/plugins/editing/CellMLTextView/src/cellmltextviewlexer.cpp index 9a9a10fbaf..e1760caf1b 100644 --- a/src/plugins/editing/CellMLTextView/src/cellmltextviewlexer.cpp +++ b/src/plugins/editing/CellMLTextView/src/cellmltextviewlexer.cpp @@ -132,11 +132,13 @@ QFont CellmlTextViewLexer::font(int pStyle) const void CellmlTextViewLexer::styleText(int pBytesStart, int pBytesEnd) { +#ifdef QT_DEBUG // Make sure that we have an editor if (editor() == nullptr) { - return; + qFatal("FATAL ERROR | %s:%d: styling can only be performed with an editor.", __FILE__, __LINE__); } +#endif // Retrieve the text to style