diff options
author | Tibor Nagy <tibor.nagy.extern@allotropia.de> | 2024-12-11 06:46:33 +0100 |
---|---|---|
committer | Nagy Tibor <tibor.nagy.extern@allotropia.de> | 2024-12-11 14:19:42 +0100 |
commit | cc65bec38ca26265ce8ecfd02110c26bcc62b79b (patch) | |
tree | 0ac63c6c94976c3a82c5aafdbbf789fa8fb0d83b /vcl | |
parent | d0bd11f45b75065185a6730b8f101aa5c5e441ea (diff) |
tdf#161541 sd: fix the orientation of handouts on the printed page
Change-Id: I1896674ab317fcbcfe2ebbe9ea21dcc36c203328
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178274
Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de>
Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/printdlg.cxx | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 46bd7df183f5..e194190a7d02 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -659,8 +659,6 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, std::shared_ptr<PrinterControl initFromMultiPageSetup( maPController->getMultipage() ); - updatePageSize(mxOrientationBox->get_active()); - // setup optional UI options set by application setupOptionalUI(); @@ -1207,23 +1205,10 @@ void PrintDialog::updateNup( bool i_bMayUseCache ) aMPS.aPaperSize = maNupPortraitSize; else // automatic mode { - updatePageSize(mxOrientationBox->get_active()); - Size aPrintPageSize = maPController->getPrinter()->GetPrintPageSize(); - // get size of first real page to see if it is portrait or landscape // we assume same page sizes for all the pages for this Size aPageSize = getJobPageSize(); - if ((aPageSize.Width() < aPageSize.Height() - && aPrintPageSize.Width() > aPrintPageSize.Height()) - || (aPageSize.Width() > aPageSize.Height() - && aPrintPageSize.Width() < aPrintPageSize.Height())) - { - tools::Long nTmp = aPageSize.Width(); - aPageSize.setWidth(aPageSize.Height()); - aPageSize.setHeight(nTmp); - } - Size aMultiSize( aPageSize.Width() * nCols, aPageSize.Height() * nRows ); if( aMultiSize.Width() > aMultiSize.Height() ) // fits better on landscape { @@ -1936,6 +1921,7 @@ IMPL_LINK(PrintDialog, ToggleHdl, weld::Toggleable&, rButton, void) { mxOrientationBox->set_sensitive( true ); mxOrientationBox->set_active( ORIENTATION_AUTOMATIC ); + updatePageSize(mxOrientationBox->get_active()); enableNupControls( true ); updateNupFromPages(); } @@ -2020,6 +2006,7 @@ IMPL_LINK( PrintDialog, SelectHdl, weld::ComboBox&, rBox, void ) maFirstPageSize = Size(); updateOrientationBox(); + updatePageSize(mxOrientationBox->get_active()); // update text fields mxOKButton->set_label(maPrintText); @@ -2037,10 +2024,10 @@ IMPL_LINK( PrintDialog, SelectHdl, weld::ComboBox&, rBox, void ) setPaperSizes(); updateOrientationBox(); + updatePageSize(mxOrientationBox->get_active()); maUpdatePreviewIdle.Start(); } - updatePageSize(mxOrientationBox->get_active()); setupPaperSidesBox(); } else if ( &rBox == mxPaperSidesBox.get() ) @@ -2084,10 +2071,6 @@ IMPL_LINK( PrintDialog, SelectHdl, weld::ComboBox&, rBox, void ) updatePageSize(mxOrientationBox->get_active()); - int nOrientation = mxOrientationBox->get_active(); - if (nOrientation != ORIENTATION_AUTOMATIC) - setPaperOrientation(static_cast<Orientation>(nOrientation - 1), true); - maUpdatePreviewNoCacheIdle.Start(); } } @@ -2219,6 +2202,8 @@ IMPL_LINK( PrintDialog, UIOption_SelectHdl, weld::ComboBox&, i_rBox, void ) checkOptionalControlDependencies(); + updatePageSize(mxOrientationBox->get_active()); + // update preview and page settings maUpdatePreviewNoCacheIdle.Start(); } |