summaryrefslogtreecommitdiffstats
path: root/src/poppler-1-win32.patch
blob: 19f706b8162852a2524c47f2a24b2520260f70f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
This file is part of MXE.
See index.html for further information.

From 5aede813b0cfdf672241f925bc34b766cf567a0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20L=C3=B6ffler?= <st.loeffler@gmail.com>
Date: Sat, 21 Apr 2012 09:34:46 +0200
Subject: [PATCH 1/3] Only check for Type1 fonts in custom directory if path
 is non-NULL

Otherwise, programs using poppler may crash
Proposed upstream at https://bugs.freedesktop.org/show_bug.cgi?id=49037
---
 poppler/GlobalParamsWin.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
index b77ac4f..f660224 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -423,7 +423,7 @@ void GlobalParams::setupBaseFonts(char * dir)
         if (fontFiles->lookup(fontName))
             continue;
 
-        if (dir) {
+        if (dir && displayFontTab[i].t1FileName) {
             GooString *fontPath = appendToPath(new GooString(dir), displayFontTab[i].t1FileName);
             if (FileExists(fontPath->getCString()) ||
                 FileExists(replaceSuffix(fontPath, ".pfb", ".pfa")->getCString())) {
-- 
1.7.10.4


From 944b910b4ede55c0b1dca5169960068fb9d1d0a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20L=C3=B6ffler?= <st.loeffler@gmail.com>
Date: Sat, 21 Apr 2012 13:19:54 +0200
Subject: [PATCH 2/3] Don't use dllimport/dllexport

Otherwise static linking fails
MXE workaround for https://bugs.freedesktop.org/show_bug.cgi?id=49038 (presumably would break shared linking!)
---
 cpp/poppler-global.h     |    5 -----
 poppler/XpdfPluginAPI.h  |   18 ------------------
 qt4/src/poppler-export.h |    5 -----
 3 files changed, 28 deletions(-)

diff --git a/cpp/poppler-global.h b/cpp/poppler-global.h
index 5650182..6c3e01b 100644
--- a/cpp/poppler-global.h
+++ b/cpp/poppler-global.h
@@ -20,13 +20,8 @@
 #ifndef POPPLER_GLOBAL_H
 #define POPPLER_GLOBAL_H
 
-#if defined(_WIN32)
-#  define LIB_EXPORT __declspec(dllexport)
-#  define LIB_IMPORT __declspec(dllimport)
-#else
 #  define LIB_EXPORT
 #  define LIB_IMPORT
-#endif
 
 #if defined(poppler_cpp_EXPORTS)
 #  define POPPLER_CPP_EXPORT LIB_EXPORT
diff --git a/poppler/XpdfPluginAPI.h b/poppler/XpdfPluginAPI.h
index b0165c0..5a10595 100644
--- a/poppler/XpdfPluginAPI.h
+++ b/poppler/XpdfPluginAPI.h
@@ -42,19 +42,11 @@ extern "C" {
  */
 #define xpdfPluginAPIVersion 1
 
-#ifdef _WIN32
-#  ifdef __cplusplus
-#    define PLUGINFUNC(retType) extern "C" __declspec(dllexport) retType
-#  else
-#    define PLUGINFUNC(retType) extern __declspec(dllexport) retType
-#  endif
-#else
 #  ifdef __cplusplus
 #    define PLUGINFUNC(retType) extern "C" retType
 #  else
 #    define PLUGINFUNC(retType) extern retType
 #  endif
-#endif
 
 /*------------------------------------------------------------------------
  * Plugin setup/cleanup
@@ -281,22 +273,12 @@ void (*_xpdfRegisterSecurityHandler)(XpdfSecurityHandler *handler);
 
 } XpdfPluginVecTable;
 
-#ifdef _WIN32
-
-extern __declspec(dllexport) XpdfPluginVecTable xpdfPluginVecTable;
-
-#define xpdfPluginSetup \
-  extern __declspec(dllexport) \
-  XpdfPluginVecTable xpdfPluginVecTable = {xpdfPluginAPIVersion};
-
-#else
 
 extern XpdfPluginVecTable xpdfPluginVecTable;
 
 #define xpdfPluginSetup \
   XpdfPluginVecTable xpdfPluginVecTable = {xpdfPluginAPIVersion};
 
-#endif
 
 #define xpdfGetInfoDict (*xpdfPluginVecTable._xpdfGetInfoDict)
 #define xpdfGetCatalog (*xpdfPluginVecTable._xpdfGetCatalog)
diff --git a/qt4/src/poppler-export.h b/qt4/src/poppler-export.h
index 7661fe9..ebb1e18 100644
--- a/qt4/src/poppler-export.h
+++ b/qt4/src/poppler-export.h
@@ -2,13 +2,8 @@
 * This file is used to set the poppler_qt4_EXPORT macros right.
 * This is needed for setting the visibility on windows, it will have no effect on other platforms.
 */
-#if defined(_WIN32)
-# define LIB_EXPORT __declspec(dllexport)
-# define LIB_IMPORT __declspec(dllimport)
-#else
 # define LIB_EXPORT
 # define LIB_IMPORT
-#endif
 
 #ifdef poppler_qt4_EXPORTS
 # define POPPLER_QT4_EXPORT LIB_EXPORT
-- 
1.7.10.4


From 66acb0dedae6564d1975d652abca10b18ab4eb46 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Thu, 14 Jun 2012 17:08:58 +0200
Subject: [PATCH 3/3] fix typo

taken from
https://bugs.freedesktop.org/show_bug.cgi?id=51079
---
 poppler/GlobalParamsWin.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
index f660224..0e691eb 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -573,7 +573,7 @@ GooString *GlobalParams::findSystemFontFile(GfxFont *font,
     *type = fi->type;
     *fontNum = fi->fontNum;
     if (substituteFontName)
-      substituteFontName.Set(fi->substituteName->getCString());
+      substituteFontName->Set(fi->substituteName->getCString());
   } else {
     GooString *substFontName = new GooString(findSubstituteName(font, fontFiles,
                                                                 substFiles,
-- 
1.7.10.4