]>
Commit | Line | Data |
---|---|---|
1b7df6e5 JR |
1 | --- scribus-1.5.6/scribus/plugins/import/pdf/importpdf.cpp |
2 | +++ scribus-1.5.6/scribus/plugins/import/pdf/importpdf.cpp | |
3 | @@ -792,14 +792,15 @@ bool PdfPlug::convert(const QString& fn) | |
4 | names = catDict.dictLookup("OpenAction");\r | |
5 | if (names.isDict())\r | |
6 | {\r | |
7 | - LinkAction *linkAction = nullptr;\r | |
8 | + std::unique_ptr<::LinkAction> linkAction;\r | |
9 | linkAction = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());\r | |
10 | if (linkAction)\r | |
11 | {\r | |
12 | - LinkJavaScript *jsa = (LinkJavaScript*)linkAction;\r | |
13 | + LinkJavaScript *jsa = static_cast<LinkJavaScript *>(linkAction.get()); | |
14 | if (jsa->isOk())\r | |
15 | {\r | |
16 | - QString script = UnicodeParsedString(jsa->getScript());\r | |
17 | + const GooString scriptGooString(jsa->getScript()); | |
18 | + QString script = UnicodeParsedString(&scriptGooString);\r | |
19 | if (script.startsWith("this."))\r | |
20 | {\r | |
21 | script.remove(0, 5);\r | |
22 | --- scribus-1.5.6/scribus/plugins/import/pdf/slaoutput.cpp | |
23 | +++ scribus-1.5.6/scribus/plugins/import/pdf/slaoutput.cpp | |
24 | @@ -324,7 +324,7 @@ LinkAction* SlaOutputDev::SC_getAddition | |
25 | {\r | |
26 | Object actionObject = additionalActionsObject.dictLookup(key);\r | |
27 | if (actionObject.isDict())\r | |
28 | - linkAction = LinkAction::parseAction(&actionObject, pdfDoc->getCatalog()->getBaseURI());\r | |
29 | + linkAction = (LinkAction::parseAction(&actionObject, pdfDoc->getCatalog()->getBaseURI())).release();\r | |
30 | }\r | |
31 | }\r | |
32 | return linkAction;\r | |
33 | @@ -455,7 +455,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot | |
34 | POPPLER_CONST GooString *ndst = gto->getNamedDest();\r | |
35 | if (ndst)\r | |
36 | {\r | |
37 | - LinkDest *dstn = pdfDoc->findDest(ndst);\r | |
38 | + std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);\r | |
39 | if (dstn)\r | |
40 | {\r | |
41 | if (dstn->getKind() == destXYZ)\r | |
42 | @@ -499,7 +499,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot | |
43 | POPPLER_CONST GooString *ndst = gto->getNamedDest();\r | |
44 | if (ndst)\r | |
45 | {\r | |
46 | - LinkDest *dstn = pdfDoc->findDest(ndst);\r | |
47 | + std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);\r | |
48 | if (dstn)\r | |
49 | {\r | |
50 | if (dstn->getKind() == destXYZ)\r | |
51 | @@ -516,8 +516,9 @@ bool SlaOutputDev::handleLinkAnnot(Annot | |
52 | else if (act->getKind() == actionURI)\r | |
53 | {\r | |
54 | LinkURI *gto = (LinkURI*)act;\r | |
55 | + const GooString uriGooString(gto->getURI()); | |
56 | validLink = true;\r | |
57 | - fileName = UnicodeParsedString(gto->getURI());\r | |
58 | + fileName = UnicodeParsedString(&uriGooString);\r | |
59 | }\r | |
60 | if (validLink)\r | |
61 | {\r | |
62 | @@ -929,8 +930,9 @@ void SlaOutputDev::handleActions(PageIte | |
63 | LinkJavaScript *jsa = (LinkJavaScript*)Lact;\r | |
64 | if (jsa->isOk())\r | |
65 | {\r | |
66 | + const GooString scriptGooString(jsa->getScript()); | |
67 | ite->annotation().setActionType(1);\r | |
68 | - ite->annotation().setAction(UnicodeParsedString(jsa->getScript()));\r | |
69 | + ite->annotation().setAction(UnicodeParsedString(&scriptGooString));\r | |
70 | }\r | |
71 | }\r | |
72 | else if (Lact->getKind() == actionGoTo)\r | |
73 | @@ -967,7 +969,7 @@ void SlaOutputDev::handleActions(PageIte | |
74 | POPPLER_CONST GooString *ndst = gto->getNamedDest();\r | |
75 | if (ndst)\r | |
76 | {\r | |
77 | - LinkDest *dstn = pdfDoc->findDest(ndst);\r | |
78 | + std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);\r | |
79 | if (dstn)\r | |
80 | {\r | |
81 | if (dstn->getKind() == destXYZ)\r | |
82 | @@ -1019,7 +1021,7 @@ void SlaOutputDev::handleActions(PageIte | |
83 | POPPLER_CONST GooString *ndst = gto->getNamedDest();\r | |
84 | if (ndst)\r | |
85 | {\r | |
86 | - LinkDest *dstn = pdfDoc->findDest(ndst);\r | |
87 | + std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);\r | |
88 | if (dstn)\r | |
89 | {\r | |
90 | if (dstn->getKind() == destXYZ)\r | |
91 | @@ -1039,7 +1041,8 @@ void SlaOutputDev::handleActions(PageIte | |
92 | else if (Lact->getKind() == actionUnknown)\r | |
93 | {\r | |
94 | LinkUnknown *uno = (LinkUnknown*)Lact;\r | |
95 | - QString actString = UnicodeParsedString(uno->getAction());\r | |
96 | + const GooString actionGooString(uno->getAction()); | |
97 | + QString actString = UnicodeParsedString(&actionGooString);\r | |
98 | if (actString == "ResetForm")\r | |
99 | {\r | |
100 | ite->annotation().setActionType(4);\r | |
101 | @@ -1082,8 +1085,9 @@ void SlaOutputDev::handleActions(PageIte | |
102 | else if (Lact->getKind() == actionNamed)\r | |
103 | {\r | |
104 | LinkNamed *uno = (LinkNamed*)Lact;\r | |
105 | + const GooString nameGooString(uno->getName()); | |
106 | ite->annotation().setActionType(10);\r | |
107 | - ite->annotation().setAction(UnicodeParsedString(uno->getName()));\r | |
108 | + ite->annotation().setAction(UnicodeParsedString(&nameGooString));\r | |
109 | }\r | |
110 | else\r | |
111 | qDebug() << "Found unsupported Action of type" << Lact->getKind();\r | |
112 | @@ -1096,7 +1100,8 @@ void SlaOutputDev::handleActions(PageIte | |
113 | LinkJavaScript *jsa = (LinkJavaScript*)Aact;\r | |
114 | if (jsa->isOk())\r | |
115 | {\r | |
116 | - ite->annotation().setD_act(UnicodeParsedString(jsa->getScript()));\r | |
117 | + const GooString scriptGooString(jsa->getScript()); | |
118 | + ite->annotation().setD_act(UnicodeParsedString(&scriptGooString));\r | |
119 | ite->annotation().setAAact(true);\r | |
120 | }\r | |
121 | }\r | |
122 | @@ -1110,7 +1115,8 @@ void SlaOutputDev::handleActions(PageIte | |
123 | LinkJavaScript *jsa = (LinkJavaScript*)Aact;\r | |
124 | if (jsa->isOk())\r | |
125 | {\r | |
126 | - ite->annotation().setE_act(UnicodeParsedString(jsa->getScript()));\r | |
127 | + const GooString scriptGooString(jsa->getScript()); | |
128 | + ite->annotation().setE_act(UnicodeParsedString(&scriptGooString));\r | |
129 | ite->annotation().setAAact(true);\r | |
130 | }\r | |
131 | }\r | |
132 | @@ -1124,7 +1130,8 @@ void SlaOutputDev::handleActions(PageIte | |
133 | LinkJavaScript *jsa = (LinkJavaScript*)Aact;\r | |
134 | if (jsa->isOk())\r | |
135 | {\r | |
136 | - ite->annotation().setX_act(UnicodeParsedString(jsa->getScript()));\r | |
137 | + const GooString scriptGooString(jsa->getScript()); | |
138 | + ite->annotation().setX_act(UnicodeParsedString(&scriptGooString));\r | |
139 | ite->annotation().setAAact(true);\r | |
140 | }\r | |
141 | }\r | |
142 | @@ -1138,7 +1145,8 @@ void SlaOutputDev::handleActions(PageIte | |
143 | LinkJavaScript *jsa = (LinkJavaScript*)Aact;\r | |
144 | if (jsa->isOk())\r | |
145 | {\r | |
146 | - ite->annotation().setFo_act(UnicodeParsedString(jsa->getScript()));\r | |
147 | + const GooString scriptGooString(jsa->getScript()); | |
148 | + ite->annotation().setFo_act(UnicodeParsedString(&scriptGooString));\r | |
149 | ite->annotation().setAAact(true);\r | |
150 | }\r | |
151 | }\r | |
152 | @@ -1152,7 +1160,8 @@ void SlaOutputDev::handleActions(PageIte | |
153 | LinkJavaScript *jsa = (LinkJavaScript*)Aact;\r | |
154 | if (jsa->isOk())\r | |
155 | {\r | |
156 | - ite->annotation().setBl_act(UnicodeParsedString(jsa->getScript()));\r | |
157 | + const GooString scriptGooString(jsa->getScript()); | |
158 | + ite->annotation().setBl_act(UnicodeParsedString(&scriptGooString));\r | |
159 | ite->annotation().setAAact(true);\r | |
160 | }\r | |
161 | }\r | |
162 | @@ -1166,7 +1175,8 @@ void SlaOutputDev::handleActions(PageIte | |
163 | LinkJavaScript *jsa = (LinkJavaScript*)Aact;\r | |
164 | if (jsa->isOk())\r | |
165 | {\r | |
166 | - ite->annotation().setC_act(UnicodeParsedString(jsa->getScript()));\r | |
167 | + const GooString scriptGooString(jsa->getScript()); | |
168 | + ite->annotation().setC_act(UnicodeParsedString(&scriptGooString));\r | |
169 | ite->annotation().setAAact(true);\r | |
170 | }\r | |
171 | }\r | |
172 | @@ -1180,7 +1190,8 @@ void SlaOutputDev::handleActions(PageIte | |
173 | LinkJavaScript *jsa = (LinkJavaScript*)Aact;\r | |
174 | if (jsa->isOk())\r | |
175 | {\r | |
176 | - ite->annotation().setF_act(UnicodeParsedString(jsa->getScript()));\r | |
177 | + const GooString scriptGooString(jsa->getScript()); | |
178 | + ite->annotation().setF_act(UnicodeParsedString(&scriptGooString));\r | |
179 | ite->annotation().setAAact(true);\r | |
180 | ite->annotation().setFormat(5);\r | |
181 | }\r | |
182 | @@ -1195,7 +1206,8 @@ void SlaOutputDev::handleActions(PageIte | |
183 | LinkJavaScript *jsa = (LinkJavaScript*)Aact;\r | |
184 | if (jsa->isOk())\r | |
185 | {\r | |
186 | - ite->annotation().setK_act(UnicodeParsedString(jsa->getScript()));\r | |
187 | + const GooString scriptGooString(jsa->getScript()); | |
188 | + ite->annotation().setK_act(UnicodeParsedString(&scriptGooString));\r | |
189 | ite->annotation().setAAact(true);\r | |
190 | ite->annotation().setFormat(5);\r | |
191 | }\r | |
192 | @@ -1210,7 +1222,8 @@ void SlaOutputDev::handleActions(PageIte | |
193 | LinkJavaScript *jsa = (LinkJavaScript*)Aact;\r | |
194 | if (jsa->isOk())\r | |
195 | {\r | |
196 | - ite->annotation().setV_act(UnicodeParsedString(jsa->getScript()));\r | |
197 | + const GooString scriptGooString(jsa->getScript()); | |
198 | + ite->annotation().setV_act(UnicodeParsedString(&scriptGooString));\r | |
199 | ite->annotation().setAAact(true);\r | |
200 | }\r | |
201 | }\r |