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

New commits:
commit 2a0fa8b18afe6446b8e801a182ea0e8144291861
Author:     Mike Kaganski <[email protected]>
AuthorDate: Thu Feb 26 16:50:12 2026 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Thu Feb 26 21:48:57 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]>
    (cherry picked from commit b7957bf31e05dc55015e41c9dfcaa7e26b533eef)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200499
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 4e024c491a03..811e7abaecd5 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1079,7 +1079,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