From 2d245f81944b4b03db47323d5c261108b79bc76a Mon Sep 17 00:00:00 2001 From: Leandro Melo <leandro.melo@nokia.com> Date: Mon, 11 Oct 2010 16:48:05 +0200 Subject: [PATCH] Generic highlighter: Fix autotest. Reviewed-by: Bill King --- .../highlighterengine/syntaxhighlighter.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h b/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h index c1355d8ce37..d8ce7728705 100644 --- a/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h +++ b/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h @@ -31,13 +31,24 @@ #define SYNTAXHIGHLIGHTER_H // Replaces the "real" syntaxhighlighter.h file. The scope of this test is restricted to the -// highlight definition's context engine. Using QSyntaxHighlighter as a base instead of the -// real TextEditor::SyntaxHighlighter should not affect it. +// highlight definition's context engine. Using a mock derived from QSyntaxHighlighter as a +// base instead of the real TextEditor::SyntaxHighlighter should not affect it. #include <QtGui/QSyntaxHighlighter> namespace TextEditor { - typedef QSyntaxHighlighter SyntaxHighlighter; + +class SyntaxHighlighter : public QSyntaxHighlighter +{ +public: + SyntaxHighlighter(QTextDocument *parent) : QSyntaxHighlighter(parent) {} + virtual ~SyntaxHighlighter() {} + +protected: + void SyntaxHighlighter::applyFormatToSpaces(const QString &, const QTextCharFormat &) + {} +}; + } #endif //SYNTAXHIGHLIGHTER_H -- GitLab