diff options
author | Tibor Nagy <tibor.nagy.extern@allotropia.de> | 2024-02-28 11:13:10 +0100 |
---|---|---|
committer | Nagy Tibor <tibor.nagy.extern@allotropia.de> | 2024-02-29 01:36:08 +0100 |
commit | 364f0bb1cac0e12f5f926857f61c2f329a353ec7 (patch) | |
tree | 27ae9514609b90ec0c8e8170377200c8bb543751 /vcl/source/gdi | |
parent | 6a064b1967e06e40be40817deff99d00c1a8554f (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
Change-Id: I5a0ab3d781b21eff575afaebb233237eff1827d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164085
Tested-by: Jenkins
Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/print3.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index a43bc41599cd..6b15615f2bc9 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 ); |