From 7249a87b069508444091e3a5453a3a6221285177 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 10 Sep 2020 13:40:09 +0200 Subject: [PATCH] Cleanup PageSize enum for Qt6 Fixes B5/B6 order and removes abandoned documentation for a removed duplicate. Change-Id: I7647ee31a4ef4aa754058c8a6f68b4d4304e0043 Reviewed-by: Volker Hilsheimer --- src/gui/painting/qpagedpaintdevice.cpp | 145 ------------------------- src/gui/painting/qpagesize.cpp | 8 +- src/gui/painting/qpagesize.h | 12 +- 3 files changed, 8 insertions(+), 157 deletions(-) diff --git a/src/gui/painting/qpagedpaintdevice.cpp b/src/gui/painting/qpagedpaintdevice.cpp index dba143b7e3..5e83144885 100644 --- a/src/gui/painting/qpagedpaintdevice.cpp +++ b/src/gui/painting/qpagedpaintdevice.cpp @@ -87,151 +87,6 @@ QPagedPaintDevicePrivate *QPagedPaintDevice::dd() return d; } -/*! - \enum QPagedPaintDevice::PageSize - - This enum type lists the available page sizes as defined in the Postscript - PPD standard. These values are duplicated in QPageSize and QPrinter and - those types and enum will be merged in Qt 6. - - The defined sizes are: - - \value A0 841 x 1189 mm - \value A1 594 x 841 mm - \value A2 420 x 594 mm - \value A3 297 x 420 mm - \value A4 210 x 297 mm, 8.26 x 11.69 inches - \value A5 148 x 210 mm - \value A6 105 x 148 mm - \value A7 74 x 105 mm - \value A8 52 x 74 mm - \value A9 37 x 52 mm - \value B0 1000 x 1414 mm - \value B1 707 x 1000 mm - \value B2 500 x 707 mm - \value B3 353 x 500 mm - \value B4 250 x 353 mm - \value B5 176 x 250 mm, 6.93 x 9.84 inches - \value B6 125 x 176 mm - \value B7 88 x 125 mm - \value B8 62 x 88 mm - \value B9 33 x 62 mm - \value B10 31 x 44 mm - \value C5E 163 x 229 mm - \value Comm10E 105 x 241 mm, U.S. Common 10 Envelope - \value DLE 110 x 220 mm - \value Executive 7.5 x 10 inches, 190.5 x 254 mm - \value Folio 210 x 330 mm - \value Ledger 431.8 x 279.4 mm - \value Legal 8.5 x 14 inches, 215.9 x 355.6 mm - \value Letter 8.5 x 11 inches, 215.9 x 279.4 mm - \value Tabloid 279.4 x 431.8 mm - \value Custom Unknown, or a user defined size. - \value A10 - \value A3Extra - \value A4Extra - \value A4Plus - \value A4Small - \value A5Extra - \value B5Extra - \value JisB0 - \value JisB1 - \value JisB2 - \value JisB3 - \value JisB4 - \value JisB5 - \value JisB6, - \value JisB7 - \value JisB8 - \value JisB9 - \value JisB10 - \value AnsiA = Letter - \value AnsiB = Ledger - \value AnsiC - \value AnsiD - \value AnsiE - \value LegalExtra - \value LetterExtra - \value LetterPlus - \value LetterSmall - \value TabloidExtra - \value ArchA - \value ArchB - \value ArchC - \value ArchD - \value ArchE - \value Imperial7x9 - \value Imperial8x10 - \value Imperial9x11 - \value Imperial9x12 - \value Imperial10x11 - \value Imperial10x13 - \value Imperial10x14 - \value Imperial12x11 - \value Imperial15x11 - \value ExecutiveStandard - \value Note - \value Quarto - \value Statement - \value SuperA - \value SuperB - \value Postcard - \value DoublePostcard - \value Prc16K - \value Prc32K - \value Prc32KBig - \value FanFoldUS - \value FanFoldGerman - \value FanFoldGermanLegal - \value EnvelopeB4 - \value EnvelopeB5 - \value EnvelopeB6 - \value EnvelopeC0 - \value EnvelopeC1 - \value EnvelopeC2 - \value EnvelopeC3 - \value EnvelopeC4 - \value EnvelopeC5 = C5E - \value EnvelopeC6 - \value EnvelopeC65 - \value EnvelopeC7 - \value EnvelopeDL = DLE - \value Envelope9 - \value Envelope10 = Comm10E - \value Envelope11 - \value Envelope12 - \value Envelope14 - \value EnvelopeMonarch - \value EnvelopePersonal - \value EnvelopeChou3 - \value EnvelopeChou4 - \value EnvelopeInvite - \value EnvelopeItalian - \value EnvelopeKaku2 - \value EnvelopeKaku3 - \value EnvelopePrc1 - \value EnvelopePrc2 - \value EnvelopePrc3 - \value EnvelopePrc4 - \value EnvelopePrc5 - \value EnvelopePrc6 - \value EnvelopePrc7 - \value EnvelopePrc8 - \value EnvelopePrc9 - \value EnvelopePrc10 - \value EnvelopeYou4 - \value LastPageSize = EnvelopeYou4 - \omitvalue NPageSize - \omitvalue NPaperSize - - Due to historic reasons QPageSize::Executive is not the same as the standard - Postscript and Windows Executive size, use QPageSize::ExecutiveStandard instead. - - The Postscript standard size QPageSize::Folio is different to the Windows - DMPAPER_FOLIO size, use the Postscript standard size QPageSize::FanFoldGermanLegal - if needed. -*/ - /*! \fn bool QPagedPaintDevice::newPage() diff --git a/src/gui/painting/qpagesize.cpp b/src/gui/painting/qpagesize.cpp index c8e1663d86..7ae3e93f5a 100644 --- a/src/gui/painting/qpagesize.cpp +++ b/src/gui/painting/qpagesize.cpp @@ -242,7 +242,7 @@ struct StandardPageSize { // NB! This table needs to be in sync with QPageSize::PageSizeId static const StandardPageSize qt_pageSizes[] = { - // Existing Qt sizes including ISO, US, ANSI and other standards + // Old Qt sizes including ISO, US, ANSI and other standards {QPageSize::Letter , DMPAPER_LETTER , QPageSize::Inch , 612, 792, 215.9, 279.4, 8.5 , 11 , "Letter"}, {QPageSize::Legal , DMPAPER_LEGAL , QPageSize::Inch , 612, 1008, 215.9, 355.6, 8.5 , 14 , "Legal"}, {QPageSize::Executive , DMPAPER_NONE , QPageSize::Inch , 540, 720, 190.5, 254 , 7.5 , 10 , "Executive.7.5x10in"}, // Qt size differs from Postscript / Windows @@ -256,9 +256,9 @@ static const StandardPageSize qt_pageSizes[] = { {QPageSize::A7 , DMPAPER_NONE , QPageSize::Millimeter, 210, 297, 74 , 105 , 2.91, 4.13, "A7"}, {QPageSize::A8 , DMPAPER_NONE , QPageSize::Millimeter, 148, 210, 52 , 74 , 2.05, 2.91, "A8"}, {QPageSize::A9 , DMPAPER_NONE , QPageSize::Millimeter, 105, 148, 37 , 52 , 1.46, 2.05, "A9"}, + {QPageSize::A10 , DMPAPER_NONE , QPageSize::Millimeter, 73, 105, 26 , 37 , 1.02, 1.46, "A10"}, {QPageSize::B0 , DMPAPER_NONE , QPageSize::Millimeter, 2835, 4008, 1000 , 1414 , 39.37, 55.67, "ISOB0"}, {QPageSize::B1 , DMPAPER_NONE , QPageSize::Millimeter, 2004, 2835, 707 , 1000 , 27.83, 39.37, "ISOB1"}, - {QPageSize::B10 , DMPAPER_NONE , QPageSize::Millimeter, 88, 125, 31 , 44 , 1.22, 1.73, "ISOB10"}, {QPageSize::B2 , DMPAPER_NONE , QPageSize::Millimeter, 1417, 2004, 500 , 707 , 19.68, 27.83, "ISOB2"}, {QPageSize::B3 , DMPAPER_NONE , QPageSize::Millimeter, 1001, 1417, 353 , 500 , 13.9 , 19.68, "ISOB3"}, {QPageSize::B4 , DMPAPER_ISO_B4 , QPageSize::Millimeter, 709, 1001, 250 , 353 , 9.84, 13.9 , "ISOB4"}, @@ -267,6 +267,7 @@ static const StandardPageSize qt_pageSizes[] = { {QPageSize::B7 , DMPAPER_NONE , QPageSize::Millimeter, 249, 354, 88 , 125 , 3.46, 4.92, "ISOB7"}, {QPageSize::B8 , DMPAPER_NONE , QPageSize::Millimeter, 176, 249, 62 , 88 , 2.44, 3.46, "ISOB8"}, {QPageSize::B9 , DMPAPER_NONE , QPageSize::Millimeter, 125, 176, 44 , 62 , 1.73, 2.44, "ISOB9"}, + {QPageSize::B10 , DMPAPER_NONE , QPageSize::Millimeter, 88, 125, 31 , 44 , 1.22, 1.73, "ISOB10"}, {QPageSize::C5E , DMPAPER_ENV_C5 , QPageSize::Millimeter, 459, 649, 162 , 229 , 6.38, 9.02, "EnvC5"}, {QPageSize::Comm10E , DMPAPER_ENV_10 , QPageSize::Inch , 297, 684, 104.8, 241.3, 4.12, 9.5 , "Env10"}, {QPageSize::DLE , DMPAPER_ENV_DL , QPageSize::Millimeter, 312, 624, 110 , 220 , 4.33, 8.66, "EnvDL"}, @@ -276,7 +277,6 @@ static const StandardPageSize qt_pageSizes[] = { {QPageSize::Custom , DMPAPER_USER , QPageSize::Millimeter, -1, -1, -1. , -1 , -1 , -1 , "Custom"}, // Special case to keep in sync with QPageSize::PageSizeId // ISO Standard Sizes - {QPageSize::A10 , DMPAPER_NONE , QPageSize::Millimeter, 73, 105, 26 , 37 , 1.02, 1.46, "A10"}, {QPageSize::A3Extra , DMPAPER_A3_EXTRA , QPageSize::Millimeter, 913, 1262, 322 , 445 , 12.67, 17.52, "A3Extra"}, {QPageSize::A4Extra , DMPAPER_A4_EXTRA , QPageSize::Millimeter, 667, 914, 235.5, 322.3, 9.27, 12.69, "A4Extra"}, {QPageSize::A4Plus , DMPAPER_A4_PLUS , QPageSize::Millimeter, 595, 936, 210 , 330 , 8.27, 13 , "A4Plus"}, @@ -1079,8 +1079,6 @@ QSize QPageSizePrivate::sizePixels(int resolution) const \value EnvelopePrc10 \value EnvelopeYou4 \value LastPageSize = EnvelopeYou4 - \omitvalue NPageSize - \omitvalue NPaperSize Due to historic reasons QPageSize::Executive is not the same as the standard Postscript and Windows Executive size, use QPageSize::ExecutiveStandard instead. diff --git a/src/gui/painting/qpagesize.h b/src/gui/painting/qpagesize.h index eece650f0f..1fa6c86081 100644 --- a/src/gui/painting/qpagesize.h +++ b/src/gui/painting/qpagesize.h @@ -59,7 +59,7 @@ class Q_GUI_EXPORT QPageSize public: enum PageSizeId { - // Existing Qt sizes + // Old Qt sizes Letter, Legal, Executive, @@ -73,17 +73,18 @@ public: A7, A8, A9, + A10, B0, B1, - B10, B2, B3, B4, - B6, B5, + B6, B7, B8, B9, + B10, C5E, Comm10E, DLE, @@ -93,7 +94,6 @@ public: Custom, // New values derived from PPD standard - A10, A3Extra, A4Extra, A4Plus, @@ -196,10 +196,8 @@ public: EnvelopePrc10, EnvelopeYou4, - // Last item, with commonly used synynoms + // Last item LastPageSize = EnvelopeYou4, - NPageSize = LastPageSize, - NPaperSize = LastPageSize, // Convenience overloads for naming consistency AnsiA = Letter,