diff options
author | Tor Lillqvist <tml@collabora.com> | 2021-11-09 13:37:33 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-11-10 12:19:34 +0100 |
commit | efff6686073c458864d807e72f733ac32ba8e817 (patch) | |
tree | a2f8f3b311cb146fbb68655a41d61bed83384d26 | |
parent | 724920d6074abdba210436c625329e395ae1b238 (diff) |
tdf#145354: Don't let an arbitrary paper size match any other arbitrary size
Don't preselect whatever random paper size the printer driver offers
last if the document is asking for some other random paper size.
Change-Id: I57af245f28f0d61541da698844f2527be5ec004e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124911
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124926
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | vcl/source/window/printdlg.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 413cf86a8bbc..9b7a7cebf793 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -850,6 +850,7 @@ void PrintDialog::setPaperSizes() VclPtr<Printer> aPrt( maPController->getPrinter() ); mePaper = aPrt->GetPaper(); + Size aSizeOfPaper = aPrt->GetSizeOfPaper(); if ( isPrintToFile() ) { @@ -888,8 +889,9 @@ void PrintDialog::setPaperSizes() mxPaperSizeBox->append_text(aPaperName); - if ( ePaper == mePaper ) - mxPaperSizeBox->set_active( nPaper ); + if ( (ePaper != PAPER_USER && ePaper == mePaper) || + (ePaper == PAPER_USER && aInfo.sloppyEqual( PaperInfo(aSizeOfPaper.getWidth(), aSizeOfPaper.getHeight())) ) ) + mxPaperSizeBox->set_active( nPaper ); } mxPaperSizeBox->set_sensitive( true ); |