Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 949531
Collapse All | Expand All

(-)inkscape-1.4/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp (-9 / +41 lines)
Lines 407-420 CairoFreeTypeFont *CairoFreeTypeFont::cr Link Here
407
            break;
407
            break;
408
        case fontCIDType2:
408
        case fontCIDType2:
409
        case fontCIDType2OT:
409
        case fontCIDType2OT:
410
#if POPPLER_CHECK_VERSION(25,2,0)
411
            if (!gfxcid->getCIDToGID().empty()) {
412
                const auto src = gfxcid->getCIDToGID();
413
                codeToGID = std::move(src);
414
            }
415
#else
410
            if (gfxcid->getCIDToGID()) {
416
            if (gfxcid->getCIDToGID()) {
411
                n = gfxcid->getCIDToGIDLen();
417
                n = gfxcid->getCIDToGIDLen();
412
                if (n) {
418
                if (n) {
413
                    const int *src = gfxcid->getCIDToGID();
419
                    const auto src = gfxcid->getCIDToGID();
414
                    codeToGID.reserve(n);
420
                    codeToGID.reserve(n);
415
                    codeToGID.insert(codeToGID.begin(), src, src + n);
421
                    codeToGID.insert(codeToGID.begin(), src, src + n);
416
                }
422
                }
417
            } else {
423
            }
424
#endif
425
            else {
418
#if POPPLER_CHECK_VERSION(22, 1, 0)
426
#if POPPLER_CHECK_VERSION(22, 1, 0)
419
                std::unique_ptr<FoFiTrueType> ff;
427
                std::unique_ptr<FoFiTrueType> ff;
420
#else
428
#else
Lines 429-441 CairoFreeTypeFont *CairoFreeTypeFont::cr Link Here
429
                    goto err2;
437
                    goto err2;
430
                }
438
                }
431
#if POPPLER_CHECK_VERSION(22, 1, 0)
439
#if POPPLER_CHECK_VERSION(22, 1, 0)
432
                int *src = gfxcid->getCodeToGIDMap(ff.get(), &n);
440
                auto src = gfxcid->_POPPLER_GET_CODE_TO_GID_MAP(ff.get(), &n);
433
#else
441
#else
434
                int *src = gfxcid->getCodeToGIDMap(ff, &n);
442
                auto src = gfxcid->_POPPLER_GET_CODE_TO_GID_MAP(ff, &n);
435
#endif
443
#endif
444
445
#if POPPLER_CHECK_VERSION(25,2,0)
446
                codeToGID = std::move(src);
447
#else
436
                codeToGID.reserve(n);
448
                codeToGID.reserve(n);
437
                codeToGID.insert(codeToGID.begin(), src, src + n);
449
                codeToGID.insert(codeToGID.begin(), src, src + n);
438
                gfree(src);
450
                gfree(src);
451
#endif
439
            }
452
            }
440
            /* Fall through */
453
            /* Fall through */
441
        case fontTrueType:
454
        case fontTrueType:
Lines 457-469 CairoFreeTypeFont *CairoFreeTypeFont::cr Link Here
457
            /* This might be set already for the CIDType2 case */
470
            /* This might be set already for the CIDType2 case */
458
            if (fontType == fontTrueType || fontType == fontTrueTypeOT) {
471
            if (fontType == fontTrueType || fontType == fontTrueTypeOT) {
459
#if POPPLER_CHECK_VERSION(22, 1, 0)
472
#if POPPLER_CHECK_VERSION(22, 1, 0)
460
                int *src = gfx8bit->getCodeToGIDMap(ff.get());
473
                auto src = gfx8bit->getCodeToGIDMap(ff.get());
461
#else
474
#else
462
                int *src = gfx8bit->getCodeToGIDMap(ff);
475
                auto src = gfx8bit->getCodeToGIDMap(ff);
463
#endif
476
#endif
477
#if POPPLER_CHECK_VERSION(25,2,0)
478
                codeToGID = std::move(src);
479
#else
464
                codeToGID.reserve(256);
480
                codeToGID.reserve(256);
465
                codeToGID.insert(codeToGID.begin(), src, src + 256);
481
                codeToGID.insert(codeToGID.begin(), src, src + 256);
466
                gfree(src);
482
                gfree(src);
483
#endif
467
            }
484
            }
468
            font_face = getFreeTypeFontFace(fontEngine, lib, fileName, std::move(font_data));
485
            font_face = getFreeTypeFontFace(fontEngine, lib, fileName, std::move(font_data));
469
            if (!font_face) {
486
            if (!font_face) {
Lines 481-490 CairoFreeTypeFont *CairoFreeTypeFont::cr Link Here
481
                    ff1c = FoFiType1C::load(fileName.c_str());
498
                    ff1c = FoFiType1C::load(fileName.c_str());
482
                }
499
                }
483
                if (ff1c) {
500
                if (ff1c) {
484
                    int *src = ff1c->getCIDToGIDMap(&n);
501
                    auto src = ff1c->_POPPLER_GET_CID_TO_GID_MAP(&n);
502
#if POPPLER_CHECK_VERSION(25,2,0)
503
                    codeToGID = std::move(src);
504
#else
485
                    codeToGID.reserve(n);
505
                    codeToGID.reserve(n);
486
                    codeToGID.insert(codeToGID.begin(), src, src + n);
506
                    codeToGID.insert(codeToGID.begin(), src, src + n);
487
                    gfree(src);
507
                    gfree(src);
508
#endif
488
                    delete ff1c;
509
                    delete ff1c;
489
                }
510
                }
490
            }
511
            }
Lines 497-510 CairoFreeTypeFont *CairoFreeTypeFont::cr Link Here
497
            break;
518
            break;
498
519
499
        case fontCIDType0COT:
520
        case fontCIDType0COT:
521
#if POPPLER_CHECK_VERSION(25,2,0)
522
            if (!gfxcid->getCIDToGID().empty()) {
523
                const auto src = gfxcid->getCIDToGID();
524
                codeToGID = std::move(src);
525
            }
526
#else
500
            if (gfxcid->getCIDToGID()) {
527
            if (gfxcid->getCIDToGID()) {
501
                n = gfxcid->getCIDToGIDLen();
528
                n = gfxcid->getCIDToGIDLen();
502
                if (n) {
529
                if (n) {
503
                    const int *src = gfxcid->getCIDToGID();
530
                    const auto src = gfxcid->getCIDToGID();
504
                    codeToGID.reserve(n);
531
                    codeToGID.reserve(n);
505
                    codeToGID.insert(codeToGID.begin(), src, src + n);
532
                    codeToGID.insert(codeToGID.begin(), src, src + n);
506
                }
533
                }
507
            }
534
            }
535
#endif
508
536
509
            if (codeToGID.empty()) {
537
            if (codeToGID.empty()) {
510
                if (!useCIDs) {
538
                if (!useCIDs) {
Lines 520-529 CairoFreeTypeFont *CairoFreeTypeFont::cr Link Here
520
                    }
548
                    }
521
                    if (ff) {
549
                    if (ff) {
522
                        if (ff->isOpenTypeCFF()) {
550
                        if (ff->isOpenTypeCFF()) {
523
                            int *src = ff->getCIDToGIDMap(&n);
551
                            auto src = ff1c->_POPPLER_GET_CID_TO_GID_MAP(&n);
552
#if POPPLER_CHECK_VERSION(25,2,0)
553
                            codeToGID = std::move(src);
554
#else
524
                            codeToGID.reserve(n);
555
                            codeToGID.reserve(n);
525
                            codeToGID.insert(codeToGID.begin(), src, src + n);
556
                            codeToGID.insert(codeToGID.begin(), src, src + n);
526
                            gfree(src);
557
                            gfree(src);
558
#endif
527
                        }
559
                        }
528
                    }
560
                    }
529
                }
561
                }
(-)inkscape-1.4/src/extension/internal/pdfinput/poppler-transition-api.h (-6 / +14 lines)
Lines 15-20 Link Here
15
#include <glib/poppler-features.h>
15
#include <glib/poppler-features.h>
16
#include <poppler/UTF.h>
16
#include <poppler/UTF.h>
17
17
18
#if POPPLER_CHECK_VERSION(25,2,0)
19
#define _POPPLER_GET_CODE_TO_GID_MAP(ff, len) getCodeToGIDMap(ff)
20
#define _POPPLER_GET_CID_TO_GID_MAP(len) getCIDToGIDMap()
21
#else
22
#define _POPPLER_GET_CODE_TO_GID_MAP(ff, len) getCodeToGIDMap(ff, len)
23
#define _POPPLER_GET_CID_TO_GID_MAP(len) getCIDToGIDMap(len)
24
#endif
25
26
#if POPPLER_CHECK_VERSION(24,12,0)
27
#define _POPPLER_GET_IMAGE_PARAMS(bits, csMode, hasAlpha) getImageParams(bits, csMode, hasAlpha)
28
#else
29
#define _POPPLER_GET_IMAGE_PARAMS(bits, csMode, hasAlpha) getImageParams(bits, csMode)
30
#endif
31
18
#if POPPLER_CHECK_VERSION(24, 10, 0)
32
#if POPPLER_CHECK_VERSION(24, 10, 0)
19
#define _POPPLER_CONSUME_UNIQPTR_ARG(value) std::move(value)
33
#define _POPPLER_CONSUME_UNIQPTR_ARG(value) std::move(value)
20
#else
34
#else
Lines 39-50 Link Here
39
#define _POPPLER_FUNCTION_TYPE_STITCHING 3
53
#define _POPPLER_FUNCTION_TYPE_STITCHING 3
40
#endif
54
#endif
41
55
42
#if POPPLER_CHECK_VERSION(24,12,0)
43
#define _POPPLER_GET_IMAGE_PARAMS(bits, csMode, hasAlpha) getImageParams(bits, csMode, hasAlpha)
44
#else
45
#define _POPPLER_GET_IMAGE_PARAMS(bits, csMode, hasAlpha) getImageParams(bits, csMode)
46
#endif
47
48
#if POPPLER_CHECK_VERSION(22, 4, 0)
56
#if POPPLER_CHECK_VERSION(22, 4, 0)
49
#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
57
#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
50
#else
58
#else

Return to bug 949531