diff --git a/src/musredit_qt6/musredit/PMsrHighlighter.cpp b/src/musredit_qt6/musredit/PMsrHighlighter.cpp index c4adbfda..cf134cfd 100644 --- a/src/musredit_qt6/musredit/PMsrHighlighter.cpp +++ b/src/musredit_qt6/musredit/PMsrHighlighter.cpp @@ -30,6 +30,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include + #include #include #include //as35 @@ -170,12 +172,13 @@ PMsrHighlighter::PMsrHighlighter(QTextDocument *parent) "Bessel", "internbsl", "internFldGK", "internFldLL", "F_mu_F", "abragam", "skewedGss", "staticNKZF", "staticNKTF", "dynamicNKZF", "dynamicNKTF", "muMinusExpTF", - "polynom"}; + "polynom", "userFcn"}; QStringList theory_keywords_short = {"c", "a", "se", "ge", + "sg", "stg", "sgktlf", "dgktlf", @@ -196,15 +199,15 @@ PMsrHighlighter::PMsrHighlighter(QTextDocument *parent) "ifgk", "ifll", "fmuf", - "ab" + "ab", "skg", "snkzf", "snktf", - "snkzf", "dnkzf", "dnktf", "mmsetf", - "p"}; + "p", + "u"}; // combine both theory keyword lists QStringList theory_keywords = theory_keywords_long + theory_keywords_short; @@ -457,7 +460,7 @@ PMsrHighlighter::PMsrHighlighter(QTextDocument *parent) * to the Qt layout interface engine. */ void PMsrHighlighter::addRule(const QStringList &keywords, - const QTextCharFormat formatting) { + const QTextCharFormat &formatting) { // Instantiate the HighlighingRule struct. HighlightingRule rule; @@ -488,7 +491,7 @@ void PMsrHighlighter::addRule(const QStringList &keywords, void PMsrHighlighter::highlightBlock(const QString &text) { // Sequentially process each entry stored inside the rules vector array. - for (const HighlightingRule &rule : highlightingRules) { + for (const HighlightingRule &rule : std::as_const(highlightingRules)) { // Execute a global search through the single block string provided. QRegularExpressionMatchIterator matchIterator = rule.pattern.globalMatch(text); diff --git a/src/musredit_qt6/musredit/PMsrHighlighter.h b/src/musredit_qt6/musredit/PMsrHighlighter.h index 2f14aa79..1ad25ce6 100644 --- a/src/musredit_qt6/musredit/PMsrHighlighter.h +++ b/src/musredit_qt6/musredit/PMsrHighlighter.h @@ -96,7 +96,7 @@ private: * @brief Helper function for passing formatting information to the * highlightingRules dynamic array. */ - void addRule(const QStringList &keywords, const QTextCharFormat formatting); + void addRule(const QStringList &keywords, const QTextCharFormat &formatting); QTextCharFormat blockFormat; ///< Formatting profile for BLOCK keywords. QTextCharFormat titleFormat; ///< Formatting profile for TITLE line.