Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e554121f
Kaydet (Commit)
e554121f
authored
Agu 13, 2012
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make it compile for Android again (and iOS, I hope)
Change-Id: Ib0a4f4ea4858d52ed70e9a4d1b7904325f36c361
üst
15bbf66e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
pdfwriter_impl.cxx
vcl/source/gdi/pdfwriter_impl.cxx
+23
-2
No files found.
vcl/source/gdi/pdfwriter_impl.cxx
Dosyayı görüntüle @
e554121f
...
@@ -82,6 +82,7 @@
...
@@ -82,6 +82,7 @@
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/implbase1.hxx"
#if !defined(ANDROID) && !defined(IOS)
// NSS header files for PDF signing support
// NSS header files for PDF signing support
#include "nss.h"
#include "nss.h"
#include "cert.h"
#include "cert.h"
...
@@ -89,6 +90,7 @@
...
@@ -89,6 +90,7 @@
#include "sechash.h"
#include "sechash.h"
#include "cms.h"
#include "cms.h"
#include "cmst.h"
#include "cmst.h"
#endif
using namespace vcl;
using namespace vcl;
...
@@ -5916,12 +5918,14 @@ bool PDFWriterImpl::emitCatalog()
...
@@ -5916,12 +5918,14 @@ bool PDFWriterImpl::emitCatalog()
else
else
aInitPageRef.append( "0" );
aInitPageRef.append( "0" );
#if !defined(ANDROID) && !defined(IOS)
if (m_nSignatureObject != -1) // Document will be signed
if (m_nSignatureObject != -1) // Document will be signed
{
{
aLine.append("/Perms<</DocMDP ");
aLine.append("/Perms<</DocMDP ");
aLine.append(m_nSignatureObject);
aLine.append(m_nSignatureObject);
aLine.append(" 0 R>>");
aLine.append(" 0 R>>");
}
}
#endif
switch( m_aContext.PDFDocumentAction )
switch( m_aContext.PDFDocumentAction )
{
{
...
@@ -6049,14 +6053,20 @@ bool PDFWriterImpl::emitCatalog()
...
@@ -6049,14 +6053,20 @@ bool PDFWriterImpl::emitCatalog()
}
}
aLine.append( "\n]" );
aLine.append( "\n]" );
#if !defined(ANDROID) && !defined(IOS)
if (m_nSignatureObject != -1)
if (m_nSignatureObject != -1)
aLine.append( "/SigFlags 3");
aLine.append( "/SigFlags 3");
#endif
aLine.append( "/DR " );
aLine.append( "/DR " );
aLine.append( getResourceDictObj() );
aLine.append( getResourceDictObj() );
aLine.append( " 0 R" );
aLine.append( " 0 R" );
// /NeedAppearances must not be used if PDF is signed
// /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" );
aLine.append( ">>\n" );
else
else
aLine.append( "/NeedAppearances true>>\n" );
aLine.append( "/NeedAppearances true>>\n" );
...
@@ -6083,6 +6093,8 @@ bool PDFWriterImpl::emitCatalog()
...
@@ -6083,6 +6093,8 @@ bool PDFWriterImpl::emitCatalog()
return true;
return true;
}
}
#if !defined(ANDROID) && !defined(IOS)
bool PDFWriterImpl::emitSignature()
bool PDFWriterImpl::emitSignature()
{
{
if( !updateObject( m_nSignatureObject ) )
if( !updateObject( m_nSignatureObject ) )
...
@@ -6358,6 +6370,8 @@ bool PDFWriterImpl::finalizeSignature()
...
@@ -6358,6 +6370,8 @@ bool PDFWriterImpl::finalizeSignature()
return true;
return true;
}
}
#endif
sal_Int32 PDFWriterImpl::emitInfoDict( )
sal_Int32 PDFWriterImpl::emitInfoDict( )
{
{
sal_Int32 nObject = createObject();
sal_Int32 nObject = createObject();
...
@@ -7139,6 +7153,7 @@ bool PDFWriterImpl::emit()
...
@@ -7139,6 +7153,7 @@ bool PDFWriterImpl::emit()
// needed for widget tab order
// needed for widget tab order
sortWidgets();
sortWidgets();
#if !defined(ANDROID) && !defined(IOS)
if( m_aContext.SignPDF )
if( m_aContext.SignPDF )
{
{
// sign the document
// sign the document
...
@@ -7146,6 +7161,7 @@ bool PDFWriterImpl::emit()
...
@@ -7146,6 +7161,7 @@ bool PDFWriterImpl::emit()
aSignature.Name = OUString("Signature1");
aSignature.Name = OUString("Signature1");
createControl( aSignature, 0 );
createControl( aSignature, 0 );
}
}
#endif
// emit additional streams
// emit additional streams
CHECK_RETURN( emitAdditionalStreams() );
CHECK_RETURN( emitAdditionalStreams() );
...
@@ -7153,14 +7169,18 @@ bool PDFWriterImpl::emit()
...
@@ -7153,14 +7169,18 @@ bool PDFWriterImpl::emit()
// emit catalog
// emit catalog
CHECK_RETURN( emitCatalog() );
CHECK_RETURN( emitCatalog() );
#if !defined(ANDROID) && !defined(IOS)
if (m_nSignatureObject != -1) // if document is signed, emit sigdict
if (m_nSignatureObject != -1) // if document is signed, emit sigdict
CHECK_RETURN( emitSignature() );
CHECK_RETURN( emitSignature() );
#endif
// emit trailer
// emit trailer
CHECK_RETURN( emitTrailer() );
CHECK_RETURN( emitTrailer() );
#if !defined(ANDROID) && !defined(IOS)
if (m_nSignatureObject != -1) // finalize the signature
if (m_nSignatureObject != -1) // finalize the signature
CHECK_RETURN( finalizeSignature() );
CHECK_RETURN( finalizeSignature() );
#endif
osl_closeFile( m_aFile );
osl_closeFile( m_aFile );
m_bOpen = false;
m_bOpen = false;
...
@@ -12058,6 +12078,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
...
@@ -12058,6 +12078,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
createDefaultEditAppearance( rNewWidget, rEdit );
createDefaultEditAppearance( rNewWidget, rEdit );
}
}
#if !defined(ANDROID) && !defined(IOS)
else if( rControl.getType() == PDFWriter::Signature)
else if( rControl.getType() == PDFWriter::Signature)
{
{
const PDFWriter::SignatureWidget& rSig = static_cast<const PDFWriter::SignatureWidget&>(rControl);
const PDFWriter::SignatureWidget& rSig = static_cast<const PDFWriter::SignatureWidget&>(rControl);
...
@@ -12073,7 +12094,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
...
@@ -12073,7 +12094,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
// let's add a fake appearance
// let's add a fake appearance
rNewWidget.m_aAppearances[ "N" ][ "Standard" ] = new SvMemoryStream();
rNewWidget.m_aAppearances[ "N" ][ "Standard" ] = new SvMemoryStream();
}
}
#endif
// if control is a hidden signature, do not convert coordinates since we
// if control is a hidden signature, do not convert coordinates since we
// need /Rect [ 0 0 0 0 ]
// need /Rect [ 0 0 0 0 ]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment