openbsd-ports/x11/gnustep/pdfkit/patches/patch-xpdf_bridge_XPDFBridge_cc
sebastia d4fc7a52e2 unbreak pdfkit after xpdf update, still some fonts may not be found, but
better than not working at all. upgrading the bundled version or other options
will be discussed with upstream.
while there, remove two empty patches

OK kili@
2011-10-04 12:53:38 +00:00

129 lines
4.6 KiB
Plaintext

$OpenBSD: patch-xpdf_bridge_XPDFBridge_cc,v 1.1 2011/10/04 12:53:38 sebastia Exp $
fix api changes from 3.02 -> 3.03
--- xpdf/bridge/XPDFBridge.cc.orig Wed Jul 15 01:39:28 2009
+++ xpdf/bridge/XPDFBridge.cc Mon Oct 3 08:14:54 2011
@@ -168,7 +168,7 @@ SearchContext* PDFSearch_CreateSearchContext(XPDFObjec
theContext->pdfDoc = pdfDoc;
theContext->currentPage = -1;
- theContext->textOutputDevice = new TextOutputDev(NULL, gTrue, gFalse, gFalse);
+ theContext->textOutputDevice = new TextOutputDev(NULL, gTrue, 0, gFalse, gFalse);
if (!static_cast<TextOutputDev*>(theContext->textOutputDevice)->isOk())
{
@@ -267,12 +267,12 @@ int PDFSearch_FindText(SearchContext* aSearchContext,
if (page == startPage)
{
found =
- textOut->findText(u, len, top, gTrue, gFalse, gFalse, gFalse, gFalse, xMin, yMin, xMax, yMax);
+ textOut->findText(u, len, top, gTrue, gFalse, gFalse, gFalse, gFalse, gFalse, xMin, yMin, xMax, yMax);
}
else
{
found =
- textOut->findText(u, len, gTrue, gTrue, gFalse, gFalse, gFalse, gFalse, xMin, yMin, xMax, yMax);
+ textOut->findText(u, len, gTrue, gTrue, gFalse, gFalse, gFalse, gFalse, gFalse, xMin, yMin, xMax, yMax);
}
if (found)
@@ -297,12 +297,12 @@ int PDFSearch_FindText(SearchContext* aSearchContext,
if (page == startPage)
{
found =
- textOut->findText(u, len, gTrue, gTrue, gFalse, gFalse, gFalse, gFalse, xMin, yMin, xMax, yMax);
+ textOut->findText(u, len, gTrue, gTrue, gFalse, gFalse, gFalse, gFalse, gFalse, xMin, yMin, xMax, yMax);
}
else
{
found =
- textOut->findText(u, len, gTrue, gFalse, gFalse, gFalse, gFalse, gFalse, xMin, yMin, xMax, yMax);
+ textOut->findText(u, len, gTrue, gFalse, gFalse, gFalse, gFalse, gFalse, gFalse, xMin, yMin, xMax, yMax);
}
if (found)
@@ -377,7 +377,7 @@ int PDFUtil_GetAllText(XPDFObject pdfDoc, void *func)
XPDF_AcquireLock();
- textOut = new TextOutputDev((TextOutputFunc)func, (void *)1, gFalse, gFalse);
+ textOut = new TextOutputDev((TextOutputFunc)func, (void *)1, gFalse, 0, gFalse);
if (textOut->isOk()) {
doc->displayPages(textOut, 1, doc->getNumPages(), 72, 72, 0,
@@ -405,7 +405,7 @@ void PDFUtil_GetText(XPDFObject pdfDoc,
PDFDoc* doc = TO_PDFDoc(pdfDoc);
- TextOutputDev* textOut = new TextOutputDev(NULL, gTrue, gFalse, gFalse);
+ TextOutputDev* textOut = new TextOutputDev(NULL, gTrue, 0, gFalse, gFalse);
if (!textOut->isOk())
{
delete textOut;
@@ -656,7 +656,7 @@ void PDFFont_AddDisplayFont(const char* fontName,
const char* fontFile,
DisplayFontType type)
{
- DisplayFontParam* dfp;
+/* DisplayFontParam* dfp;
dfp = new DisplayFontParam(new GString(fontName),
(type == T1DisplayFont ? displayFontT1 : displayFontTT));
@@ -680,7 +680,7 @@ void PDFFont_AddDisplayFont(const char* fontName,
}
}
- globalParams->addDisplayFont(dfp);
+ globalParams->addDisplayFont(dfp); */
}
@@ -688,7 +688,7 @@ void PDFFont_GetDisplayFont(const char* fontName,
const char** fontFile,
DisplayFontType* type)
{
- DisplayFontParam* dfp;
+/* DisplayFontParam* dfp;
*fontFile = NULL;
@@ -710,7 +710,7 @@ void PDFFont_GetDisplayFont(const char* fontName,
break;
}
}
- }
+ } */
}
@@ -815,7 +815,7 @@ void PDFRender_GetRGB(XPDFObject bitmap, unsigned char
#define TO_PSOutputDev(object) (static_cast<PSOutputDev*>(object))
-void OutputPS(void* stream, char* data, int len)
+void OutputPS(void* stream, const char* data, int len)
{
char* buffer = (char*)malloc((len + 1) * sizeof(char));
memcpy(buffer, data, len);
@@ -829,13 +829,12 @@ void OutputPS(void* stream, char* data, int len)
XPDFObject PDFPS_CreateOutputDevice(XPDFObject pdfDoc, int firstPage, int lastPage)
{
- PSOutputDev* psDev = new PSOutputDev(OutputPS,
- NULL,
- TO_PDFDoc(pdfDoc)->getXRef(),
- TO_PDFDoc(pdfDoc)->getCatalog(),
- firstPage,
- lastPage,
- psModePS);
+ PSOutputDev* psDev = new PSOutputDev(OutputPS,
+ NULL,
+ TO_PDFDoc(pdfDoc),
+ firstPage,
+ lastPage,
+ psModePS);
return psDev;
}