From d0525e56abc7f85f9e38e3e9ba070317adfa06f1 Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Tue, 7 Jul 2015 12:08:33 +0200 Subject: Related tdf#91362: disable paper size & orientation selection Unless 'Use only papersize from printer prefs' is toggled on, whatever the user sets here doesn't have any effect on the actual printing (page settings from the document are used instead). It is misleading to have the user believe otherwise. It was really challenging to have this one toggle get all the way down through several layers of abstraction, though ... Change-Id: If240084ca23b3946a92882a6ee47dbc161b3b86c Reviewed-on: https://gerrit.libreoffice.org/16822 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna --- vcl/generic/print/genprnpsp.cxx | 1 + vcl/generic/print/prtsetup.cxx | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'vcl/generic') diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx index 425b71764b0e..6f4a9075052a 100644 --- a/vcl/generic/print/genprnpsp.cxx +++ b/vcl/generic/print/genprnpsp.cxx @@ -560,6 +560,7 @@ bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup ) SetData( ~0, pJobSetup ); JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, aInfo ); } + aInfo.m_bPapersizeFromSetup = pJobSetup->mbPapersizeFromSetup; if (SetupPrinterDriver(aInfo)) { diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx index 41fd69c5fa32..8a5fd70c82f6 100644 --- a/vcl/generic/print/prtsetup.cxx +++ b/vcl/generic/print/prtsetup.cxx @@ -256,6 +256,14 @@ void RTSPaperPage::update() m_pSlotText->Enable( false ); m_pSlotBox->Enable( false ); } + + // disable those, unless user wants to use papersize from printer prefs + // as they have no influence on what's going to be printed anyway + if (!m_pParent->m_aJobData.m_bPapersizeFromSetup) + { + m_pPaperBox->Enable( false ); + m_pOrientBox->Enable( false ); + } } IMPL_LINK( RTSPaperPage, SelectHdl, ListBox*, pBox ) -- cgit v1.2.3