Blame SOURCES/texlive-poppler-0.26.5-bz#1217556.patch

c0528d
diff -up texlive-2012/source/texk/web2c/luatexdir/image/epdf.h.than texlive-2012/source/texk/web2c/luatexdir/image/epdf.h
c0528d
--- texlive-2012/source/texk/web2c/luatexdir/image/epdf.h.than	2015-04-30 22:34:17.765098640 +0200
c0528d
+++ texlive-2012/source/texk/web2c/luatexdir/image/epdf.h	2015-04-30 22:35:01.391427071 +0200
c0528d
@@ -48,6 +48,7 @@ extern "C" {
c0528d
 #  include "Dict.h"
c0528d
 #  include "XRef.h"
c0528d
 #  include "Catalog.h"
c0528d
+#  include <StructTreeRoot.h>
c0528d
 #  include "Link.h"
c0528d
 #  include "Page.h"
c0528d
 #  include "GfxFont.h"
c0528d
diff -up texlive-2012/source/texk/web2c/luatexdir/lua/lepdflib.cc.than texlive-2012/source/texk/web2c/luatexdir/lua/lepdflib.cc
c0528d
--- texlive-2012/source/texk/web2c/luatexdir/lua/lepdflib.cc.than	2015-04-30 22:30:17.574796564 +0200
c0528d
+++ texlive-2012/source/texk/web2c/luatexdir/lua/lepdflib.cc	2015-04-30 23:10:21.712979610 +0200
c0528d
@@ -65,6 +65,7 @@ static const char *ErrorCodeNames[] = {
c0528d
 #define M_PDFRectangle     "PDFRectangle"
c0528d
 #define M_Ref              "Ref"
c0528d
 #define M_Stream           "Stream"
c0528d
+#define M_StructTreeRoot   "StructTreeRoot"
c0528d
 #define M_XRefEntry        "XRefEntry"
c0528d
 #define M_XRef             "XRef"
c0528d
 
c0528d
@@ -96,6 +97,7 @@ new_poppler_userdata(Page);
c0528d
 new_poppler_userdata(PDFRectangle);
c0528d
 new_poppler_userdata(Ref);
c0528d
 new_poppler_userdata(Stream);
c0528d
+new_poppler_userdata(StructTreeRoot);
c0528d
 new_poppler_userdata(XRef);
c0528d
 
c0528d
 //**********************************************************************
c0528d
@@ -573,8 +575,11 @@ static int m_Catalog_getPageRef(lua_Stat
c0528d
 
c0528d
 m_poppler_get_GOOSTRING(Catalog, getBaseURI);
c0528d
 m_poppler_get_GOOSTRING(Catalog, readMetadata);
c0528d
+#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
c0528d
 m_poppler_get_poppler(Catalog, Object, getStructTreeRoot);
c0528d
-
c0528d
+#else
c0528d
+m_poppler_get_poppler(Catalog, StructTreeRoot, getStructTreeRoot);
c0528d
+#endif
c0528d
 static int m_Catalog_findPage(lua_State * L)
c0528d
 {
c0528d
     int num, gen, i;
c0528d
@@ -2146,14 +2151,22 @@ static int m_PDFDoc_readMetadata(lua_Sta
c0528d
 
c0528d
 static int m_PDFDoc_getStructTreeRoot(lua_State * L)
c0528d
 {
c0528d
+#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
c0528d
     Object *obj;
c0528d
+#else
c0528d
+    StructTreeRoot *obj;
c0528d
+#endif
c0528d
     udstruct *uin, *uout;
c0528d
     uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
c0528d
     if (uin->pd != NULL && uin->pd->pc != uin->pc)
c0528d
         pdfdoc_changed_error(L);
c0528d
     if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
c0528d
         obj = ((PdfDocument *) uin->d)->doc->getStructTreeRoot();
c0528d
+#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
c0528d
         uout = new_Object_userdata(L);
c0528d
+#else
c0528d
+        uout = new_StructTreeRoot_userdata(L);
c0528d
+#endif
c0528d
         uout->d = obj;
c0528d
         uout->pc = uin->pc;
c0528d
         uout->pd = uin->pd;