diff options
author | Oliver Specht <oliver.specht@cib.de> | 2016-05-13 16:26:42 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-05-20 07:27:38 +0000 |
commit | 247e418485c276bb9e8dcb84a6e11b90191482a3 (patch) | |
tree | 12d91c23091a04935457418ef16a1b4aa98474fd /sw | |
parent | debbf41208d1fabf7ede667fcafee285d7f22e14 (diff) |
tdf#64748: added placeholder option to pdf export dialog in Writer
This patch introduces a setting 'Export placeholders' to File/Export as PDF.
It works like the related printer setting.
Change-Id: I3a11a4601b1244b57e55c9b73b58116d355e105c
Reviewed-on: https://gerrit.libreoffice.org/24976
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Tested-by: Oliver Specht <oliver.specht@cib.de>
Reviewed-on: https://gerrit.libreoffice.org/25053
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/printdata.hxx | 2 | ||||
-rw-r--r-- | sw/inc/unotxdoc.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/view/printdata.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 20 |
4 files changed, 21 insertions, 7 deletions
diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 52710893ffdc..6651090b04fc 100644 --- a/sw/inc/printdata.hxx +++ b/sw/inc/printdata.hxx @@ -261,7 +261,7 @@ public: bool IsViewOptionAdjust() const { return m_pViewOptionAdjust != nullptr; } bool NeedNewViewOptionAdjust( const SwViewShell& ) const; void ViewOptionAdjustStart( SwViewShell &rSh, const SwViewOption &rViewOptions); - void ViewOptionAdjust( SwPrintData const* const pPrtOptions ); + void ViewOptionAdjust( SwPrintData const* const pPrtOptions, bool setShowPlaceHoldersInPDF ); void ViewOptionAdjustStop(); void ViewOptionAdjustCrashPreventionKludge(); diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 87386bbd193a..9435920efd38 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -607,7 +607,7 @@ class SwViewOptionAdjust_Impl public: SwViewOptionAdjust_Impl( SwViewShell& rSh, const SwViewOption &rViewOptions ); ~SwViewOptionAdjust_Impl(); - void AdjustViewOptions( SwPrintData const* const pPrtOptions ); + void AdjustViewOptions( SwPrintData const* const pPrtOptions, bool setShowPlaceHoldersInPDF ); bool checkShell( const SwViewShell& rCompare ) const { return &rCompare == m_pShell; } void DontTouchThatViewShellItSmellsFunny() { m_pShell = nullptr; } diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 009d8e40016b..7d335262d1cd 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -93,9 +93,9 @@ void SwRenderData::ViewOptionAdjustStart( new SwViewOptionAdjust_Impl( rSh, rViewOptions )); } -void SwRenderData::ViewOptionAdjust(SwPrintData const*const pPrtOptions) +void SwRenderData::ViewOptionAdjust(SwPrintData const*const pPrtOptions, bool setShowPlaceHoldersInPDF) { - m_pViewOptionAdjust->AdjustViewOptions( pPrtOptions ); + m_pViewOptionAdjust->AdjustViewOptions( pPrtOptions, setShowPlaceHoldersInPDF ); } void SwRenderData::ViewOptionAdjustStop() diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index d9432d6b5391..d08766ad3791 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -2545,7 +2545,21 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( // PDF export should not make use of the SwPrtOptions const SwPrintData *pPrtOptions = (bIsPDFExport) ? nullptr : m_pRenderData->GetSwPrtOptions(); - m_pRenderData->ViewOptionAdjust( pPrtOptions ); + bool setShowPlaceHoldersInPDF = false; + if(bIsPDFExport) + { + const sal_Int32 nLen = rxOptions.getLength(); + const beans::PropertyValue *pProps = rxOptions.getConstArray(); + for (sal_Int32 i = 0; i < nLen; ++i) + { + if (pProps[i].Name.equalsAscii( "ExportPlaceholders" )) + { + pProps[i].Value >>= setShowPlaceHoldersInPDF; + break; + } + } + } + m_pRenderData->ViewOptionAdjust( pPrtOptions, setShowPlaceHoldersInPDF ); } // since printing now also use the API for PDF export this option @@ -4248,7 +4262,7 @@ SwViewOptionAdjust_Impl::~SwViewOptionAdjust_Impl() } void -SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) +SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions, bool setShowPlaceHoldersInPDF) { // to avoid unnecessary reformatting the view options related to the content // below should only change if necessary, that is if respective content is present @@ -4285,7 +4299,7 @@ SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) if (bContainsPlaceHolders) { // should always be printed in PDF export! - bVal = !pPrtOptions || pPrtOptions->m_bPrintTextPlaceholder; + bVal = !pPrtOptions ? setShowPlaceHoldersInPDF : pPrtOptions->m_bPrintTextPlaceholder; aRenderViewOptions.SetShowPlaceHolderFields( bVal ); } |