Fix build with -directwrite

There were several issues caught by GCC:
* deleting object of polymorphic class type which has non-virtual
  destructor might cause undefined behaviour
* comparison between signed and unsigned integer expressions
* 'GetUserDefaultLocaleName' was not declared in this scope
  (depends on WINVER >= 0x0600)

Change-Id: I39f2cc0d5e158f4d85377edd55e9f74a512c7303
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This commit is contained in:
Konstantin Ritt 2015-04-07 04:11:35 +04:00
parent 3a845e4b4f
commit 491b746473
2 changed files with 12 additions and 6 deletions

View File

@ -303,8 +303,7 @@ namespace {
, m_referenceCount(0) , m_referenceCount(0)
{ {
} }
virtual ~DirectWriteFontFileStream()
~DirectWriteFontFileStream()
{ {
} }
@ -355,7 +354,7 @@ namespace {
OUT void **fragmentContext) OUT void **fragmentContext)
{ {
*fragmentContext = NULL; *fragmentContext = NULL;
if (fragmentSize + fileOffset <= m_fontData.size()) { if (fileOffset + fragmentSize <= quint64(m_fontData.size())) {
*fragmentStart = m_fontData.data() + fileOffset; *fragmentStart = m_fontData.data() + fileOffset;
return S_OK; return S_OK;
} else { } else {
@ -384,8 +383,7 @@ namespace {
{ {
public: public:
DirectWriteFontFileLoader() : m_referenceCount(0) {} DirectWriteFontFileLoader() : m_referenceCount(0) {}
virtual ~DirectWriteFontFileLoader()
~DirectWriteFontFileLoader()
{ {
} }

View File

@ -33,6 +33,10 @@
#ifndef QT_NO_DIRECTWRITE #ifndef QT_NO_DIRECTWRITE
#if WINVER < 0x0600
# undef WINVER
# define WINVER 0x0600
#endif
#if _WIN32_WINNT < 0x0600 #if _WIN32_WINNT < 0x0600
#undef _WIN32_WINNT #undef _WIN32_WINNT
#define _WIN32_WINNT 0x0600 #define _WIN32_WINNT 0x0600
@ -61,10 +65,14 @@ namespace {
class GeometrySink: public IDWriteGeometrySink class GeometrySink: public IDWriteGeometrySink
{ {
public: public:
GeometrySink(QPainterPath *path) : m_path(path), m_refCount(0) GeometrySink(QPainterPath *path)
: m_refCount(0), m_path(path)
{ {
Q_ASSERT(m_path != 0); Q_ASSERT(m_path != 0);
} }
virtual ~GeometrySink()
{
}
IFACEMETHOD_(void, AddBeziers)(const D2D1_BEZIER_SEGMENT *beziers, UINT bezierCount); IFACEMETHOD_(void, AddBeziers)(const D2D1_BEZIER_SEGMENT *beziers, UINT bezierCount);
IFACEMETHOD_(void, AddLines)(const D2D1_POINT_2F *points, UINT pointCount); IFACEMETHOD_(void, AddLines)(const D2D1_POINT_2F *points, UINT pointCount);