[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - filter/source
Julien Nabet
serval2412 at yahoo.fr
Tue Jan 12 08:18:13 PST 2016
filter/source/pdf/pdfexport.cxx | 18 ++++--------------
filter/source/pdf/pdfexport.hxx | 3 +--
2 files changed, 5 insertions(+), 16 deletions(-)
New commits:
commit feebc5953fb416c5dc8cdf8c7e924a9ff9c70f17
Author: Julien Nabet <serval2412 at 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 <ci at libreoffice.org>
Tested-by: Jan-Marek Glogowski <glogow at fbihome.de>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
(cherry picked from commit 5c5017ea37e1bee205c6c1b9cafe753fcaf1a9a4)
Reviewed-on: https://gerrit.libreoffice.org/21397
Tested-by: Michael Stahl <mstahl at redhat.com>
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 3ad411e..5a67041 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;
@@ -1051,7 +1047,7 @@ bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData&
rPDFExtOutDevData.ResetSyncData();
- if( mbWatermark )
+ if (!msWatermark.isEmpty())
ImplWriteWatermark( rWriter, aSizePDF );
return bRet;
@@ -1061,7 +1057,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 );
@@ -1074,18 +1069,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();
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;
@@ -1127,7 +1117,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 b37cf15..75ac0aa4 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)
More information about the Libreoffice-commits
mailing list