summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-11-09 13:37:33 +0200
committerAndras Timar <andras.timar@collabora.com>2022-03-15 12:47:40 +0100
commit22cb76ff45f3f4c9937167bfd12e03c04dba24b0 (patch)
tree86fecdbc7280a3c8121403fb40523acc6a8ba30b /vcl
parent093db6cfb8a34658dfb3f56af5c63d2473494d28 (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>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/printdlg.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 6ced03f53799..b2116e9e78e8 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -864,6 +864,7 @@ void PrintDialog::setPaperSizes()
VclPtr<Printer> aPrt( maPController->getPrinter() );
mePaper = aPrt->GetPaper();
+ Size aSizeOfPaper = aPrt->GetSizeOfPaper();
if ( isPrintToFile() )
{
@@ -902,8 +903,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 );