filter/source/pdf/pdfexport.cxx | 18 ++++-------------- filter/source/pdf/pdfexport.hxx | 3 +-- 2 files changed, 5 insertions(+), 16 deletions(-)
New commits: commit e0a22b55c979edf703d42ea40a4b8b607e4ad24d Author: Julien Nabet <serval2...@yahoo.fr> Date: Mon Dec 28 17:32:19 2015 +0100 tdf#65439: Export to PDF/A-1a gives transparency warning There was a use of transparency because Watermark was always defined Now we test if text of Watermark is empty or not Remark: it seems we don't cope not-text Watermark in pdf export (additional cleaning+renaming) Change-Id: I9d9c759a80c0a61e4f0a94c0fa295f2950caa3bc Reviewed-on: https://gerrit.libreoffice.org/20990 Tested-by: Jenkins <c...@libreoffice.org> Tested-by: Jan-Marek Glogowski <glo...@fbihome.de> Reviewed-by: Michael Stahl <mst...@redhat.com> (cherry picked from commit 5c5017ea37e1bee205c6c1b9cafe753fcaf1a9a4) Reviewed-on: https://gerrit.libreoffice.org/21398 diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 7c065a4..daf4689 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -115,7 +115,6 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc, mbAllowDuplicateFieldNames ( false ), mnProgressValue ( 0 ), mbRemoveTransparencies ( false ), - mbWatermark ( false ), mbHideViewerToolbar ( false ), mbHideViewerMenubar ( false ), @@ -503,10 +502,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& else if ( rFilterData[ nData ].Name == "IsAddStream" ) rFilterData[ nData ].Value >>= mbAddStream; else if ( rFilterData[ nData ].Name == "Watermark" ) - { - maWatermark = rFilterData[ nData ].Value; - mbWatermark = true; - } + rFilterData[ nData ].Value >>= msWatermark; //now all the security related properties... else if ( rFilterData[ nData ].Name == "EncryptFile" ) rFilterData[ nData ].Value >>= mbEncrypt; @@ -1032,7 +1028,7 @@ bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData& rPDFExtOutDevData.ResetSyncData(); - if( mbWatermark ) + if (!msWatermark.isEmpty()) ImplWriteWatermark( rWriter, aSizePDF ); return bRet; @@ -1042,7 +1038,6 @@ bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData& void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSize ) { - OUString aText( "Watermark" ); vcl::Font aFont( OUString( "Helvetica" ), Size( 0, 3*rPageSize.Height()/4 ) ); aFont.SetItalic( ITALIC_NONE ); aFont.SetWidthType( WIDTH_NORMAL ); @@ -1055,18 +1050,13 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi aFont.SetOrientation( 2700 ); } - if( ! ( maWatermark >>= aText ) ) - { - // more complicated watermark ? - } - // adjust font height for text to fit OutputDevice* pDev = rWriter.GetReferenceDevice(); pDev->Push( PushFlags::ALL ); pDev->SetFont( aFont ); pDev->SetMapMode( MapMode( MAP_POINT ) ); int w = 0; - while( ( w = pDev->GetTextWidth( aText ) ) > nTextWidth ) + while( ( w = pDev->GetTextWidth( msWatermark ) ) > nTextWidth ) { if (w == 0) break; @@ -1108,7 +1098,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi } rWriter.SetClipRegion(); rWriter.BeginTransparencyGroup(); - rWriter.DrawText( aTextPoint, aText ); + rWriter.DrawText( aTextPoint, msWatermark ); rWriter.EndTransparencyGroup( aTextRect, 50 ); rWriter.Pop(); } diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx index 1015322..499beb1 100644 --- a/filter/source/pdf/pdfexport.hxx +++ b/filter/source/pdf/pdfexport.hxx @@ -66,8 +66,7 @@ private: sal_Int32 mnProgressValue; bool mbRemoveTransparencies; - bool mbWatermark; - uno::Any maWatermark; + OUString msWatermark; //these variable are here only to have a location in filter/pdf to set the default //to be used by the macro (when the FilterData are set by the macro itself) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits