From 6f59466721d1d11d11da2c46f9e4092f65b14acf Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 8 Sep 2011 09:01:43 +0200 Subject: Fix regression in tst_qrawfont Change 4d8cd11179e6cca162efe650d308124dc7aefb14 broke QRawFont on Windows by removing some code. After the font has been renamed, we need to use the new font tables rather than the old ones for registering the font in the system. Reviewed-by: aavit --- src/gui/text/qrawfont_win.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qrawfont_win.cpp b/src/gui/text/qrawfont_win.cpp index ea1e75b..a729e31 100644 --- a/src/gui/text/qrawfont_win.cpp +++ b/src/gui/text/qrawfont_win.cpp @@ -578,7 +578,9 @@ void QRawFontPrivate::platformLoadFromData(const QByteArray &fontData, resolveGdi32(); if (ptrAddFontMemResourceEx && ptrRemoveFontMemResourceEx) { DWORD count = 0; - fontHandle = ptrAddFontMemResourceEx((void *)fontData.constData(), fontData.size(), 0, &count); + QByteArray newFontData = font.data(); + fontHandle = ptrAddFontMemResourceEx((void *)newFontData.constData(), newFontData.size(), + 0, &count); if (count == 0 && fontHandle != NULL) { ptrRemoveFontMemResourceEx(fontHandle); fontHandle = NULL; -- cgit v0.12