sc/source/ui/view/preview.cxx     |    2 +-
 sw/source/uibase/uiview/pview.cxx |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 878219923ec07d5bf9003867833d77bd472d4e23
Author:     Heiko Tietze <[email protected]>
AuthorDate: Mon Mar 31 14:23:10 2025 +0200
Commit:     Adolfo Jayme Barrientos <[email protected]>
CommitDate: Thu Apr 3 06:07:54 2025 +0200

    Resolves tdf#101142 - Always use the real background for print preview
    
    while in dark mode the workspace area is dark, that is only for display 
purposes and the document isn't actually set to a dark background. The print 
preview previously used that theme/display color. Now it uses the actual color 
to match what you'd get in a PDF-export or when printing to paper.
    
    Change-Id: Ib60ca1c5de5eb17008cc5ddc04ae4fccfe373b29
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183541
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <[email protected]>
    (cherry picked from commit f597c3a6eaa6b45f43b127b9b042442516ddc202)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183581
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 4a96b4c61d6f..80f61b44d2ce 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -383,7 +383,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* 
pFillLocation )
         pPrintFunc->SetManualZoom(nZoom);
         pPrintFunc->SetDateTime(aDateTime);
         pPrintFunc->SetClearFlag(true);
-        pPrintFunc->SetUseStyleColor( 
officecfg::Office::Common::Accessibility::IsForPagePreviews::get() );
+        pPrintFunc->SetUseStyleColor(false); // tdf#101142 print preview 
should use a white background
 
         pPrintFunc->SetDrawView( pDrawView.get() );
 
diff --git a/sw/source/uibase/uiview/pview.cxx 
b/sw/source/uibase/uiview/pview.cxx
index 9811b027f586..77a6229bd1aa 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1109,6 +1109,10 @@ void SwPagePreview::Init()
     bool bIsModified = pESh != nullptr && pESh->IsModified();
 
     SwViewOption aOpt( *pPrefs );
+    // tdf#101142 print preview should use a white background
+    SwViewColors aColors( aOpt.GetColorConfig() );
+    aColors.m_aDocColor = COL_WHITE;
+    aOpt.SetColorConfig( aColors );
     aOpt.SetPagePreview(true);
     aOpt.SetTab( false );
     aOpt.SetBlank( false );

Reply via email to