diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 608e8a09f5..9428162cbd 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,12 +16,17 @@ The license applies to all entries newer than 2009-04-28. */ +2010-10-23 14:16 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * external/libhpdf/libhpdf.dif + * Patched up the diff file, fixing previous problem and applying + recent local change. Thanks to Tamas Tevesz for this patch. + 2010-10-23 13:26 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * external/libhpdf/hpdfpdfa.c ! Fixed C++ variable declraration. ; NOTE: Could not rediff because the newly added hpdfpdfa.c file is missing from the diffing process. Also current .diff - appears to contain some invalid diffs for this file. + appears to contain some invalid diffs for this file. [DONE] 2010-10-23 11:00 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbtip/encqp.prg diff --git a/harbour/external/libhpdf/libhpdf.dif b/harbour/external/libhpdf/libhpdf.dif index 7cf401a534..787fecf080 100644 --- a/harbour/external/libhpdf/libhpdf.dif +++ b/harbour/external/libhpdf/libhpdf.dif @@ -1,6 +1,6 @@ diff -urN libhpdf.orig/hpdf.h libhpdf/hpdf.h ---- libhpdf.orig/hpdf.h 2010-10-23 00:17:55.000000000 +0200 -+++ libhpdf/hpdf.h 2010-10-23 00:17:55.000000000 +0200 +--- libhpdf.orig/hpdf.h 2010-10-23 14:01:35.000000000 +0200 ++++ libhpdf/hpdf.h 2010-10-23 14:01:35.000000000 +0200 @@ -17,7 +17,7 @@ #ifndef _HPDF_H #define _HPDF_H @@ -11,203 +11,25 @@ diff -urN libhpdf.orig/hpdf.h libhpdf/hpdf.h #ifdef HPDF_DLL_MAKE diff -urN libhpdf.orig/hpdfpdfa.c libhpdf/hpdfpdfa.c ---- libhpdf.orig/hpdfpdfa.c 2010-10-23 00:17:53.000000000 +0200 -+++ libhpdf/hpdfpdfa.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,147 +0,0 @@ --/* -- * << Haru Free PDF Library >> -- hpdf_pdfa.c -- * -- * URL: http://libharu.org -- * -- * Copyright (c) 1999-2006 Takeshi Kanno -- * Copyright (c) 2007-2009 Antony Dovgal -- * -- * Permission to use, copy, modify, distribute and sell this software -- * and its documentation for any purpose is hereby granted without fee, -- * provided that the above copyright notice appear in all copies and -- * that both that copyright notice and this permission notice appear -- * in supporting documentation. -- * It is provided "as is" without express or implied warranty. -- * -- */ -- --#include --#include "hpdfutil.h" --#include "hpdf.h" -- -- --#define XMP_HEADER "" --#define XMP_FOOTER "" --#define XMP_PDFA1A "" --#define XMP_PDFA1B "" --#define XMP_PRODUCER_STARTTAG "" --#define XMP_INFODATA_STARTTAG "" --#define XMP_INFODATA_ENDTAG "" --#define XMP_CREATE_DATE_STARTTAG "" --#define XMP_CREATE_DATE_ENDTAG "" --#define XMP_MOD_DATE_STARTTAG "" --#define XMP_MOD_DATE_ENDTAG "" --#define XMP_CREATORTOOL_STARTTAG "" --#define XMP_CREATORTOOL_ENDTAG "" -- -- --/* Write XMP Metadata for PDF/A */ -- --HPDF_STATUS --HPDF_PDFA_SetPDFAConformance (HPDF_Doc pdf,HPDF_PDFAType pdfatype) --{ -- HPDF_OutputIntent xmp; -- HPDF_STATUS ret; -- const char *info = NULL; -- -- if (!HPDF_HasDoc(pdf)) { -- return HPDF_INVALID_DOCUMENT; -- } -- -- xmp = HPDF_DictStream_New(pdf->mmgr,pdf->xref); -- if (!xmp) { -- return HPDF_INVALID_STREAM; -- } -- -- HPDF_Dict_AddName(xmp,"Type","Metadata"); -- HPDF_Dict_AddName(xmp,"SubType","XML"); -- -- ret = HPDF_OK; -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_HEADER); -- -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_PRODUCER_STARTTAG); -- -- info = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_PRODUCER); -- ret += HPDF_Stream_WriteStr(xmp->stream, info); -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_PRODUCER_ENDTAG); -- -- /* Add CreateDate, ModifyDate, and CreatorTool */ -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_INFODATA_STARTTAG); -- -- info = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_CREATION_DATE); -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATE_DATE_STARTTAG); -- ret += HPDF_Stream_WriteStr(xmp->stream, info); -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATE_DATE_ENDTAG); -- -- info = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_MOD_DATE); -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_MOD_DATE_STARTTAG); -- ret += HPDF_Stream_WriteStr(xmp->stream, info); -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_MOD_DATE_ENDTAG); -- -- info = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_CREATOR); -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATORTOOL_STARTTAG); -- ret += HPDF_Stream_WriteStr(xmp->stream, info); -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATORTOOL_ENDTAG); -- -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_INFODATA_ENDTAG); -- -- switch(pdfatype) { -- case HPDF_PDFA_1A: -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_PDFA1A); -- break; -- case HPDF_PDFA_1B: -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_PDFA1B); -- break; -- } -- ret += HPDF_Stream_WriteStr(xmp->stream, XMP_FOOTER); -- -- if (ret != HPDF_OK) { -- return HPDF_INVALID_STREAM; -- } -- -- if ((ret = HPDF_Dict_Add(pdf->catalog, "Metadata", xmp)) != HPDF_OK) { -- return ret; -- } -- -- return HPDF_PDFA_GenerateID(pdf); --} -- --/* Generate an ID for the trailer dict, PDF/A needs this. -- TODO: Better algorithm for generate unique ID. --*/ --HPDF_STATUS --HPDF_PDFA_GenerateID(HPDF_Doc pdf) --{ -- HPDF_BYTE *currentTime; -- HPDF_BYTE idkey[HPDF_MD5_KEY_LEN]; -- HPDF_MD5_CTX md5_ctx; -- time_t ltime; -- -- ltime = time(NULL); -- currentTime = (HPDF_BYTE *)ctime(<ime); -- +--- libhpdf.orig/hpdfpdfa.c 2010-10-23 14:01:34.000000000 +0200 ++++ libhpdf/hpdfpdfa.c 2010-10-23 14:01:34.000000000 +0200 +@@ -116,12 +116,12 @@ + HPDF_BYTE *currentTime; + HPDF_BYTE idkey[HPDF_MD5_KEY_LEN]; + HPDF_MD5_CTX md5_ctx; ++ HPDF_Array id; + time_t ltime; + + ltime = time(NULL); + currentTime = (HPDF_BYTE *)ctime(<ime); + - HPDF_Array id; -- id = HPDF_Dict_GetItem(pdf->trailer, "ID", HPDF_OCLASS_ARRAY); -- if (!id) { -- id = HPDF_Array_New(pdf->mmgr); -- -- if (!id || HPDF_Dict_Add(pdf->trailer, "ID", id) != HPDF_OK) -- return pdf->error.error_no; -- -- HPDF_MD5Init(&md5_ctx); -- HPDF_MD5Update(&md5_ctx, (HPDF_BYTE *) "libHaru", sizeof("libHaru") - 1); -- HPDF_MD5Update(&md5_ctx, currentTime, HPDF_StrLen((const char *)currentTime, -1)); -- HPDF_MD5Final(idkey, &md5_ctx); -- -- if (HPDF_Array_Add (id, HPDF_Binary_New (pdf->mmgr, idkey, HPDF_MD5_KEY_LEN)) != HPDF_OK) -- return pdf->error.error_no; -- -- if (HPDF_Array_Add (id, HPDF_Binary_New (pdf->mmgr,idkey,HPDF_MD5_KEY_LEN)) != HPDF_OK) -- return pdf->error.error_no; -- -- return HPDF_OK; -- } -- -- return HPDF_OK; --} -diff -urN libhpdf.orig/hpdfpdfa.h libhpdf/hpdfpdfa.h ---- libhpdf.orig/hpdfpdfa.h 2010-10-23 00:17:55.000000000 +0200 -+++ libhpdf/hpdfpdfa.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,40 +0,0 @@ --/* -- * << Haru Free PDF Library >> -- hpdf_pdfa.h -- * -- * URL: http://libharu.org -- * -- * Copyright (c) 1999-2006 Takeshi Kanno -- * Copyright (c) 2007-2009 Antony Dovgal -- * -- * Permission to use, copy, modify, distribute and sell this software -- * and its documentation for any purpose is hereby granted without fee, -- * provided that the above copyright notice appear in all copies and -- * that both that copyright notice and this permission notice appear -- * in supporting documentation. -- * It is provided "as is" without express or implied warranty. -- * -- */ -- --#ifndef _HPDF_PDFA_H --#define _HPDF_PDFA_H -- --#include "hpdfdoc.h" --#include "hpdfobje.h" -- -- -- --#ifdef __cplusplus --extern "C" { --#endif -- --HPDF_STATUS --HPDF_PDFA_SetPDFAConformance (HPDF_Doc pdf, -- HPDF_PDFAType pdfatype); -- --HPDF_STATUS --HPDF_PDFA_GenerateID(HPDF_Doc); --#ifdef __cplusplus --} --#endif -- --#endif + id = HPDF_Dict_GetItem(pdf->trailer, "ID", HPDF_OCLASS_ARRAY); + if (!id) { + id = HPDF_Array_New(pdf->mmgr); diff -urN libhpdf.orig/hpdfutil.h libhpdf/hpdfutil.h ---- libhpdf.orig/hpdfutil.h 2010-10-23 00:17:55.000000000 +0200 -+++ libhpdf/hpdfutil.h 2010-10-23 00:17:55.000000000 +0200 +--- libhpdf.orig/hpdfutil.h 2010-10-23 14:01:36.000000000 +0200 ++++ libhpdf/hpdfutil.h 2010-10-23 14:01:36.000000000 +0200 @@ -18,7 +18,7 @@ #ifndef _HPDF_UTILS_H #define _HPDF_UTILS_H