From 1b90af74dd1c4c72aac141defb03b9033504243a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 17 Jan 2024 15:53:40 +0100 Subject: [PATCH] Fix build with -no-directwrite QWindowsFontDatabaseBase::invalidate() was defined inside an the declaration was not. Since the font file loader is only protected by QT_CONFIG(directwrite), we move it out from the previous block and add an #if for the contents instead. Change-Id: Iedc02cceb15fe3d25d21b49af1486659a4d6373b Reviewed-by: Volker Hilsheimer (cherry picked from commit 0d1ac449bbc38aee4341dd47189de901860d7870) Reviewed-by: Qt Cherry-pick Bot --- src/gui/text/windows/qwindowsfontdatabasebase.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/text/windows/qwindowsfontdatabasebase.cpp b/src/gui/text/windows/qwindowsfontdatabasebase.cpp index a1c400ee9b0..cef739201bf 100644 --- a/src/gui/text/windows/qwindowsfontdatabasebase.cpp +++ b/src/gui/text/windows/qwindowsfontdatabasebase.cpp @@ -710,6 +710,13 @@ QFont QWindowsFontDatabaseBase::systemDefaultFont() return systemFont; } +void QWindowsFontDatabaseBase::invalidate() +{ +#if QT_CONFIG(directwrite) + m_fontFileLoader.reset(nullptr); +#endif +} + #if QT_CONFIG(directwrite) && QT_CONFIG(direct2d) IDWriteFontFace *QWindowsFontDatabaseBase::createDirectWriteFace(const QByteArray &fontData) { @@ -719,11 +726,6 @@ IDWriteFontFace *QWindowsFontDatabaseBase::createDirectWriteFace(const QByteArra return faces.isEmpty() ? nullptr : faces.first(); } -void QWindowsFontDatabaseBase::invalidate() -{ - m_fontFileLoader.reset(nullptr); -} - QList QWindowsFontDatabaseBase::createDirectWriteFaces(const QByteArray &fontData, bool queryVariations) const {