diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2015-01-29 19:18:14 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-01-29 19:18:28 +0100 |
commit | c5814e9e4ed980abe663804e6b2bfeb55b8cad26 (patch) | |
tree | ab5ad3d0a637fc095ae4e7daa49c55c2a9bf0167 | |
parent | 089caba3647a01874638cd1e3a2c1b039157186c (diff) | |
download | tdegraphics-c5814e9e4ed980abe663804e6b2bfeb55b8cad26.tar.gz tdegraphics-c5814e9e4ed980abe663804e6b2bfeb55b8cad26.zip |
Add support for poppler 0.30
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 8cf503a6f85234943733d2ca59505898e97053fe)
4 files changed, 16 insertions, 3 deletions
diff --git a/config.h.cmake b/config.h.cmake index 483249c7..e6d1fd28 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -1,6 +1,7 @@ #cmakedefine VERSION "@VERSION@" // poppler-tqt +#cmakedefine HAVE_POPPLER_030 #cmakedefine HAVE_POPPLER_020 #cmakedefine HAVE_POPPLER_016 diff --git a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake index b15057c9..667cb317 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake +++ b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake @@ -17,5 +17,10 @@ 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 ) +check_cxx_source_compiles(" + #include <vector> + #include <poppler/PSOutputDev.h> + int main(int, char**) { int a; int b; std::vector<int> p; PSOutputDev *psOut = new PSOutputDev(\"test\", (PDFDoc*)0, NULL, p, psModePS, a, b); } " + HAVE_POPPLER_030 ) tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc index 2e7cc516..081e1035 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc +++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc @@ -317,7 +317,14 @@ 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) { -#if defined(HAVE_POPPLER_020) +#if defined(HAVE_POPPLER_030) + std::vector<int> pages; + TQValueList<int>::iterator it; + for (it = pageList.begin(); it != pageList.end(); ++it ) { + pages.push_back(*it); + } + PSOutputDev *psOut = new PSOutputDev(file.latin1(), &(data->doc), NULL, pages, psModePS, paperWidth, paperHeight); +#elif defined(HAVE_POPPLER_020) PSOutputDev *psOut = new PSOutputDev(file.latin1(), &(data->doc), NULL, 1, data->doc.getNumPages(), psModePS, paperWidth, paperHeight); #elif defined(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); diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc index 3d1e6569..2c6a5f0e 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc +++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc @@ -129,7 +129,7 @@ TQString Page::getText(const Rectangle &r) const TQString result; ::Page *p; -#if defined(HAVE_POPPLER_020) +#if defined(HAVE_POPPLER_030) || defined(HAVE_POPPLER_020) output_dev = new TextOutputDev(0, gFalse, 0, gFalse, gFalse); #else output_dev = new TextOutputDev(0, gFalse, gFalse, gFalse); @@ -164,7 +164,7 @@ TQValueList<TextBox*> Page::textList() const TQValueList<TextBox*> output_list; -#if defined(HAVE_POPPLER_020) +#if defined(HAVE_POPPLER_030) || defined(HAVE_POPPLER_020) output_dev = new TextOutputDev(0, gFalse, 0, gFalse, gFalse); #else output_dev = new TextOutputDev(0, gFalse, gFalse, gFalse); |