Platform support/Windows classes: Use member initialization
Use C++ 11 member initialization in value-type structs. Task-number: QTBUG-51673 Change-Id: Ic45ab21c738ec7b7d526e30a1de2e19206da89ed Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
5ea88ae239
commit
fa4fb4ccf7
src/platformsupport/fontdatabases/windows
@ -591,12 +591,7 @@ namespace {
|
||||
*/
|
||||
|
||||
QWindowsFontEngineData::QWindowsFontEngineData()
|
||||
: clearTypeEnabled(false)
|
||||
, fontSmoothingGamma(QWindowsFontDatabase::fontSmoothingGamma())
|
||||
#if !defined(QT_NO_DIRECTWRITE)
|
||||
, directWriteFactory(0)
|
||||
, directWriteGdiInterop(0)
|
||||
#endif
|
||||
: fontSmoothingGamma(QWindowsFontDatabase::fontSmoothingGamma())
|
||||
{
|
||||
// from qapplication_win.cpp
|
||||
UINT result = 0;
|
||||
|
@ -74,12 +74,12 @@ public:
|
||||
|
||||
uint pow_gamma[256];
|
||||
|
||||
bool clearTypeEnabled;
|
||||
bool clearTypeEnabled = false;
|
||||
qreal fontSmoothingGamma;
|
||||
HDC hdc;
|
||||
HDC hdc = 0;
|
||||
#if !defined(QT_NO_DIRECTWRITE)
|
||||
IDWriteFactory *directWriteFactory;
|
||||
IDWriteGdiInterop *directWriteGdiInterop;
|
||||
IDWriteFactory *directWriteFactory = nullptr;
|
||||
IDWriteGdiInterop *directWriteGdiInterop = nullptr;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -248,21 +248,9 @@ QWindowsFontEngine::QWindowsFontEngine(const QString &name,
|
||||
: QFontEngine(Win),
|
||||
m_fontEngineData(fontEngineData),
|
||||
_name(name),
|
||||
hfont(0),
|
||||
m_logfont(lf),
|
||||
ttf(0),
|
||||
hasOutline(0),
|
||||
cmap(0),
|
||||
cmapSize(0),
|
||||
lbearing(SHRT_MIN),
|
||||
rbearing(SHRT_MIN),
|
||||
x_height(-1),
|
||||
synthesized_flags(-1),
|
||||
lineWidth(-1),
|
||||
widthCache(0),
|
||||
widthCacheSize(0),
|
||||
designAdvances(0),
|
||||
designAdvancesSize(0)
|
||||
hasOutline(0)
|
||||
{
|
||||
qCDebug(lcQpaFonts) << __FUNCTION__ << name << lf.lfHeight;
|
||||
hfont = CreateFontIndirect(&m_logfont);
|
||||
|
@ -145,29 +145,29 @@ private:
|
||||
|
||||
const QString _name;
|
||||
QString uniqueFamilyName;
|
||||
HFONT hfont;
|
||||
HFONT hfont = 0;
|
||||
const LOGFONT m_logfont;
|
||||
uint ttf : 1;
|
||||
uint hasOutline : 1;
|
||||
uint hasUnreliableOutline : 1;
|
||||
uint cffTable : 1;
|
||||
TEXTMETRIC tm;
|
||||
const unsigned char *cmap;
|
||||
int cmapSize;
|
||||
const unsigned char *cmap = nullptr;
|
||||
int cmapSize = 0;
|
||||
QByteArray cmapTable;
|
||||
mutable qreal lbearing;
|
||||
mutable qreal rbearing;
|
||||
mutable qreal lbearing = SHRT_MIN;
|
||||
mutable qreal rbearing = SHRT_MIN;
|
||||
QFixed designToDevice;
|
||||
int unitsPerEm;
|
||||
QFixed x_height;
|
||||
int unitsPerEm = 0;
|
||||
QFixed x_height = -1;
|
||||
FaceId _faceId;
|
||||
|
||||
mutable int synthesized_flags;
|
||||
mutable QFixed lineWidth;
|
||||
mutable unsigned char *widthCache;
|
||||
mutable uint widthCacheSize;
|
||||
mutable QFixed *designAdvances;
|
||||
mutable int designAdvancesSize;
|
||||
mutable int synthesized_flags = -1;
|
||||
mutable QFixed lineWidth = -1;
|
||||
mutable unsigned char *widthCache = nullptr;
|
||||
mutable uint widthCacheSize = 0;
|
||||
mutable QFixed *designAdvances = nullptr;
|
||||
mutable int designAdvancesSize = 0;
|
||||
};
|
||||
|
||||
class QWindowsMultiFontEngine : public QFontEngineMulti
|
||||
|
@ -110,9 +110,7 @@ static inline HBITMAP createDIB(HDC hdc, int width, int height,
|
||||
|
||||
QWindowsNativeImage::QWindowsNativeImage(int width, int height,
|
||||
QImage::Format format) :
|
||||
m_hdc(createDC()),
|
||||
m_bitmap(0),
|
||||
m_null_bitmap(0)
|
||||
m_hdc(createDC())
|
||||
{
|
||||
if (width != 0 && height != 0) {
|
||||
uchar *bits;
|
||||
|
@ -80,8 +80,8 @@ private:
|
||||
const HDC m_hdc;
|
||||
QImage m_image;
|
||||
|
||||
HBITMAP m_bitmap;
|
||||
HBITMAP m_null_bitmap;
|
||||
HBITMAP m_bitmap = 0;
|
||||
HBITMAP m_null_bitmap = 0;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
Loading…
Reference in New Issue
Block a user