1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_HWPFILTER_SOURCE_MAPPING_H
21 #define INCLUDED_HWPFILTER_SOURCE_MAPPING_H
25 #include <sal/macros.h>
36 #define DEFAULT_VALUE 0x25a1
37 const struct FormulaEntry FormulaMapTab
[] = {
100 {"angstrom", 0x212b},
101 {"vartheta", 0x03d1},
103 {"varsigma", 0x04aa},
104 {"varupsilon", 0x03d2},
110 {"smallsum", 0x03a3},
122 {"bigsqcap", 0x2293},
123 {"bigsqcup", 0x2294},
124 {"bigoplus", 0x2295},
125 {"bigominus", 0x2296},
126 {"bigotimes", 0x2297},
135 {"bigwedge", 0x22c0},
137 {"superset", 0x2283},
139 {"subseteq", 0x2286},
140 {"supseteq", 0x2287},
147 {"sqsubset", 0x228f},
148 {"sqsupset", 0x2290},
149 {"sqsubseteq", 0x2291},
150 {"sqsupseteq", 0x2292},
151 {"mlt", 0x2292}, // much less than
152 {"mgt", 0x2292}, // much greater than
153 {"vmlt", 0x22d8}, // much less than
154 {"vmgt", 0x22d9}, // much greater than
157 {"biguplus", 0x228e},
171 {"emptyset", 0x2205},
172 {"therefore", 0x2234},
174 {"identical", 0x2237},
176 {"noteq", 0x2260}, // !=
189 {"dsum", 0x2214}, // add
191 {"prime", DEFAULT_VALUE
}, // '
199 {"LNOT", DEFAULT_VALUE
},
202 {"leftarrow", 0x2190},
204 {"rightarrow", 0x2192},
205 {"downarrow", 0x2193},
206 {"Leftarrow", 0x21d0},
208 {"Rightarrow", 0x21d2},
209 {"Downarrow", 0x21d3},
210 {"updownarrow", 0x2195},
211 {"Updownarrow", 0x21d5},
212 {"leftrightarrow", 0x2194},
213 {"Leftrightarrow", 0x21d4},
218 {"hookleft", 0x21a9},
219 {"hookleftarrow", 0x21a9},
220 {"hookright", 0x21aa},
221 {"hookrightarrow", 0x21aa},
230 {"triangle", 0x2206},
231 {"triangled", 0x2207},
242 {"coprod", DEFAULT_VALUE
},
243 {"varepsilon", DEFAULT_VALUE
},
244 {"setminus", DEFAULT_VALUE
},
245 {"sqcap", DEFAULT_VALUE
},
246 {"sqcup", DEFAULT_VALUE
},
247 {"wr", DEFAULT_VALUE
},
248 {"bigtriangleup", DEFAULT_VALUE
},
249 {"bigtriangledown", DEFAULT_VALUE
},
250 {"triangleleft", DEFAULT_VALUE
},
251 {"triangleright", DEFAULT_VALUE
},
252 {"lhd", DEFAULT_VALUE
},
253 {"rhd", DEFAULT_VALUE
},
254 {"unlhd", DEFAULT_VALUE
},
255 {"unrhd", DEFAULT_VALUE
},
256 {"nabla", DEFAULT_VALUE
},
257 {"surd", DEFAULT_VALUE
},
258 {"Box", DEFAULT_VALUE
},
259 {"Diamond", DEFAULT_VALUE
},
260 {"neg", DEFAULT_VALUE
},
261 {"flat", DEFAULT_VALUE
},
262 {"natural", DEFAULT_VALUE
},
263 {"sharp", DEFAULT_VALUE
},
264 {"clubsuit", DEFAULT_VALUE
},
265 {"diamondsuit", DEFAULT_VALUE
},
266 {"heartsuit", DEFAULT_VALUE
},
267 {"spadesuit", DEFAULT_VALUE
},
268 {"Re", DEFAULT_VALUE
},
269 {"Im", DEFAULT_VALUE
},
270 {"S", DEFAULT_VALUE
},
271 {"P", DEFAULT_VALUE
},
272 {"smallint", DEFAULT_VALUE
},
273 {"backslash", DEFAULT_VALUE
},
276 {"le", DEFAULT_VALUE
},
277 {"ge", DEFAULT_VALUE
},
278 {"perp", DEFAULT_VALUE
},
279 {"preceq", DEFAULT_VALUE
},
280 {"succeq", DEFAULT_VALUE
},
281 {"mid", DEFAULT_VALUE
},
282 {"ll", DEFAULT_VALUE
},
283 {"gg", DEFAULT_VALUE
},
284 {"parallel", DEFAULT_VALUE
},
285 {"bowtie", DEFAULT_VALUE
},
286 {"Join", DEFAULT_VALUE
},
287 {"smile", DEFAULT_VALUE
},
288 {"frown", DEFAULT_VALUE
},
289 {"not", DEFAULT_VALUE
},
290 {"mapsto", DEFAULT_VALUE
},
293 {"to", DEFAULT_VALUE
},
295 {"leftharpoonup", DEFAULT_VALUE
},
296 {"leftharpoondown", DEFAULT_VALUE
},
297 {"longleftarrow", DEFAULT_VALUE
},
298 {"Longleftarrow", DEFAULT_VALUE
},
299 {"longrightarrow", DEFAULT_VALUE
},
300 {"Longrightarrow", DEFAULT_VALUE
},
301 {"longleftrightarrow", DEFAULT_VALUE
},
302 {"Longleftrightarrow", DEFAULT_VALUE
},
303 {"longmapsto", DEFAULT_VALUE
},
304 {"rightharpoonup", DEFAULT_VALUE
},
305 {"rightharpoondown", DEFAULT_VALUE
},
308 {"(", DEFAULT_VALUE
},
309 {")", DEFAULT_VALUE
},
310 {"[", DEFAULT_VALUE
},
311 {"]", DEFAULT_VALUE
},
312 {"{", DEFAULT_VALUE
},
313 {"}", DEFAULT_VALUE
},
314 {"lfloor", DEFAULT_VALUE
},
315 {"rfloor", DEFAULT_VALUE
},
316 {"lceil", DEFAULT_VALUE
},
317 {"rceil", DEFAULT_VALUE
},
318 {"langle", DEFAULT_VALUE
},
319 {"rangle", DEFAULT_VALUE
},
320 {"mid", DEFAULT_VALUE
},
323 {"rmoustache", DEFAULT_VALUE
},
324 {"lmoustache", DEFAULT_VALUE
},
325 {"rgroup", DEFAULT_VALUE
},
326 {"lgroup", DEFAULT_VALUE
},
327 {"arrowvert", DEFAULT_VALUE
},
328 {"Arrowvert", DEFAULT_VALUE
},
329 {"bracevert", DEFAULT_VALUE
},
332 {"hat", DEFAULT_VALUE
},
333 {"breve", DEFAULT_VALUE
},
334 {"grave", DEFAULT_VALUE
},
335 {"bar", DEFAULT_VALUE
},
336 {"ddot", DEFAULT_VALUE
},
337 {"check", DEFAULT_VALUE
},
338 {"acute", DEFAULT_VALUE
},
339 {"tilde", DEFAULT_VALUE
},
340 {"dot", DEFAULT_VALUE
},
341 {"vec", DEFAULT_VALUE
},
344 {"overline", DEFAULT_VALUE
},
345 {"underline", DEFAULT_VALUE
},
346 {"overbrace", DEFAULT_VALUE
},
347 {"underbrace", DEFAULT_VALUE
},
348 {"widehat", DEFAULT_VALUE
},
349 {"widetilde", DEFAULT_VALUE
},
350 {"overleftarrow", DEFAULT_VALUE
},
351 {"overrightarrow", DEFAULT_VALUE
},
354 {",", DEFAULT_VALUE
},
355 {":", DEFAULT_VALUE
},
356 {";", DEFAULT_VALUE
},
357 {"!", DEFAULT_VALUE
},
358 {"quad", DEFAULT_VALUE
},
359 {"qquad", DEFAULT_VALUE
}, // double size of character
364 hchar_string
getMathMLEntity(const char *tex
)
366 static const size_t tabSize
= SAL_N_ELEMENTS(FormulaMapTab
);
369 for (size_t i
= 0 ; i
< tabSize
; i
++) {
370 if( !strcmp(tex
, FormulaMapTab
[i
].tex
) ) {
371 buf
.push_back(FormulaMapTab
[i
].ucs
);
376 size_t const len
= strlen(tex
);
377 for (size_t i
= 0 ; i
< len
; i
++)
379 buf
.push_back(tex
[i
]);
385 ::std::string
getMathMLEntity(const char *tex
)
395 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */