diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-04-16 22:09:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-18 07:45:19 +0200 |
commit | 13e3f269fd0cbebaded595416fc8fe907fbdc730 (patch) | |
tree | 4be1f5f431e3c86bb0f43dae0042e42098fa5080 | |
parent | 4e4b2d67010f1fc90a0227c36adab56a3e1ce679 (diff) |
QPrintDialog - Fix Mac reference counting error.
"key" is accessed with a "Get" function and should
not be released. Switch from using QCFString to a
CFStringsRef.
Change-Id: Id4eecc642de8698314fc57d44af05c202966b11c
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: John Layt <jlayt@kde.org>
-rw-r--r-- | src/printsupport/dialogs/qprintdialog_mac.mm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm index 33a11cc079..ef3e88be39 100644 --- a/src/printsupport/dialogs/qprintdialog_mac.mm +++ b/src/printsupport/dialogs/qprintdialog_mac.mm @@ -160,13 +160,13 @@ QT_USE_NAMESPACE PMOrientation orientation; PMGetOrientation(pageFormat, &orientation); QPageSize pageSize; - QCFString key; + CFStringRef key; double width = 0; double height = 0; // If the PPD name is empty then is custom, for some reason PMPaperIsCustom doesn't work here PMPaperGetPPDPaperName(paper, &key); if (PMPaperGetWidth(paper, &width) == noErr && PMPaperGetHeight(paper, &height) == noErr) { - QString ppdKey = key; + QString ppdKey = QString::fromCFString(key); if (ppdKey.isEmpty()) { // Is using a custom page size as defined in the Print Dialog custom settings using mm or inches. // We can't ask PMPaper what those units actually are, we can only get the point size which may return @@ -185,7 +185,7 @@ QT_USE_NAMESPACE pageSize = QPageSize(QSizeF(w / 100.0, h / 100.0), QPageSize::Inch); } } else { - pageSize = QPlatformPrintDevice::createPageSize(key, QSize(width, height), QString()); + pageSize = QPlatformPrintDevice::createPageSize(ppdKey, QSize(width, height), QString()); } } if (pageSize.isValid() && !pageSize.isEquivalentTo(printer->pageLayout().pageSize())) |