From 4c7082162dd2192f535c1e524f966199883f53db Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Sun, 2 Mar 2014 01:52:52 +0200 Subject: Unify QFontEngine::getSfntTableData() behavior on all platforms Being a most significant method in the font API, getSfntTableData() must behave in exactly the same way on all platforms. Briefly, it must return true if the table exists in the font, despite the other params, and always stores the table data length in 'length' param, thus reporting the amount of bytes actually needed to store the table data in a buffer. Change-Id: I7a15465020c1ea818ea46a05ea3b9b7e1cd60d14 Reviewed-by: Lars Knoll --- src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp') diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp index 1c5e4508ac..158eee6b38 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp @@ -282,8 +282,8 @@ bool QWindowsFontEngineDirectWrite::getSfntTableData(uint tag, uchar *buffer, ui ret = true; if (buffer && *length >= tableSize) memcpy(buffer, tableData, tableSize); - else - *length = tableSize; + *length = tableSize; + Q_ASSERT(int(*length) > 0); } m_directWriteFontFace->ReleaseFontTable(tableContext); } else { -- cgit v1.2.3