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

New commits:
commit f597c3a6eaa6b45f43b127b9b042442516ddc202
Author:     Heiko Tietze <[email protected]>
AuthorDate: Mon Mar 31 14:23:10 2025 +0200
Commit:     Heiko Tietze <[email protected]>
CommitDate: Mon Mar 31 15:50:25 2025 +0200

    Resolves tdf#101142 - Always use a white background for print preview
    
    Change-Id: Ib60ca1c5de5eb17008cc5ddc04ae4fccfe373b29
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183541
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <[email protected]>

diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index c7316a64c006..33e26e2718a6 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 45b5274fe083..37d18f532be1 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