summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-11-09 13:37:33 +0200
committerTor Lillqvist <tml@collabora.com>2021-11-09 14:09:48 +0100
commit9a8dcf797dd277079e5b58947d7281645aa0389e (patch)
tree5c305accc712cf2cadedf02a90fe33a4c11be549 /vcl
parent1134aad621a96a23af88aaa50e10e328ea58a502 (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>
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 25f8483076c9..c7a8e50fa2c1 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -859,6 +859,7 @@ void PrintDialog::setPaperSizes()
VclPtr<Printer> aPrt( maPController->getPrinter() );
mePaper = aPrt->GetPaper();
+ Size aSizeOfPaper = aPrt->GetSizeOfPaper();
if ( isPrintToFile() )
{
@@ -897,8 +898,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 );