~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to debian/patches/0006-Fix_FTBFS_on_poppler-0.26.patch

  • Committer: Package Import Robot
  • Author(s): Alex Valavanis
  • Date: 2014-08-19 19:10:32 UTC
  • mfrom: (1.6.5) (2.5.14 sid)
  • Revision ID: package-import@ubuntu.com-20140819191032-2eca1qihaszjk9i6
Tags: 0.48.5-2ubuntu1
* Merge with Debian Unstable (LP: #1358863). Fixes several Ubuntu bugs:
  - Illustrator CS SVG won't load: namespace URIs in entities (LP: #166371)
  - inkscape crashed with SIGSEGV in
    sp_dtw_color_profile_event() (LP: #966441)
  - inkscape crashed with SIGSEGV (LP: #1051017)
  - inkscape crashed with SIGSEGV in Inkscape::Preferences::_getNode()
    (LP: #1163241)
  - save a copy reverts to save as (LP: #529843)
  - Extension to braille not working on Xubuntu 12.10 (LP: #1090865)
* Remaining changes:
  - debian/control:
    + Set Ubuntu Developer as maintainer,
    + build-depend on dh-translation to handle Ubuntu translation,
    + demote pstoedit from Recommends to Suggests (because it's in universe),
  - debian/patches/0006_add_unity_quicklist_support.patch: add.
  - debian/patches/series: update.
  - debian/rules:
    + add dh_translation to handle Ubuntu translation
* Drop debian/patches/librevenge.patch (superseded by
    debian/patches/0006-Update_to_new_libwpg.patch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: "Matteo F. Vescovi" <mfvescovi@gmail.com>
2
 
Date: Wed, 4 Jun 2014 17:14:51 +0200
3
 
Subject: Fix_FTBFS_on_poppler-0.26
4
 
 
5
 
Origin: upstream.
6
 
Bug: https://bugs.launchpad.net/inkscape/+bug/1315142
7
 
 
8
 
Thanks: Matthias Kilian for the patch.
9
 
---
10
 
 configure.ac                                   |  5 +++
11
 
 src/extension/internal/pdfinput/pdf-parser.cpp | 54 +++++++++++++++++++++-----
12
 
 2 files changed, 50 insertions(+), 9 deletions(-)
13
 
 
14
 
diff --git a/configure.ac b/configure.ac
15
 
index 0a19e48..9446d11 100644
16
 
--- a/configure.ac
17
 
+++ b/configure.ac
18
 
@@ -610,6 +610,11 @@ else
19
 
        AC_MSG_RESULT(no)
20
 
 fi
21
 
 
22
 
+PKG_CHECK_MODULES(POPPLER_EVEN_NEWER_COLOR_SPACE_API, poppler >= 0.26.0, popplernewercolorspaceapi=yes, popplernewercolorspaceapi=no)
23
 
+if test "x$popplernewercolorspaceapi" = "xyes"; then
24
 
+       AC_DEFINE(POPPLER_EVEN_NEWER_COLOR_SPACE_API, 1, [Use even newer color space API from Poppler >= 0.26.0])
25
 
+fi
26
 
+
27
 
 # Poppler's b604a008 commit changes this
28
 
 AC_MSG_CHECKING([whether Poppler's GfxPatch no longer uses GfxColor])
29
 
 popplergfxcolor="no"
30
 
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
31
 
index 045e214..b6edbfb 100644
32
 
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
33
 
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
34
 
@@ -860,7 +860,9 @@ void PdfParser::opSetExtGState(Object args[], int numArgs) {
35
 
          blendingColorSpace = NULL;
36
 
          isolated = knockout = gFalse;
37
 
          if (!obj4.dictLookup(const_cast<char*>("CS"), &obj5)->isNull()) {
38
 
-#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
39
 
+#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
40
 
+           blendingColorSpace = GfxColorSpace::parse(&obj5, NULL, NULL);
41
 
+#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
42
 
            blendingColorSpace = GfxColorSpace::parse(&obj5, NULL);
43
 
 #else
44
 
            blendingColorSpace = GfxColorSpace::parse(&obj5);
45
 
@@ -1083,7 +1085,13 @@ void PdfParser::opSetFillColorSpace(Object args[], int numArgs) {
46
 
 
47
 
   state->setFillPattern(NULL);
48
 
   res->lookupColorSpace(args[0].getName(), &obj);
49
 
-#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
50
 
+#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
51
 
+  if (obj.isNull()) {
52
 
+    colorSpace = GfxColorSpace::parse(&args[0], NULL, NULL);
53
 
+  } else {
54
 
+    colorSpace = GfxColorSpace::parse(&obj, NULL, NULL);
55
 
+  }
56
 
+#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
57
 
   if (obj.isNull()) {
58
 
     colorSpace = GfxColorSpace::parse(&args[0], NULL);
59
 
   } else {
60
 
@@ -1118,7 +1126,13 @@ void PdfParser::opSetStrokeColorSpace(Object args[], int numArgs) {
61
 
 
62
 
   state->setStrokePattern(NULL);
63
 
   res->lookupColorSpace(args[0].getName(), &obj);
64
 
-#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
65
 
+#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
66
 
+  if (obj.isNull()) {
67
 
+    colorSpace = GfxColorSpace::parse(&args[0], NULL, NULL);
68
 
+  } else {
69
 
+    colorSpace = GfxColorSpace::parse(&obj, NULL, NULL);
70
 
+  }
71
 
+#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
72
 
   if (obj.isNull()) {
73
 
     colorSpace = GfxColorSpace::parse(&args[0], NULL);
74
 
   } else {
75
 
@@ -1211,7 +1225,13 @@ void PdfParser::opSetFillColorN(Object args[], int numArgs) {
76
 
       state->setFillColor(&color);
77
 
       builder->updateStyle(state);
78
 
     }
79
 
-#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
80
 
+#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
81
 
+    if (args[numArgs-1].isName() &&
82
 
+       (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL, NULL))) {
83
 
+      state->setFillPattern(pattern);
84
 
+      builder->updateStyle(state);
85
 
+    }
86
 
+#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
87
 
     if (args[numArgs-1].isName() &&
88
 
        (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) {
89
 
       state->setFillPattern(pattern);
90
 
@@ -1271,7 +1291,13 @@ void PdfParser::opSetStrokeColorN(Object args[], int numArgs) {
91
 
       state->setStrokeColor(&color);
92
 
       builder->updateStyle(state);
93
 
     }
94
 
-#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
95
 
+#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
96
 
+    if (args[numArgs-1].isName() &&
97
 
+       (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL, NULL))) {
98
 
+      state->setStrokePattern(pattern);
99
 
+      builder->updateStyle(state);
100
 
+    }
101
 
+#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
102
 
     if (args[numArgs-1].isName() &&
103
 
        (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) {
104
 
       state->setStrokePattern(pattern);
105
 
@@ -1710,7 +1736,11 @@ void PdfParser::opShFill(Object args[], int numArgs) {
106
 
   double *matrix = NULL;
107
 
   GBool savedState = gFalse;
108
 
 
109
 
-#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
110
 
+#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
111
 
+  if (!(shading = res->lookupShading(args[0].getName(), NULL, NULL))) {
112
 
+    return;
113
 
+  }
114
 
+#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
115
 
   if (!(shading = res->lookupShading(args[0].getName(), NULL))) {
116
 
     return;
117
 
   }
118
 
@@ -2726,7 +2756,9 @@ void PdfParser::doImage(Object *ref, Stream *str, GBool inlineImg) {
119
 
       }
120
 
     }
121
 
     if (!obj1.isNull()) {
122
 
-#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
123
 
+#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
124
 
+            colorSpace = GfxColorSpace::parse(&obj1, NULL, NULL);
125
 
+#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
126
 
       colorSpace = GfxColorSpace::parse(&obj1, NULL);
127
 
 #else
128
 
       colorSpace = GfxColorSpace::parse(&obj1);
129
 
@@ -2815,7 +2847,9 @@ void PdfParser::doImage(Object *ref, Stream *str, GBool inlineImg) {
130
 
          obj2.free();
131
 
        }
132
 
       }
133
 
-#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
134
 
+#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
135
 
+            GfxColorSpace *maskColorSpace = GfxColorSpace::parse(&obj1, NULL, NULL);
136
 
+#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
137
 
       maskColorSpace = GfxColorSpace::parse(&obj1, NULL);
138
 
 #else
139
 
       maskColorSpace = GfxColorSpace::parse(&obj1);
140
 
@@ -3006,7 +3040,9 @@ void PdfParser::doForm(Object *str) {
141
 
     if (obj1.dictLookup(const_cast<char*>("S"), &obj2)->isName(const_cast<char*>("Transparency"))) {
142
 
       transpGroup = gTrue;
143
 
       if (!obj1.dictLookup(const_cast<char*>("CS"), &obj3)->isNull()) {
144
 
-#if defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
145
 
+#if defined(POPPLER_EVEN_NEWER_COLOR_SPACE_API)
146
 
+       blendingColorSpace = GfxColorSpace::parse(&obj3, NULL, NULL);
147
 
+#elif defined(POPPLER_NEW_COLOR_SPACE_API) || defined(POPPLER_NEW_ERRORAPI)
148
 
        blendingColorSpace = GfxColorSpace::parse(&obj3, NULL);
149
 
 #else
150
 
        blendingColorSpace = GfxColorSpace::parse(&obj3);