Improve padding hole issues in QAbstractPrintDialogPrivate

Placing a boolean between two pointers means we'll have a 7-byte padding
hole (64-bit). So move it to the bottom of the class, consuming the tail
padding that needs to be there anyway on 64-bit systems.

On 32-bit Unix systems, the better place would be at the top, as the
parent class (QDialogPrivate) has a 3-byte tail padding. But that's
fragile, as QDialogPrivate can change, doesn't apply to MSVC's ABI and
doesn't gain us anything on 64-bit.

Change-Id: I3840d727dee443318644fffd1528e4f05f4142bd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Thiago Macieira 2018-04-25 22:23:14 -07:00
parent 7c3053b301
commit 26e3dfd4ab

View File

@ -69,16 +69,15 @@ class QAbstractPrintDialogPrivate : public QDialogPrivate
public:
QAbstractPrintDialogPrivate()
: printer(nullptr), pd(nullptr), ownsPrinter(false)
: printer(nullptr), pd(nullptr)
, options(QAbstractPrintDialog::PrintToFile | QAbstractPrintDialog::PrintPageRange |
QAbstractPrintDialog::PrintCollateCopies | QAbstractPrintDialog::PrintShowPageSize),
minPage(0), maxPage(INT_MAX)
minPage(0), maxPage(INT_MAX), ownsPrinter(false)
{
}
QPrinter *printer;
QPrinterPrivate *pd;
bool ownsPrinter;
QPointer<QObject> receiverToDisconnectOnClose;
QByteArray memberToDisconnectOnClose;
@ -88,6 +87,8 @@ public:
void setPrinter(QPrinter *newPrinter);
int minPage;
int maxPage;
bool ownsPrinter;
};
QT_END_NAMESPACE