diff options
author | Tor Lillqvist <tml@collabora.com> | 2021-11-03 14:58:45 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2021-11-03 16:30:58 +0100 |
commit | 5f8b834eef1565a0523aabd6dd8af5f1b0fd4c75 (patch) | |
tree | 3949df13f18b80252c2b41f03a1a99dadc1c33bc | |
parent | 4bfe8304a5600e236043e4ad7c6dc75fd05c937b (diff) |
tdf#145354: Don't claim random paper sizes from the system are "User Defined"
For instance, the driver for my printer (or maybe Windows itself, no
idea where the list of sizes comes from originally) says it supports
215 x 345 mm. Which apparently is an obscure paper size called "India
Legal". It is confusing if the Print dialog claims that it is "User
Defined" when I have never even heard of such a size, and the document
does not specify it either.
Change-Id: I44196fd21fd83a94d255ebb909e5d63e35c5d1e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124649
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r-- | vcl/source/window/printdlg.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index bf4fdf1519eb..25f8483076c9 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * This file is part of the LibreOffice project. * @@ -886,7 +886,14 @@ void PrintDialog::setPaperSizes() OUString aWidth( rLocWrap.getNum( aLogicPaperSize.Width(), nDigits ) ); OUString aHeight( rLocWrap.getNum( aLogicPaperSize.Height(), nDigits ) ); OUString aUnit = eUnit == MapUnit::MapMM ? OUString("mm") : OUString("in"); - OUString aPaperName = Printer::GetPaperName( ePaper ) + " " + aWidth + aUnit + " x " + aHeight + aUnit; + OUString aPaperName; + + // Paper sizes that we don't know of but the system printer driver lists are not "User + // Defined". Displaying them as such is just confusing. + if (ePaper != PAPER_USER) + aPaperName = Printer::GetPaperName( ePaper ) + " "; + + aPaperName += aWidth + aUnit + " x " + aHeight + aUnit; mxPaperSizeBox->append_text(aPaperName); |