OSDN Git Service

remove unused qSizeFTopaperSize() function
authorIvailo Monev <xakepa10@gmail.com>
Wed, 3 Feb 2021 00:23:16 +0000 (02:23 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 3 Feb 2021 00:23:16 +0000 (02:23 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/painting/qprinter.cpp

index 40a702e..c516c2d 100644 (file)
@@ -2090,26 +2090,6 @@ QSizeF qt_paperSizeToQSizeF(QPrinter::PaperSize size)
     return QSizeF(qt_paperSizes[size][0], qt_paperSizes[size][1]);
 }
 
-/*
-    Returns the PaperSize type that matches \a size, where \a size
-    is in millimeters.
-
-    Because dimensions may not always be completely accurate (for
-    example when converting between units), a particular PaperSize
-    will be returned if it matches within -1/+1 millimeters.
-*/
-QPrinter::PaperSize qSizeFTopaperSize(const QSizeF& size)
-{
-    for (int i = 0; i < static_cast<int>(QPrinter::NPaperSize); ++i) {
-        if (qt_paperSizes[i][0] >= size.width() - 1 &&
-                qt_paperSizes[i][0] <= size.width() + 1 &&
-                qt_paperSizes[i][1] >= size.height() - 1 &&
-                qt_paperSizes[i][1] <= size.height() + 1) {
-            return QPrinter::PaperSize(i);
-        }
-    }
-
-    return QPrinter::Custom;
 }
 
 QT_END_NAMESPACE