[Libreoffice-commits] core.git: sw/inc sw/source
Daniel
danielfaleirosilva at gmail.com
Sun May 6 23:11:48 UTC 2018
sw/inc/viewsh.hxx | 5 +++--
sw/source/core/view/vprint.cxx | 13 +++++++------
sw/source/uibase/uno/unotxdoc.cxx | 2 +-
3 files changed, 11 insertions(+), 9 deletions(-)
New commits:
commit 08441d466dd70c203a519a133aaf1a5997adbbd3
Author: Daniel <danielfaleirosilva at gmail.com>
Date: Tue May 1 16:22:33 2018 -0300
tdf#113866 print text in black print option doest not affect PDF export
Change-Id: Ie328e3a8246e1c2c818af1b9cc4d59e2e711a041
Reviewed-on: https://gerrit.libreoffice.org/53716
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Heiko Tietze <tietze.heiko at gmail.com>
Tested-by: Heiko Tietze <tietze.heiko at gmail.com>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index afe420ac43be..1996cce7f40e 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -162,7 +162,7 @@ class SW_DLLPUBLIC SwViewShell : public sw::Ring<SwViewShell>
SAL_DLLPRIVATE bool CheckInvalidForPaint( const SwRect & ); // Direct Paint or rather
// trigger an action.
- SAL_DLLPRIVATE void PrepareForPrint( const SwPrintData &rOptions );
+ SAL_DLLPRIVATE void PrepareForPrint( const SwPrintData &rOptions, bool bIsPDFExport = false );
SAL_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption &rOpt );
@@ -346,7 +346,8 @@ public:
// bIsPDFExport == true is: do PDF Export (no printing!)
bool PrintOrPDFExport( OutputDevice *pOutDev,
SwPrintData const& rPrintData,
- sal_Int32 nRenderer /* offset in vector of pages to print */ );
+ sal_Int32 nRenderer, /* offset in vector of pages to print */
+ bool bIsPDFExport );
// Printing of one brochure page.
void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData,
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 42afa4f016b8..96f94a03a4a8 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -445,7 +445,8 @@ sw_getPage(SwRootFrame const& rLayout, sal_Int32 const nPage)
bool SwViewShell::PrintOrPDFExport(
OutputDevice *pOutDev,
SwPrintData const& rPrintData,
- sal_Int32 nRenderer /* the index in the vector of pages to be printed */ )
+ sal_Int32 nRenderer, /* the index in the vector of pages to be printed */
+ bool bIsPDFExport )
{
// CAUTION: Do also always update the printing routines in viewpg.cxx (PrintProspect)!
@@ -510,8 +511,7 @@ bool SwViewShell::PrintOrPDFExport(
// save options at draw view:
SwDrawViewSave aDrawViewSave( pShell->GetDrawView() );
-
- pShell->PrepareForPrint( rPrintData );
+ pShell->PrepareForPrint( rPrintData, bIsPDFExport );
const sal_Int32 nPage = rPrintData.GetRenderData().GetPagesToPrint()[ nRenderer ];
OSL_ENSURE( nPage < 0 ||
@@ -683,14 +683,15 @@ SwDrawViewSave::~SwDrawViewSave()
}
// OD 09.01.2003 #i6467# - method also called for page preview
-void SwViewShell::PrepareForPrint( const SwPrintData &rOptions )
+void SwViewShell::PrepareForPrint( const SwPrintData &rOptions, bool bIsPDFExport )
{
mpOpt->SetGraphic ( rOptions.m_bPrintGraphic );
mpOpt->SetTable ( rOptions.m_bPrintTable );
- mpOpt->SetDraw ( rOptions.m_bPrintDraw );
+ mpOpt->SetDraw ( rOptions.m_bPrintDraw );
mpOpt->SetControl ( rOptions.m_bPrintControl );
mpOpt->SetPageBack ( rOptions.m_bPrintPageBackground );
- mpOpt->SetBlackFont( rOptions.m_bPrintBlackFont );
+ // Font should not be balck if it's a PDF Export
+ mpOpt->SetBlackFont( rOptions.m_bPrintBlackFont && !bIsPDFExport );
if ( HasDrawView() )
{
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index ee6165166310..0a22921c96e6 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3058,7 +3058,7 @@ void SAL_CALL SwXTextDocument::render(
if (bPrintProspect)
pVwSh->PrintProspect( pOut, rSwPrtOptions, nRenderer );
else // normal printing and PDF export
- pVwSh->PrintOrPDFExport( pOut, rSwPrtOptions, nRenderer );
+ pVwSh->PrintOrPDFExport( pOut, rSwPrtOptions, nRenderer, bIsPDFExport );
// #i35176#
More information about the Libreoffice-commits
mailing list