[Libreoffice-commits] .: 2 commits - vcl/Library_vcl.mk vcl/source
Tor Lillqvist
tml at kemper.freedesktop.org
Mon Aug 13 07:59:04 PDT 2012
vcl/Library_vcl.mk | 11 +++--------
vcl/source/gdi/pdfwriter_impl.cxx | 25 +++++++++++++++++++++++--
2 files changed, 26 insertions(+), 10 deletions(-)
New commits:
commit e554121fcabefa01b531c1b5b63c227f5a9a97fa
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Aug 13 17:49:53 2012 +0300
Make it compile for Android again (and iOS, I hope)
Change-Id: Ib0a4f4ea4858d52ed70e9a4d1b7904325f36c361
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 026f1a6..ca44916 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -82,6 +82,7 @@
#include "cppuhelper/implbase1.hxx"
+#if !defined(ANDROID) && !defined(IOS)
// NSS header files for PDF signing support
#include "nss.h"
#include "cert.h"
@@ -89,6 +90,7 @@
#include "sechash.h"
#include "cms.h"
#include "cmst.h"
+#endif
using namespace vcl;
@@ -5916,12 +5918,14 @@ bool PDFWriterImpl::emitCatalog()
else
aInitPageRef.append( "0" );
+#if !defined(ANDROID) && !defined(IOS)
if (m_nSignatureObject != -1) // Document will be signed
{
aLine.append("/Perms<</DocMDP ");
aLine.append(m_nSignatureObject);
aLine.append(" 0 R>>");
}
+#endif
switch( m_aContext.PDFDocumentAction )
{
@@ -6049,14 +6053,20 @@ bool PDFWriterImpl::emitCatalog()
}
aLine.append( "\n]" );
+#if !defined(ANDROID) && !defined(IOS)
if (m_nSignatureObject != -1)
aLine.append( "/SigFlags 3");
+#endif
aLine.append( "/DR " );
aLine.append( getResourceDictObj() );
aLine.append( " 0 R" );
// /NeedAppearances must not be used if PDF is signed
- if( m_bIsPDF_A1 || ( m_nSignatureObject != -1 ) )
+ if( m_bIsPDF_A1
+#if !defined(ANDROID) && !defined(IOS)
+ || ( m_nSignatureObject != -1 )
+#endif
+ )
aLine.append( ">>\n" );
else
aLine.append( "/NeedAppearances true>>\n" );
@@ -6083,6 +6093,8 @@ bool PDFWriterImpl::emitCatalog()
return true;
}
+#if !defined(ANDROID) && !defined(IOS)
+
bool PDFWriterImpl::emitSignature()
{
if( !updateObject( m_nSignatureObject ) )
@@ -6358,6 +6370,8 @@ bool PDFWriterImpl::finalizeSignature()
return true;
}
+#endif
+
sal_Int32 PDFWriterImpl::emitInfoDict( )
{
sal_Int32 nObject = createObject();
@@ -7139,6 +7153,7 @@ bool PDFWriterImpl::emit()
// needed for widget tab order
sortWidgets();
+#if !defined(ANDROID) && !defined(IOS)
if( m_aContext.SignPDF )
{
// sign the document
@@ -7146,6 +7161,7 @@ bool PDFWriterImpl::emit()
aSignature.Name = OUString("Signature1");
createControl( aSignature, 0 );
}
+#endif
// emit additional streams
CHECK_RETURN( emitAdditionalStreams() );
@@ -7153,14 +7169,18 @@ bool PDFWriterImpl::emit()
// emit catalog
CHECK_RETURN( emitCatalog() );
+#if !defined(ANDROID) && !defined(IOS)
if (m_nSignatureObject != -1) // if document is signed, emit sigdict
CHECK_RETURN( emitSignature() );
+#endif
// emit trailer
CHECK_RETURN( emitTrailer() );
+#if !defined(ANDROID) && !defined(IOS)
if (m_nSignatureObject != -1) // finalize the signature
CHECK_RETURN( finalizeSignature() );
+#endif
osl_closeFile( m_aFile );
m_bOpen = false;
@@ -12058,6 +12078,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
createDefaultEditAppearance( rNewWidget, rEdit );
}
+#if !defined(ANDROID) && !defined(IOS)
else if( rControl.getType() == PDFWriter::Signature)
{
const PDFWriter::SignatureWidget& rSig = static_cast<const PDFWriter::SignatureWidget&>(rControl);
@@ -12073,7 +12094,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
// let's add a fake appearance
rNewWidget.m_aAppearances[ "N" ][ "Standard" ] = new SvMemoryStream();
}
-
+#endif
// if control is a hidden signature, do not convert coordinates since we
// need /Rect [ 0 0 0 0 ]
commit 15bbf66efadf1b522303347c44b28450d92b3007
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Aug 13 17:26:29 2012 +0300
Revert "Bypass pdfwriter for non-desktop OSes without any Mozilla stuff for now"
This reverts commit fd9c2cca78227f634e34790aa127cc31e4302a56.
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 4aa52ab..e6abe34 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -211,6 +211,9 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/gdi/outmap \
vcl/source/gdi/pdfextoutdevdata \
vcl/source/gdi/pdffontcache \
+ vcl/source/gdi/pdfwriter \
+ vcl/source/gdi/pdfwriter_impl2 \
+ vcl/source/gdi/pdfwriter_impl \
vcl/source/gdi/pngread \
vcl/source/gdi/pngwrite \
vcl/source/gdi/print2 \
@@ -284,14 +287,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
# optional parts
-ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
-$(eval $(call gb_Library_add_exception_objects,vcl,\
- vcl/source/gdi/pdfwriter \
- vcl/source/gdi/pdfwriter_impl2 \
- vcl/source/gdi/pdfwriter_impl \
-))
-endif
-
## handle Graphite
ifneq ($(ENABLE_GRAPHITE),)
# add defines, graphite sources for all platforms
More information about the Libreoffice-commits
mailing list