vcl/source/window/printdlg.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d91084990db9abe731e65209a72de4e5e6f12bad
Author:     Mike Kaganski <[email protected]>
AuthorDate: Thu Feb 26 16:50:12 2026 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Fri Feb 27 10:40:45 2026 +0100

    tdf#171041: avoid setting mbUsePrintSetting for automatic orientation
    
    Commit a67cd7b3cf03163f87811f7080cabc49750c4fd5 (tdf#155218 sc: fix
    different page orientation in print dialog, 2024-02-09) introduced
    Printer::SetUsePrintDialogSetting, used to change print settings to
    use what's configured in the dialog, instead of document.
    
    It was called unconditionally in PrintDialog::updatePageSize; but for
    automatic orientation, that breaks autodetection of the orientation
    in ScModelObj::getRenderer.
    
    This change only sets mbUsePrintSetting when the orientation in the
    dialog is not automatic.
    
    Change-Id: I0f7be0107e39e73bea8bc37a8f160f271f3242cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200456
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200562
    Tested-by: Mike Kaganski <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index e5a3f0f63f36..3ce1b87bdcd2 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1069,7 +1069,7 @@ void PrintDialog::updatePageSize(int nOrientation)
         aSize = getJobPageSize();
 
     aPrt->SetPrintPageSize(aSize);
-    aPrt->SetUsePrintDialogSetting(true);
+    aPrt->SetUsePrintDialogSetting(nOrientation != ORIENTATION_AUTOMATIC);
 }
 
 void PrintDialog::updateOrientationBox( const bool bAutomatic )

Reply via email to