Add support for Poppler >= 0.72

GooString::getCString was renamed to GooString::c_str.

Signed-off-by: OBATA Akio <obache@wizdas.com>
(cherry picked from commit 9d8dc22220)
r14.0.x
OBATA Akio 6 years ago committed by Slávek Banko
parent 11532d48b2
commit 2b3cfb4123
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -1,6 +1,7 @@
#cmakedefine VERSION "@VERSION@" #cmakedefine VERSION "@VERSION@"
// poppler-tqt // poppler-tqt
#cmakedefine HAVE_POPPLER_072
#cmakedefine HAVE_POPPLER_071 #cmakedefine HAVE_POPPLER_071
#cmakedefine HAVE_POPPLER_070 #cmakedefine HAVE_POPPLER_070
#cmakedefine HAVE_POPPLER_064 #cmakedefine HAVE_POPPLER_064

@ -24,7 +24,7 @@ check_cxx_source_compiles("
HAVE_POPPLER_030 ) HAVE_POPPLER_030 )
tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
foreach( _poppler_ver 0.58 0.64 0.70 0.71 ) foreach( _poppler_ver 0.58 0.64 0.70 0.71 0.72 )
string( REPLACE "." "" _poppler_str "${_poppler_ver}" ) string( REPLACE "." "" _poppler_str "${_poppler_ver}" )
if( NOT DEFINED HAVE_POPPLER_${_poppler_str} ) if( NOT DEFINED HAVE_POPPLER_${_poppler_str} )
message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str}" ) message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str}" )

@ -135,7 +135,7 @@ bool Document::scanForFonts( int numPages, TQValueList<FontInfo> *fontList ) con
for ( int i = 0; i < items->getLength(); ++i ) { for ( int i = 0; i < items->getLength(); ++i ) {
TQString fontName; TQString fontName;
if (((::FontInfo*)items->get(i))->getName()) if (((::FontInfo*)items->get(i))->getName())
fontName = ((::FontInfo*)items->get(i))->getName()->getCString(); fontName = ((::FontInfo*)items->get(i))->getName()->GOO_GET_CSTR();
FontInfo font(fontName, FontInfo font(fontName,
((::FontInfo*)items->get(i))->getEmbedded(), ((::FontInfo*)items->get(i))->getEmbedded(),

@ -151,7 +151,7 @@ TQString Page::getText(const Rectangle &r) const
s = output_dev->getText(r.m_x1, y1, r.m_x2, y2); s = output_dev->getText(r.m_x1, y1, r.m_x2, y2);
} }
result = TQString::fromUtf8(s->getCString()); result = TQString::fromUtf8(s->GOO_GET_CSTR());
delete output_dev; delete output_dev;
delete s; delete s;
@ -183,7 +183,7 @@ TQValueList<TextBox*> Page::textList() const
for (int i = 0; i < word_list->getLength(); i++) { for (int i = 0; i < word_list->getLength(); i++) {
TextWord *word = word_list->get(i); TextWord *word = word_list->get(i);
GooString *word_str = word->getText(); GooString *word_str = word->getText();
TQString string = TQString::fromUtf8(word_str->getCString()); TQString string = TQString::fromUtf8(word_str->GOO_GET_CSTR());
delete word_str; delete word_str;
double xMin, yMin, xMax, yMax; double xMin, yMin, xMax, yMax;
word->getBBox(&xMin, &yMin, &xMax, &yMax); word->getBBox(&xMin, &yMin, &xMax, &yMax);
@ -303,13 +303,13 @@ TQValueList<Link*> Page::links() const
{ {
LinkLaunch * e = (LinkLaunch *)a; LinkLaunch * e = (LinkLaunch *)a;
GooString * p = e->getParams(); GooString * p = e->getParams();
popplerLink = new LinkExecute( linkArea, e->getFileName()->getCString(), p ? p->getCString() : 0 ); popplerLink = new LinkExecute( linkArea, e->getFileName()->GOO_GET_CSTR(), p ? p->GOO_GET_CSTR() : 0 );
} }
break; break;
case actionNamed: case actionNamed:
{ {
const char * name = ((LinkNamed *)a)->getName()->getCString(); const char * name = ((LinkNamed *)a)->getName()->GOO_GET_CSTR();
if ( !strcmp( name, "NextPage" ) ) if ( !strcmp( name, "NextPage" ) )
popplerLink = new LinkAction( linkArea, LinkAction::PageNext ); popplerLink = new LinkAction( linkArea, LinkAction::PageNext );
else if ( !strcmp( name, "PrevPage" ) ) else if ( !strcmp( name, "PrevPage" ) )
@ -346,7 +346,7 @@ TQValueList<Link*> Page::links() const
case actionURI: case actionURI:
{ {
popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI()->getCString() ); popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI()->GOO_GET_CSTR() );
} }
break; break;

@ -119,7 +119,7 @@ void DocumentData::addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, C
// so better storing the reference and provide the viewport on demand // so better storing the reference and provide the viewport on demand
CONST_064 GooString *s = g->getNamedDest(); CONST_064 GooString *s = g->getNamedDest();
TQChar *charArray = new TQChar[s->getLength()]; TQChar *charArray = new TQChar[s->getLength()];
for (int i = 0; i < s->getLength(); ++i) charArray[i] = TQChar(s->getCString()[i]); for (int i = 0; i < s->getLength(); ++i) charArray[i] = TQChar(s->GOO_GET_CSTR()[i]);
TQString aux(charArray, s->getLength()); TQString aux(charArray, s->getLength());
item.setAttribute( "DestinationName", aux ); item.setAttribute( "DestinationName", aux );
delete[] charArray; delete[] charArray;
@ -132,7 +132,7 @@ void DocumentData::addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, C
if ( a->getKind() == actionGoToR ) if ( a->getKind() == actionGoToR )
{ {
CONST_064 LinkGoToR * g2 = static_cast< CONST_064 LinkGoToR * >( a ); CONST_064 LinkGoToR * g2 = static_cast< CONST_064 LinkGoToR * >( a );
item.setAttribute( "ExternalFileName", g2->getFileName()->getCString() ); item.setAttribute( "ExternalFileName", g2->getFileName()->GOO_GET_CSTR() );
} }
} }

@ -44,6 +44,11 @@ class SplashOutputDev;
#define gTrue true #define gTrue true
#define gFalse false #define gFalse false
#endif #endif
#if defined(HAVE_POPPLER_072)
#define GOO_GET_CSTR c_str
#else
#define GOO_GET_CSTR getCString
#endif
namespace Poppler { namespace Poppler {

Loading…
Cancel
Save