diff options
-rw-r--r-- | filter/source/pdf/impdialog.cxx | 14 | ||||
-rw-r--r-- | filter/source/pdf/impdialog.hxx | 2 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 6 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.hxx | 1 | ||||
-rw-r--r-- | filter/source/pdf/pdffilter.cxx | 1 | ||||
-rw-r--r-- | filter/uiconfig/ui/pdfgeneralpage.ui | 27 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 6 | ||||
-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 |
11 files changed, 70 insertions, 15 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 73b93cdeec21..432f9e57ef20 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -84,6 +84,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(vcl::Window* pParent, Sequence< PropertyValue > mbExportOnlyNotesPages( false ), mbUseTransitionEffects( false ), mbIsSkipEmptyPages( true ), + mbIsExportPlaceholders( false ), mbAddStream( false ), mnFormsType( 0 ), mbExportFormFields( true ), @@ -201,6 +202,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(vcl::Window* pParent, Sequence< PropertyValue > mnOpenBookmarkLevels = maConfigItem.ReadInt32( "OpenBookmarkLevels", -1 ); mbUseTransitionEffects = maConfigItem.ReadBool( "UseTransitionEffects", true ); mbIsSkipEmptyPages = maConfigItem.ReadBool( "IsSkipEmptyPages", false ); + mbIsExportPlaceholders = maConfigItem.ReadBool( "ExportPlaceholders", false ); mbAddStream = maConfigItem.ReadBool( "IsAddStream", false ); mnFormsType = maConfigItem.ReadInt32( "FormsType", 0 ); @@ -409,6 +411,7 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() maConfigItem.WriteBool( "ExportHiddenSlides", mbExportHiddenSlides ); maConfigItem.WriteBool( "UseTransitionEffects", mbUseTransitionEffects ); maConfigItem.WriteBool( "IsSkipEmptyPages", mbIsSkipEmptyPages ); + maConfigItem.WriteBool( "ExportPlaceholders", mbIsExportPlaceholders ); maConfigItem.WriteBool( "IsAddStream", mbAddStream ); /* @@ -550,6 +553,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(vcl::Window* pParent, const SfxItemSe get(mpCbExportNotesPages, "notes"); get(mpCbExportOnlyNotesPages, "onlynotes"); get(mpCbExportEmptyPages, "emptypages"); + get(mpCbExportPlaceholders, "exportplaceholders" ); get(mpCbViewPDF, "viewpdf"); get(mpCbWatermark, "watermark"); @@ -589,6 +593,7 @@ void ImpPDFTabGeneralPage::dispose() mpCbExportNotesPages.clear(); mpCbExportOnlyNotesPages.clear(); mpCbExportEmptyPages.clear(); + mpCbExportPlaceholders.clear(); mpCbAddStream.clear(); mpCbWatermark.clear(); mpFtWatermark.clear(); @@ -616,6 +621,7 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( ImpPDFTabDialog* paParent ) mbIsWriter = paParent->mbIsWriter; mpCbExportEmptyPages->Enable( mbIsWriter ); + mpCbExportPlaceholders->Enable( mbIsWriter ); mpRbLosslessCompression->SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleCompressionHdl ) ); const bool bUseLosslessCompression = paParent->mbUseLosslessCompression; @@ -689,8 +695,13 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( ImpPDFTabDialog* paParent ) mpCbExportHiddenSlides->Show(false); mpCbExportHiddenSlides->Check(false); } - + mpCbExportPlaceholders->Show(mbIsWriter); + if( !mbIsWriter ) + { + mpCbExportPlaceholders->Check(false); + } mpCbExportEmptyPages->Check(!paParent->mbIsSkipEmptyPages); + mpCbExportPlaceholders->Check(paParent->mbIsExportPlaceholders); mpCbAddStream->Show(); mpCbAddStream->Check(paParent->mbAddStream); @@ -719,6 +730,7 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) paParent->mbExportHiddenSlides = mpCbExportHiddenSlides->IsChecked(); paParent->mbIsSkipEmptyPages = !mpCbExportEmptyPages->IsChecked(); + paParent->mbIsExportPlaceholders = mpCbExportPlaceholders->IsChecked(); paParent->mbAddStream = mpCbAddStream->IsVisible() && mpCbAddStream->IsChecked(); paParent->mbIsRangeChecked = false; diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 930772c91f0b..99e9a0fb3d81 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -108,6 +108,7 @@ protected: bool mbExportOnlyNotesPages; bool mbUseTransitionEffects; bool mbIsSkipEmptyPages; + bool mbIsExportPlaceholders; bool mbAddStream; sal_Int32 mnFormsType; bool mbExportFormFields; @@ -223,6 +224,7 @@ class ImpPDFTabGeneralPage : public SfxTabPage VclPtr<CheckBox> mpCbExportOnlyNotesPages; VclPtr<CheckBox> mpCbExportEmptyPages; + VclPtr<CheckBox> mpCbExportPlaceholders; VclPtr<CheckBox> mpCbAddStream; VclPtr<CheckBox> mpCbWatermark; diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 68e8624173ef..b7eb514f9f79 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -557,6 +557,8 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& rFilterData[ nData ].Value >>= maSignCertificate; else if ( rFilterData[ nData ].Name == "SignatureTSA" ) rFilterData[ nData ].Value >>= msSignTSA; + else if ( rFilterData[ nData ].Name == "ExportPlaceholders" ) + rFilterData[ nData ].Value >>= mbExportPlaceholders; } aContext.URL = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI); @@ -823,7 +825,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& pPDFExtOutDevData->SetIsReduceImageResolution( mbReduceImageResolution ); pPDFExtOutDevData->SetIsExportNamedDestinations( mbExportBmkToDest ); - Sequence< PropertyValue > aRenderOptions( 6 ); + Sequence< PropertyValue > aRenderOptions( 7 ); aRenderOptions[ 0 ].Name = "RenderDevice"; aRenderOptions[ 0 ].Value <<= Reference< awt::XDevice >( pXDevice ); aRenderOptions[ 1 ].Name = "ExportNotesPages"; @@ -837,6 +839,8 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& aRenderOptions[ 4 ].Value <<= mbSkipEmptyPages; aRenderOptions[ 5 ].Name = "PageRange"; aRenderOptions[ 5 ].Value <<= aPageRange; + aRenderOptions[ 6 ].Name = "ExportPlaceholders"; + aRenderOptions[ 6 ].Value <<= mbExportPlaceholders; if( !aPageRange.isEmpty() || !aSelection.hasValue() ) { diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx index 1b04b4669e17..c4c021f418eb 100644 --- a/filter/source/pdf/pdfexport.hxx +++ b/filter/source/pdf/pdfexport.hxx @@ -44,6 +44,7 @@ private: bool mbUseTaggedPDF; sal_Int32 mnPDFTypeSelection; bool mbExportNotes; + bool mbExportPlaceholders; bool mbViewPDF; bool mbExportNotesPages; bool mbExportOnlyNotesPages; diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx index e587ba12d152..cb07999e02e6 100644 --- a/filter/source/pdf/pdffilter.cxx +++ b/filter/source/pdf/pdffilter.cxx @@ -72,6 +72,7 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) aCfgItem.ReadBool( "UseTaggedPDF", false ); aCfgItem.ReadInt32( "SelectPdfVersion", 0 ); aCfgItem.ReadBool( "ExportNotes", false ); + aCfgItem.ReadBool( "ExportPlaceholders", false ); aCfgItem.ReadBool( "ExportNotesPages", false ); aCfgItem.ReadBool( "UseTransitionEffects", true ); aCfgItem.ReadBool( "IsSkipEmptyPages", false ); diff --git a/filter/uiconfig/ui/pdfgeneralpage.ui b/filter/uiconfig/ui/pdfgeneralpage.ui index 52314ac137f5..0cfa5c9d7e6f 100644 --- a/filter/uiconfig/ui/pdfgeneralpage.ui +++ b/filter/uiconfig/ui/pdfgeneralpage.ui @@ -578,8 +578,8 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="comments"> - <property name="label" translatable="yes">_Export comments</property> + <object class="GtkCheckButton" id="exportplaceholders"> + <property name="label" translatable="yes">Expo_rt placeholders</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -593,6 +593,21 @@ </packing> </child> <child> + <object class="GtkCheckButton" id="comments"> + <property name="label" translatable="yes">_Export comments</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">7</property> + </packing> + </child> + <child> <object class="GtkCheckButton" id="emptypages"> <property name="label" translatable="yes">Exp_ort automatically inserted blank pages</property> <property name="visible">True</property> @@ -604,7 +619,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">10</property> + <property name="top_attach">11</property> </packing> </child> <child> @@ -619,7 +634,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">11</property> + <property name="top_attach">12</property> </packing> </child> <child> @@ -649,7 +664,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">7</property> + <property name="top_attach">8</property> </packing> </child> <child> @@ -671,7 +686,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">8</property> + <property name="top_attach">9</property> </packing> </child> </object> diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 9c6e41892da8..a9097caa0b40 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -5134,6 +5134,12 @@ </info> <value>true</value> </prop> + <prop oor:name="ExportPlaceholders" oor:type="xs:boolean" oor:nillable="false"> + <info> + <desc>Specifies if placeholder fields are exported to PDF.</desc> + </info> + <value>true</value> + </prop> <prop oor:name="OpenBookmarkLevels" oor:type="xs:int" oor:nillable="false"> <info> <desc>Specifies how many bookmark levels should be opened in the diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx index 4f401fb9c7ed..b340e6b8640c 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 381a3566bb2d..8ab856777a4a 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -609,7 +609,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 ddbcaf7fcbf9..b64e65c578ce 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 d6efe1f79824..9616aff993a4 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -2565,7 +2565,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 @@ -4295,7 +4309,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 @@ -4332,7 +4346,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 ); } |