Fix FTBFS on Poppler >= 0.20

This resolves Bug 1061
(cherry picked from commit 44d1a52bf8)
v3.5.13-sru
Timothy Pearson 13 years ago committed by Slávek Banko
parent 720e1d7b07
commit 8addb8e4d0

@ -1,6 +1,7 @@
#cmakedefine VERSION "@VERSION@" #cmakedefine VERSION "@VERSION@"
// poppler-tqt // poppler-tqt
#cmakedefine HAVE_POPPLER_020
#cmakedefine HAVE_POPPLER_016 #cmakedefine HAVE_POPPLER_016
// kpdf, kdvi // kpdf, kdvi

@ -15,4 +15,9 @@ check_cxx_source_compiles("
#include <poppler/PSOutputDev.h> #include <poppler/PSOutputDev.h>
int main(int, char**) { int a; int b; PSOutputDev *psOut = new PSOutputDev(\"test\", (PDFDoc*)0, (XRef*)0, (Catalog*)0, NULL, 0, 0, psModePS, a, b); } " int main(int, char**) { int a; int b; PSOutputDev *psOut = new PSOutputDev(\"test\", (PDFDoc*)0, (XRef*)0, (Catalog*)0, NULL, 0, 0, psModePS, a, b); } "
HAVE_POPPLER_016 ) HAVE_POPPLER_016 )
check_cxx_source_compiles("
#include <poppler/PSOutputDev.h>
int main(int, char**) { int a; int b; PSOutputDev *psOut = new PSOutputDev(\"test\", (PDFDoc*)0, NULL, 0, 0, psModePS, a, b); } "
HAVE_POPPLER_020 )
tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )

@ -317,17 +317,19 @@ bool Document::print(const TQString &fileName, TQValueList<int> pageList, double
bool Document::print(const TQString &file, TQValueList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight) bool Document::print(const TQString &file, TQValueList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight)
{ {
#ifdef HAVE_POPPLER_016 #ifdef HAVE_POPPLER_020
PSOutputDev *psOut = new PSOutputDev(file.latin1(), &(data->doc), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight);
#elif HAVE_POPPLER_016
PSOutputDev *psOut = new PSOutputDev(file.latin1(), &(data->doc), data->doc.getXRef(), data->doc.getCatalog(), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight); PSOutputDev *psOut = new PSOutputDev(file.latin1(), &(data->doc), data->doc.getXRef(), data->doc.getCatalog(), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight);
#else #else
PSOutputDev *psOut = new PSOutputDev(file.latin1(), data->doc.getXRef(), data->doc.getCatalog(), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight); PSOutputDev *psOut = new PSOutputDev(file.latin1(), data->doc.getXRef(), data->doc.getCatalog(), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight);
#endif #endif
if (psOut->isOk()) { if (psOut->isOk()) {
TQValueList<int>::iterator it; TQValueList<int>::iterator it;
for (it = pageList.begin(); it != pageList.end(); ++it ) for (it = pageList.begin(); it != pageList.end(); ++it )
data->doc.displayPage(psOut, *it, hDPI, vDPI, rotate, gFalse, gTrue, gTrue); data->doc.displayPage(psOut, *it, hDPI, vDPI, rotate, gFalse, gTrue, gTrue);
delete psOut; delete psOut;
return true; return true;
} else { } else {

@ -128,8 +128,12 @@ TQString Page::getText(const Rectangle &r) const
PDFRectangle *rect; PDFRectangle *rect;
TQString result; TQString result;
::Page *p; ::Page *p;
#ifdef HAVE_POPPLER_020
output_dev = new TextOutputDev(0, gFalse, 0, gFalse, gFalse);
#else
output_dev = new TextOutputDev(0, gFalse, gFalse, gFalse); output_dev = new TextOutputDev(0, gFalse, gFalse, gFalse);
#endif
data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, 72, 72, data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, 72, 72,
0, false, false, false, -1, -1, -1, -1); 0, false, false, false, -1, -1, -1, -1);
p = data->doc->data->doc.getCatalog()->getPage(data->index + 1); p = data->doc->data->doc.getCatalog()->getPage(data->index + 1);
@ -159,8 +163,12 @@ TQValueList<TextBox*> Page::textList() const
TextOutputDev *output_dev; TextOutputDev *output_dev;
TQValueList<TextBox*> output_list; TQValueList<TextBox*> output_list;
#ifdef HAVE_POPPLER_020
output_dev = new TextOutputDev(0, gFalse, 0, gFalse, gFalse);
#else
output_dev = new TextOutputDev(0, gFalse, gFalse, gFalse); output_dev = new TextOutputDev(0, gFalse, gFalse, gFalse);
#endif
data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, 72, 72, data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, 72, 72,
0, false, false, false, -1, -1, -1, -1); 0, false, false, false, -1, -1, -1, -1);

Loading…
Cancel
Save