SyntaxHighlighter: Fix foreground color for text without special highlighting

Authored by dhaumann on May 19 2019, 6:21 PM.

Description

SyntaxHighlighter: Fix foreground color for text without special highlighting

Summary:
QTextDocument seems to use the widget palette (or application
palette) when drawing text. That is, by default the palette's
foreground color is used when no special QTextCharFormat is
specified.

This patch changes applyFormat() such that the foreground color
is always set to avoid the fallback to the QPalette's foreground
color.

BUG: 406821
BUG: 406816
FIXED-IN: 5.59

Test Plan: make && make test + manual testing with the codeeditor example

Reviewers: vkrause, cullmann, kossebau

Reviewed By: cullmann

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: Kate, Frameworks

Differential Revision: https://phabricator.kde.org/D21295

Details