Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 426584 | Differences between
and this patch

Collapse All | Expand All

(-)/branches/1.9/gdal/configure (+20 lines)
Lines 639-642 Link Here
639
HAVE_PODOFO
639
HAVE_PODOFO
640
POPPLER_INC
640
POPPLER_INC
641
POPPLER_0_20_OR_LATER
641
POPPLER_BASE_STREAM_HAS_TWO_ARGS
642
POPPLER_BASE_STREAM_HAS_TWO_ARGS
642
POPPLER_HAS_OPTCONTENT
643
POPPLER_HAS_OPTCONTENT
Lines 26470-26473 Link Here
26470
POPPLER_HAS_OPTCONTENT=no
26471
POPPLER_HAS_OPTCONTENT=no
26471
POPPLER_BASE_STREAM_HAS_TWO_ARGS=no
26472
POPPLER_BASE_STREAM_HAS_TWO_ARGS=no
26473
POPPLER_0_20_OR_LATER=no
26472
26474
26473
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for poppler" >&5
26475
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for poppler" >&5
Lines 26536-26539 Link Here
26536
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
26538
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
26537
$as_echo "yes" >&6; }
26539
$as_echo "yes" >&6; }
26540
26541
            # And now we check if we have Poppler >= 0.20.0
26542
            { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have Poppler >= 0.20.0" >&5
26543
$as_echo_n "checking if we have Poppler >= 0.20.0... " >&6; }
26544
            rm -f testpoppler.*
26545
            echo '#include <poppler/Error.h>' > testpoppler.cpp
26546
            echo 'int main(int argc, char** argv) { setErrorCallback(0,0); return 0; }' >> testpoppler.cpp
26547
            if test -z "`${CXX} testpoppler.cpp -c ${POPPLER_INC} 2>&1`" ; then
26548
                POPPLER_0_20_OR_LATER=yes
26549
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
26550
$as_echo "yes" >&6; }
26551
            else
26552
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
26553
$as_echo "no" >&6; }
26554
            fi
26555
26538
        else
26556
        else
26539
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
26557
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
Lines 26556-26559 Link Here
26556
26574
26557
POPPLER_BASE_STREAM_HAS_TWO_ARGS=$POPPLER_BASE_STREAM_HAS_TWO_ARGS
26575
POPPLER_BASE_STREAM_HAS_TWO_ARGS=$POPPLER_BASE_STREAM_HAS_TWO_ARGS
26576
26577
POPPLER_0_20_OR_LATER=$POPPLER_0_20_OR_LATER
26558
26578
26559
POPPLER_INC=$POPPLER_INC
26579
POPPLER_INC=$POPPLER_INC
(-)/branches/1.9/gdal/nmake.opt (+2 lines)
Lines 469-476 Link Here
469
# Uncomment for PDF support
469
# Uncomment for PDF support
470
# Uncomment POPPLER_BASE_STREAM_HAS_TWO_ARGS = YES for Poppler >= 0.16.0
470
# Uncomment POPPLER_BASE_STREAM_HAS_TWO_ARGS = YES for Poppler >= 0.16.0
471
# Uncomment POPPLER_0_20_OR_LATER = YES for Poppler >= 0.20.0
471
#POPPLER_ENABLED = YES
472
#POPPLER_ENABLED = YES
472
#POPPLER_CFLAGS = -Ie:/kde/include -Ie:/kde/include/poppler
473
#POPPLER_CFLAGS = -Ie:/kde/include -Ie:/kde/include/poppler
473
#POPPLER_HAS_OPTCONTENT = YES
474
#POPPLER_HAS_OPTCONTENT = YES
474
#POPPLER_BASE_STREAM_HAS_TWO_ARGS = YES
475
#POPPLER_BASE_STREAM_HAS_TWO_ARGS = YES
476
#POPPLER_0_20_OR_LATER = YES
475
#POPPLER_LIBS = e:/kde/lib/poppler.lib e:/kde/lib/freetype.lib e:/kde/lib/liblcms-1.lib advapi32.lib gdi32.lib
477
#POPPLER_LIBS = e:/kde/lib/poppler.lib e:/kde/lib/freetype.lib e:/kde/lib/liblcms-1.lib advapi32.lib gdi32.lib
476
478
(-)/branches/1.9/gdal/configure.in (+15 lines)
Lines 2941-2944 Link Here
2941
POPPLER_HAS_OPTCONTENT=no
2941
POPPLER_HAS_OPTCONTENT=no
2942
POPPLER_BASE_STREAM_HAS_TWO_ARGS=no
2942
POPPLER_BASE_STREAM_HAS_TWO_ARGS=no
2943
POPPLER_0_20_OR_LATER=no
2943
2944
2944
AC_MSG_CHECKING([for poppler])
2945
AC_MSG_CHECKING([for poppler])
Lines 3000-3003 Link Here
3000
            POPPLER_BASE_STREAM_HAS_TWO_ARGS=yes
3001
            POPPLER_BASE_STREAM_HAS_TWO_ARGS=yes
3001
            AC_MSG_RESULT([yes])
3002
            AC_MSG_RESULT([yes])
3003
3004
            # And now we check if we have Poppler >= 0.20.0
3005
            AC_MSG_CHECKING([if we have Poppler >= 0.20.0])
3006
            rm -f testpoppler.*
3007
            echo '#include <poppler/Error.h>' > testpoppler.cpp
3008
            echo 'int main(int argc, char** argv) { setErrorCallback(0,0); return 0; }' >> testpoppler.cpp
3009
            if test -z "`${CXX} testpoppler.cpp -c ${POPPLER_INC} 2>&1`" ; then
3010
                POPPLER_0_20_OR_LATER=yes
3011
                AC_MSG_RESULT([yes])
3012
            else
3013
                AC_MSG_RESULT([no])
3014
            fi
3015
3002
        else
3016
        else
3003
            AC_MSG_RESULT([no])
3017
            AC_MSG_RESULT([no])
Lines 3015-3018 Link Here
3015
AC_SUBST(POPPLER_HAS_OPTCONTENT, $POPPLER_HAS_OPTCONTENT)
3029
AC_SUBST(POPPLER_HAS_OPTCONTENT, $POPPLER_HAS_OPTCONTENT)
3016
AC_SUBST(POPPLER_BASE_STREAM_HAS_TWO_ARGS, $POPPLER_BASE_STREAM_HAS_TWO_ARGS)
3030
AC_SUBST(POPPLER_BASE_STREAM_HAS_TWO_ARGS, $POPPLER_BASE_STREAM_HAS_TWO_ARGS)
3031
AC_SUBST(POPPLER_0_20_OR_LATER, $POPPLER_0_20_OR_LATER)
3017
AC_SUBST(POPPLER_INC, $POPPLER_INC)
3032
AC_SUBST(POPPLER_INC, $POPPLER_INC)
3018
3033
(-)/branches/1.9/gdal/frmts/pdf/pdfdataset.cpp (+24 lines)
Lines 327-331 Link Here
327
        poSplashOut = new SplashOutputDev(splashModeRGB8, 4, gFalse, sColor);
327
        poSplashOut = new SplashOutputDev(splashModeRGB8, 4, gFalse, sColor);
328
        PDFDoc* poDoc = poGDS->poDoc;
328
        PDFDoc* poDoc = poGDS->poDoc;
329
#ifdef POPPLER_0_20_OR_LATER
330
        poSplashOut->startDoc(poDoc);
331
#else
329
        poSplashOut->startDoc(poDoc->getXRef());
332
        poSplashOut->startDoc(poDoc->getXRef());
333
#endif
330
        double dfDPI = poGDS->dfDPI;
334
        double dfDPI = poGDS->dfDPI;
331
335
Lines 518-521 Link Here
518
522
519
#ifdef USE_POPPLER
523
#ifdef USE_POPPLER
524
#ifdef POPPLER_0_20_OR_LATER
525
static void PDFDatasetErrorFunction(void* userData, ErrorCategory eErrCatagory, int nPos, char *pszMsg)
526
{
527
    CPLString osError;
528
529
    if (nPos >= 0)
530
        osError.Printf("Pos = %d, ", nPos);
531
    osError += pszMsg;
532
533
    if (strcmp(osError.c_str(), "Incorrect password") == 0)
534
        return;
535
536
    CPLError(CE_Failure, CPLE_AppDefined, "%s", osError.c_str());
537
}
538
#else
520
static void PDFDatasetErrorFunction(int nPos, char *pszMsg, va_list args)
539
static void PDFDatasetErrorFunction(int nPos, char *pszMsg, va_list args)
521
{
540
{
Lines 531-534 Link Here
531
    CPLError(CE_Failure, CPLE_AppDefined, "%s", osError.c_str());
550
    CPLError(CE_Failure, CPLE_AppDefined, "%s", osError.c_str());
532
}
551
}
552
#endif
533
#endif
553
#endif
534
554
Lines 567-571 Link Here
567
587
568
    /* Set custom error handler for poppler errors */
588
    /* Set custom error handler for poppler errors */
589
#ifdef POPPLER_0_20_OR_LATER
590
    setErrorCallback(PDFDatasetErrorFunction, NULL);
591
#else
569
    setErrorFunction(PDFDatasetErrorFunction);
592
    setErrorFunction(PDFDatasetErrorFunction);
593
#endif
570
594
571
    /* poppler global variable */
595
    /* poppler global variable */
(-)/branches/1.9/gdal/frmts/pdf/makefile.vc (-1 / +5 lines)
Lines 7-11 Link Here
7
7
8
!IFDEF POPPLER_ENABLED
8
!IFDEF POPPLER_ENABLED
9
EXTRAFLAGS = $(POPPLER_CFLAGS) $(POPPLER_HAS_OPTCONTENT_FLAGS) $(POPPLER_BASE_STREAM_HAS_TWO_ARGS_FLAGS) -DUSE_POPPLER
9
EXTRAFLAGS = $(POPPLER_CFLAGS) $(POPPLER_HAS_OPTCONTENT_FLAGS) $(POPPLER_BASE_STREAM_HAS_TWO_ARGS_FLAGS) $(POPPLER_0_20_OR_LATER_FLAGS) -DUSE_POPPLER
10
10
11
!IFDEF POPPLER_HAS_OPTCONTENT
11
!IFDEF POPPLER_HAS_OPTCONTENT
Lines 15-18 Link Here
15
!IFDEF POPPLER_BASE_STREAM_HAS_TWO_ARGS
15
!IFDEF POPPLER_BASE_STREAM_HAS_TWO_ARGS
16
POPPLER_BASE_STREAM_HAS_TWO_ARGS_FLAGS = -DPOPPLER_BASE_STREAM_HAS_TWO_ARGS
16
POPPLER_BASE_STREAM_HAS_TWO_ARGS_FLAGS = -DPOPPLER_BASE_STREAM_HAS_TWO_ARGS
17
!ENDIF
18
19
!IFDEF POPPLER_0_20_OR_LATER
20
POPPLER_0_20_OR_LATER_FLAGS = -DPOPPLER_0_20_OR_LATER
17
!ENDIF
21
!ENDIF
18
22
(-)/branches/1.9/gdal/frmts/pdf/GNUmakefile (+5 lines)
Lines 16-19 Link Here
16
endif
16
endif
17
17
18
ifeq ($(POPPLER_0_20_OR_LATER),yes)
19
CPPFLAGS +=  -DPOPPLER_0_20_OR_LATER
20
endif
21
22
18
CPPFLAGS	:=	$(GDAL_INCLUDE) $(CPPFLAGS) $(POPPLER_INC) $(PODOFO_INC)
23
CPPFLAGS	:=	$(GDAL_INCLUDE) $(CPPFLAGS) $(POPPLER_INC) $(PODOFO_INC)
19
24
(-)/branches/1.9/gdal/GDALmake.opt.in (+1 lines)
Lines 386-389 Link Here
386
POPPLER_HAS_OPTCONTENT = @POPPLER_HAS_OPTCONTENT@
386
POPPLER_HAS_OPTCONTENT = @POPPLER_HAS_OPTCONTENT@
387
POPPLER_BASE_STREAM_HAS_TWO_ARGS = @POPPLER_BASE_STREAM_HAS_TWO_ARGS@
387
POPPLER_BASE_STREAM_HAS_TWO_ARGS = @POPPLER_BASE_STREAM_HAS_TWO_ARGS@
388
POPPLER_0_20_OR_LATER = @POPPLER_0_20_OR_LATER@
388
POPPLER_INC = @POPPLER_INC@
389
POPPLER_INC = @POPPLER_INC@
389
390

Return to bug 426584