diff options
author | Tibor Nagy <tibor.nagy.extern@allotropia.de> | 2024-02-28 11:13:10 +0100 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2024-03-04 02:09:14 +0100 |
commit | 2fc3251ef884ba75077126a631a55c9a51a47d1d (patch) | |
tree | 43555c350448b53dc42ef2fea6b95be18275d404 /vcl | |
parent | c56c426a369cd94ccf0de68d5036c666dc1a2e95 (diff) |
tdf#155218 sc: fix regression page orientation in print dialog
The print page orientation set in the Print Dialog displays incorrect
print area borders on the sheet after closing the Print Dialog or
interrupting the printing process.
The print dialog increase in size if the "Pages" and "All pages" radio
buttons are toggled many times.(problem is not reproduced on Windows)
regression was made by: I5e494a0714e398221bee00744d7e25c419a41df7
Includes "Read of uninitialized Printer::mbResetPrintArea" fixup by Stephan.
Change-Id: I5a0ab3d781b21eff575afaebb233237eff1827d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164085
Tested-by: Jenkins
Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164312
Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/print.cxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 10 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 7 |
3 files changed, 14 insertions, 4 deletions
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 98aca69aed5d..c77d175e44aa 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -450,6 +450,7 @@ void Printer::ImplInitData() mbNewJobSetup = false; mbSinglePrintJobs = false; mbUsePrintSetting = false; + mbResetPrintArea = false; mpInfoPrinter = nullptr; mpPrinter = nullptr; mpDisplayDev = nullptr; diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 5fb7b2b286d1..2df79a645a5b 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -514,7 +514,6 @@ bool Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController, PrintDialog aDlg(xController->getWindow(), xController); if (!aDlg.run()) { - xController->getPrinter()->SetUsePrintDialogSetting(false); xController->abortJob(); return false; } @@ -565,6 +564,7 @@ bool Printer::ExecutePrintJob(const std::shared_ptr<PrinterController>& xControl void Printer::FinishPrintJob(const std::shared_ptr<PrinterController>& xController) { + xController->resetPrintArea(); xController->resetPaperToLastConfigured(); xController->jobFinished( xController->getJobState() ); } @@ -1015,6 +1015,14 @@ void vcl::ImplPrinterControllerData::resetPaperToLastConfigured() mxPrinter->Pop(); } +// reset the print area created by the Print Dialog to the page style's print area. +void PrinterController::resetPrintArea() +{ + mpImplData->mxPrinter->ResetPrintArea(true); + mpImplData->mxPrinter->SetUsePrintDialogSetting(false); + getPageCount(); +} + int PrinterController::getPageCountProtected() const { const MapMode aMapMode( MapUnit::Map100thMM ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index ff3dd99dcaca..baa3483d550d 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1014,8 +1014,9 @@ void PrintDialog::updatePageRange(sal_Int32 nPages) { aBuf.append("-" + OUString::number(nPages)); } - maPController->setValue("PageRange", css::uno::Any(aBuf.makeStringAndClear())); - setupOptionalUI(); + OUString sRange = aBuf.makeStringAndClear(); + mxPageRangeEdit->set_text(sRange); + maPController->setValue("PageRange", Any(sRange)); } } @@ -2185,7 +2186,7 @@ IMPL_LINK( PrintDialog, UIOption_SpinModifyHdl, weld::SpinButton&, i_rBox, void IMPL_LINK( PrintDialog, UIOption_EntryModifyHdl, weld::Entry&, i_rBox, void ) { PropertyValue* pVal = getValueForWindow( &i_rBox ); - if( pVal ) + if( pVal && mxPageRangesRadioButton->get_active() ) { makeEnabled( &i_rBox ); |