new_poppler_build

# Description: fix the build with the new poppler
# Origin: fedora
# Upstream: ?
# Description: fix the build with the new poppler
# Origin: fedora
# Upstream: ?

Gbp-Pq: Name new_poppler_build.patch
This commit is contained in:
Debian Med Packaging Team 2022-05-14 03:29:01 +08:00 committed by openKylinBot
parent b5b41bd367
commit a2615e99a1
3 changed files with 20 additions and 4 deletions

View File

@ -72,6 +72,14 @@ if(GDCM_USE_SYSTEM_POPPLER)
if(LIBPOPPLER_GLOBALPARAMS_CSTOR_HAS_PARAM)
list(APPEND libpoppler_flags -DLIBPOPPLER_GLOBALPARAMS_CSTOR_HAS_PARAM)
endif()
if(NOT LIBPOPPLER_GLOBALPARAMS_CSTOR_HAS_PARAM)
CHECK_CXX_SOURCE_COMPILES(
"\#include <poppler/GlobalParams.h>\nint main() { globalParams = new GlobalParams(); return 0;}"
LIBPOPPLER_GLOBALPARAMS_IS_NOT_UNIQUE_PTR)
if(NOT LIBPOPPLER_GLOBALPARAMS_IS_NOT_UNIQUE_PTR)
list(APPEND libpoppler_flags -DLIBPOPPLER_GLOBALPARAMS_IS_UNIQUE_PTR)
endif()
endif()
CHECK_CXX_SOURCE_COMPILES(
"\#include <poppler/PDFDoc.h>\nint main() { PDFDoc d((GooString*)NULL,(GooString*)NULL,(GooString*)NULL); d.getPDFVersion(); return 0;}"
LIBPOPPLER_PDFDOC_HAS_PDFVERSION)

View File

@ -258,7 +258,7 @@ static std::string getInfoDate(Dict *infoDict, const char *key)
return out;
}
static std::string getInfoString(Dict *infoDict, const char *key, UnicodeMap *uMap)
static std::string getInfoString(Dict *infoDict, const char *key, const UnicodeMap *uMap)
{
Object obj;
#ifdef LIBPOPPLER_GOOSTRING_HAS_CONSTGETCHAR
@ -509,11 +509,15 @@ static int ProcessOneFile( std::string const & filename, gdcm::Defs const & defs
std::string creationdate;
std::string moddate;
UnicodeMap *uMap;
const UnicodeMap *uMap;
#ifdef LIBPOPPLER_GLOBALPARAMS_IS_UNIQUE_PTR
globalParams = std::make_unique<GlobalParams>();
#else
#ifdef LIBPOPPLER_GLOBALPARAMS_CSTOR_HAS_PARAM
globalParams = new GlobalParams(0);
#else
globalParams = new GlobalParams();
#endif
#endif
uMap = globalParams->getTextEncoding();

View File

@ -106,7 +106,7 @@ static std::string getInfoDate(Dict *infoDict, const char *key)
return out;
}
static std::string getInfoString(Dict *infoDict, const char *key, UnicodeMap *uMap, bool & unicode)
static std::string getInfoString(Dict *infoDict, const char *key, const UnicodeMap *uMap, bool & unicode)
{
Object obj;
#ifdef LIBPOPPLER_GOOSTRING_HAS_CONSTGETCHAR
@ -333,13 +333,17 @@ int main (int argc, char *argv[])
GooString *fileName;
PDFDoc *doc;
Object info;
UnicodeMap *uMap;
const UnicodeMap *uMap;
ownerPW = NULL;
userPW = NULL;
#ifdef LIBPOPPLER_GLOBALPARAMS_IS_UNIQUE_PTR
globalParams = std::make_unique<GlobalParams>();
#else
#ifdef LIBPOPPLER_GLOBALPARAMS_CSTOR_HAS_PARAM
globalParams = new GlobalParams(0);
#else
globalParams = new GlobalParams();
#endif
#endif
uMap = globalParams->getTextEncoding();