Browse Source

Add support for Poppler >= 0.72

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

Signed-off-by: OBATA Akio <obache@wizdas.com>
OBATA Akio 3 months ago
parent
commit
9d8dc22220

+ 1
- 0
config.h.cmake View File

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

+ 1
- 1
tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake View File

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

+ 1
- 1
tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc View File

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

+ 5
- 5
tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc View File

@@ -151,7 +151,7 @@ TQString Page::getText(const Rectangle &r) const
151 151
     s = output_dev->getText(r.m_x1, y1, r.m_x2, y2);
152 152
   }
153 153
 
154
-  result = TQString::fromUtf8(s->getCString());
154
+  result = TQString::fromUtf8(s->GOO_GET_CSTR());
155 155
 
156 156
   delete output_dev;
157 157
   delete s;
@@ -183,7 +183,7 @@ TQValueList<TextBox*> Page::textList() const
183 183
   for (int i = 0; i < word_list->getLength(); i++) {
184 184
     TextWord *word = word_list->get(i);
185 185
     GooString *word_str = word->getText();
186
-    TQString string = TQString::fromUtf8(word_str->getCString());
186
+    TQString string = TQString::fromUtf8(word_str->GOO_GET_CSTR());
187 187
     delete word_str;
188 188
     double xMin, yMin, xMax, yMax;
189 189
     word->getBBox(&xMin, &yMin, &xMax, &yMax);
@@ -303,13 +303,13 @@ TQValueList<Link*> Page::links() const
303 303
 	{
304 304
           LinkLaunch * e = (LinkLaunch *)a;
305 305
           GooString * p = e->getParams();
306
-          popplerLink = new LinkExecute( linkArea, e->getFileName()->getCString(), p ? p->getCString() : 0 );
306
+          popplerLink = new LinkExecute( linkArea, e->getFileName()->GOO_GET_CSTR(), p ? p->GOO_GET_CSTR() : 0 );
307 307
 	}
308 308
         break;
309 309
 
310 310
         case actionNamed:
311 311
 	{
312
-          const char * name = ((LinkNamed *)a)->getName()->getCString();
312
+          const char * name = ((LinkNamed *)a)->getName()->GOO_GET_CSTR();
313 313
           if ( !strcmp( name, "NextPage" ) )
314 314
               popplerLink = new LinkAction( linkArea, LinkAction::PageNext );
315 315
           else if ( !strcmp( name, "PrevPage" ) )
@@ -346,7 +346,7 @@ TQValueList<Link*> Page::links() const
346 346
 
347 347
         case actionURI:
348 348
 	{
349
-          popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI()->getCString() );
349
+          popplerLink = new LinkBrowse( linkArea, ((LinkURI *)a)->getURI()->GOO_GET_CSTR() );
350 350
 	}
351 351
         break;
352 352
 

+ 2
- 2
tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc View File

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

+ 5
- 0
tdefile-plugins/dependencies/poppler-tqt/poppler-private.h View File

@@ -44,6 +44,11 @@ class SplashOutputDev;
44 44
 #define gTrue  true
45 45
 #define gFalse false
46 46
 #endif
47
+#if defined(HAVE_POPPLER_072)
48
+#define GOO_GET_CSTR c_str
49
+#else
50
+#define GOO_GET_CSTR getCString
51
+#endif
47 52
 
48 53
 namespace Poppler {
49 54
     

Loading…
Cancel
Save