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 #include <starmathdatabase.hxx>
23 SmToken
starmathdatabase::Identify_SmXMLOperatorContext_Impl(sal_Unicode cChar
, bool bIsStretchy
)
28 return SmToken(TCOPROD
, MS_COPROD
, "coprod", TG::Oper
, 5);
30 return SmToken(TIIINT
, MS_IIINT
, "iiint", TG::Oper
, 5);
32 return SmToken(TIINT
, MS_IINT
, "iint", TG::Oper
, 5);
35 return SmToken(TINTD
, MS_INT
, "intd", TG::Oper
, 5);
37 return SmToken(TINT
, MS_INT
, "int", TG::Oper
, 5);
39 return SmToken(TLINT
, MS_LINT
, "lint", TG::Oper
, 5);
41 return SmToken(TLLINT
, MS_LLINT
, "llint", TG::Oper
, 5);
43 return SmToken(TLLLINT
, MS_LLLINT
, "lllint", TG::Oper
, 5);
45 return SmToken(TPROD
, MS_PROD
, "prod", TG::Oper
, 5);
47 return SmToken(TSUM
, MS_SUM
, "sum", TG::Oper
, 5);
49 return SmToken(TFACT
, MS_FACT
, "!", TG::UnOper
, 5);
51 return SmToken(TNEG
, MS_NEG
, "neg", TG::UnOper
, 5);
53 return SmToken(TOMINUS
, MS_OMINUS
, "ominus", TG::Sum
, 0);
55 return SmToken(TOPLUS
, MS_OPLUS
, "oplus", TG::Sum
, 0);
57 return SmToken(TUNION
, MS_UNION
, "union", TG::Sum
, 0);
59 return SmToken(TOR
, MS_OR
, "|", TG::Sum
, 5);
61 return SmToken(TPLUSMINUS
, MS_PLUSMINUS
, "+-", TG::Sum
| TG::UnOper
, 5);
63 return SmToken(TMINUSPLUS
, MS_MINUSPLUS
, "-+", TG::Sum
| TG::UnOper
, 5);
66 return SmToken(TPLUS
, MS_PLUS
, "+", TG::Sum
| TG::UnOper
, 5);
68 return SmToken(TMINUS
, MS_MINUS
, "-", TG::Sum
| TG::UnOper
, 5);
71 return SmToken(TCDOT
, MS_CDOT
, "cdot", TG::Product
, 0);
73 return SmToken(TDIV
, MS_DIV
, "div", TG::Product
, 0);
75 return SmToken(TTIMES
, MS_TIMES
, "times", TG::Product
, 0);
77 return SmToken(TINTERSECT
, MS_INTERSECT
, "intersection", TG::Product
, 0);
79 return SmToken(TODIVIDE
, MS_ODIVIDE
, "odivide", TG::Product
, 0);
81 return SmToken(TODOT
, MS_ODOT
, "odot", TG::Product
, 0);
83 return SmToken(TOTIMES
, MS_OTIMES
, "otimes", TG::Product
, 0);
85 return SmToken(TAND
, MS_AND
, "&", TG::Product
, 0);
87 return SmToken(TMULTIPLY
, MS_MULTIPLY
, "*", TG::Product
, 0);
90 return SmToken(TWIDESLASH
, MS_SLASH
, "wideslash", TG::Product
, 0);
92 return SmToken(TSLASH
, MS_SLASH
, "slash", TG::Product
, 0);
95 return SmToken(TWIDEBACKSLASH
, MS_BACKSLASH
, "widebslash", TG::Product
, 0);
97 return SmToken(TBACKSLASH
, MS_BACKSLASH
, "bslash", TG::Product
, 0);
99 return SmToken(TDEF
, MS_DEF
, "def", TG::Relation
, 0);
101 return SmToken(TDIVIDES
, MS_LINE
, "divides", TG::Relation
, 0);
103 return SmToken(TEQUIV
, MS_EQUIV
, "equiv", TG::Relation
, 0);
105 return SmToken(TGE
, MS_GE
, ">=", TG::Relation
, 0);
107 return SmToken(TGESLANT
, MS_GESLANT
, "geslant", TG::Relation
, 0);
109 return SmToken(TGG
, MS_GG
, ">>", TG::Relation
, 0);
111 return SmToken(TGT
, MS_GT
, ">", TG::Relation
, 0);
113 return SmToken(TIN
, MS_IN
, "in", TG::Relation
, 0);
115 return SmToken(TLE
, MS_LE
, "<=", TG::Relation
, 0);
117 return SmToken(TLESLANT
, MS_LESLANT
, "leslant", TG::Relation
, 0);
119 return SmToken(TLL
, MS_LL
, "<<", TG::Relation
, 0);
121 return SmToken(TLT
, MS_LT
, "<", TG::Relation
, 0);
123 return SmToken(TNDIVIDES
, MS_NDIVIDES
, "ndivides", TG::Relation
, 0);
125 return SmToken(TNEQ
, MS_NEQ
, "<>", TG::Relation
, 0);
127 return SmToken(TNOTIN
, MS_NOTIN
, "notin", TG::Relation
, 0);
129 return SmToken(TNOTPRECEDES
, MS_NOTPRECEDES
, "nprec", TG::Relation
, 0);
131 return SmToken(TNSUBSET
, MS_NSUBSET
, "nsubset", TG::Relation
, 0);
133 return SmToken(TNSUBSETEQ
, MS_NSUBSETEQ
, "nsubseteq", TG::Relation
, 0);
135 return SmToken(TNOTSUCCEEDS
, MS_NOTSUCCEEDS
, "nsucc", TG::Relation
, 0);
137 return SmToken(TNSUPSET
, MS_NSUPSET
, "nsupset", TG::Relation
, 0);
139 return SmToken(TNSUPSETEQ
, MS_NSUPSETEQ
, "nsupseteq", TG::Relation
, 0);
141 return SmToken(TORTHO
, MS_ORTHO
, "ortho", TG::Relation
, 0);
143 return SmToken(TNI
, MS_NI
, "owns", TG::Relation
, 0);
145 return SmToken(TPARALLEL
, MS_DLINE
, "parallel", TG::Relation
, 0);
147 return SmToken(TPRECEDES
, MS_PRECEDES
, "prec", TG::Relation
, 0);
148 case MS_PRECEDESEQUAL
:
149 return SmToken(TPRECEDESEQUAL
, MS_PRECEDESEQUAL
, "preccurlyeq", TG::Relation
, 0);
150 case MS_PRECEDESEQUIV
:
151 return SmToken(TPRECEDESEQUIV
, MS_PRECEDESEQUIV
, "precsim", TG::Relation
, 0);
153 return SmToken(TPROP
, MS_PROP
, "prop", TG::Relation
, 0);
155 return SmToken(TSIM
, MS_SIM
, "sim", TG::Relation
, 0);
158 return SmToken(TSIMEQ
, MS_SIMEQ
, "simeq", TG::Relation
, 0);
160 return SmToken(TSUBSET
, MS_SUBSET
, "subset", TG::Relation
, 0);
162 return SmToken(TSUBSETEQ
, MS_SUBSETEQ
, "subseteq", TG::Relation
, 0);
164 return SmToken(TSUCCEEDS
, MS_SUCCEEDS
, "succ", TG::Relation
, 0);
165 case MS_SUCCEEDSEQUAL
:
166 return SmToken(TSUCCEEDSEQUAL
, MS_SUCCEEDSEQUAL
, "succcurlyeq", TG::Relation
, 0);
167 case MS_SUCCEEDSEQUIV
:
168 return SmToken(TSUCCEEDSEQUIV
, MS_SUCCEEDSEQUIV
, "succsim", TG::Relation
, 0);
170 return SmToken(TSUPSET
, MS_SUPSET
, "supset", TG::Relation
, 0);
172 return SmToken(TSUPSETEQ
, MS_SUPSETEQ
, "supseteq", TG::Relation
, 0);
174 return SmToken(TTOWARD
, MS_RIGHTARROW
, "toward", TG::Relation
, 0);
176 return SmToken(TTRANSL
, MS_TRANSL
, "transl", TG::Relation
, 0);
178 return SmToken(TTRANSR
, MS_TRANSR
, "transr", TG::Relation
, 0);
180 return SmToken(TASSIGN
, MS_ASSIGN
, "=", TG::Relation
, 0);
182 return SmToken(TLANGLE
, MS_LMATHANGLE
, "langle", TG::LBrace
, 5);
184 return SmToken(TLANGLE
, MS_LMATHANGLE
, "langle", TG::LBrace
, 5);
186 return SmToken(TLBRACE
, MS_LBRACE
, "lbrace", TG::LBrace
, 5);
188 return SmToken(TLCEIL
, MS_LCEIL
, "lceil", TG::LBrace
, 5);
190 return SmToken(TLFLOOR
, MS_LFLOOR
, "lfloor", TG::LBrace
, 5);
192 return SmToken(TLDBRACKET
, MS_LDBRACKET
, "ldbracket", TG::LBrace
, 5);
194 return SmToken(TLBRACKET
, MS_LBRACKET
, "[", TG::LBrace
, 5);
196 return SmToken(TLPARENT
, MS_LPARENT
, "(", TG::LBrace
, 5);
198 return SmToken(TRANGLE
, MS_RMATHANGLE
, "rangle", TG::RBrace
, 5);
200 return SmToken(TRANGLE
, MS_RMATHANGLE
, "rangle", TG::RBrace
, 5);
202 return SmToken(TRBRACE
, MS_RBRACE
, "rbrace", TG::RBrace
, 5);
204 return SmToken(TRCEIL
, MS_RCEIL
, "rceil", TG::RBrace
, 5);
206 return SmToken(TRFLOOR
, MS_RFLOOR
, "rfloor", TG::RBrace
, 5);
208 return SmToken(TRDBRACKET
, MS_RDBRACKET
, "rdbracket", TG::RBrace
, 5);
210 return SmToken(TRBRACKET
, MS_RBRACKET
, "]", TG::RBrace
, 5);
212 return SmToken(TRPARENT
, MS_RPARENT
, ")", TG::RBrace
, 5);
214 return SmToken(TNONE
, MS_NONE
, "none", TG::RBrace
| TG::LBrace
, 5);
216 return SmToken(TERROR
, MS_NONE
, "", TG::NONE
, SAL_MAX_UINT16
);
220 SmToken
starmathdatabase::Identify_Prefix_SmXMLOperatorContext_Impl(sal_Unicode cChar
)
225 return SmToken(TLLINE
, MS_VERTLINE
, "lline", TG::LBrace
, 5);
227 return SmToken(TLDLINE
, MS_DVERTLINE
, "ldline", TG::LBrace
, 5);
229 return SmToken(TLANGLE
, MS_LMATHANGLE
, "langle", TG::LBrace
, 5);
231 return SmToken(TLANGLE
, MS_LMATHANGLE
, "langle", TG::LBrace
, 5);
233 return SmToken(TLBRACE
, MS_LBRACE
, "lbrace", TG::LBrace
, 5);
235 return SmToken(TLCEIL
, MS_LCEIL
, "lceil", TG::LBrace
, 5);
237 return SmToken(TLFLOOR
, MS_LFLOOR
, "lfloor", TG::LBrace
, 5);
239 return SmToken(TLDBRACKET
, MS_LDBRACKET
, "ldbracket", TG::LBrace
, 5);
241 return SmToken(TLBRACKET
, MS_LBRACKET
, "[", TG::LBrace
, 5);
243 return SmToken(TLPARENT
, MS_LPARENT
, "(", TG::LBrace
, 5);
245 return SmToken(TRANGLE
, MS_RMATHANGLE
, "rangle", TG::RBrace
, 5);
247 return SmToken(TRANGLE
, MS_RMATHANGLE
, "rangle", TG::RBrace
, 5);
249 return SmToken(TRBRACE
, MS_RBRACE
, "rbrace", TG::RBrace
, 5);
251 return SmToken(TRCEIL
, MS_RCEIL
, "rceil", TG::RBrace
, 5);
253 return SmToken(TRFLOOR
, MS_RFLOOR
, "rfloor", TG::RBrace
, 5);
255 return SmToken(TRDBRACKET
, MS_RDBRACKET
, "rdbracket", TG::RBrace
, 5);
257 return SmToken(TRBRACKET
, MS_RBRACKET
, "]", TG::RBrace
, 5);
259 return SmToken(TRPARENT
, MS_RPARENT
, ")", TG::RBrace
, 5);
261 return SmToken(TNONE
, MS_NONE
, "none", TG::LBrace
| TG::RBrace
, 5);
263 return SmToken(TERROR
, MS_NONE
, "", TG::NONE
, SAL_MAX_UINT16
);
267 SmToken
starmathdatabase::Identify_Postfix_SmXMLOperatorContext_Impl(sal_Unicode cChar
)
272 return SmToken(TRLINE
, MS_VERTLINE
, "rline", TG::RBrace
, 5);
274 return SmToken(TRDLINE
, MS_DVERTLINE
, "rdline", TG::RBrace
, 5);
276 return SmToken(TLANGLE
, MS_LMATHANGLE
, "langle", TG::LBrace
, 5);
278 return SmToken(TLANGLE
, MS_LMATHANGLE
, "langle", TG::LBrace
, 5);
280 return SmToken(TLBRACE
, MS_LBRACE
, "lbrace", TG::LBrace
, 5);
282 return SmToken(TLCEIL
, MS_LCEIL
, "lceil", TG::LBrace
, 5);
284 return SmToken(TLFLOOR
, MS_LFLOOR
, "lfloor", TG::LBrace
, 5);
286 return SmToken(TLDBRACKET
, MS_LDBRACKET
, "ldbracket", TG::LBrace
, 5);
288 return SmToken(TLBRACKET
, MS_LBRACKET
, "[", TG::LBrace
, 5);
290 return SmToken(TLPARENT
, MS_LPARENT
, "(", TG::LBrace
, 5);
292 return SmToken(TRANGLE
, MS_RMATHANGLE
, "rangle", TG::RBrace
, 5);
294 return SmToken(TRANGLE
, MS_RMATHANGLE
, "rangle", TG::RBrace
, 5);
296 return SmToken(TRBRACE
, MS_RBRACE
, "rbrace", TG::RBrace
, 5);
298 return SmToken(TRCEIL
, MS_RCEIL
, "rceil", TG::RBrace
, 5);
300 return SmToken(TRFLOOR
, MS_RFLOOR
, "rfloor", TG::RBrace
, 5);
302 return SmToken(TRDBRACKET
, MS_RDBRACKET
, "rdbracket", TG::RBrace
, 5);
304 return SmToken(TRBRACKET
, MS_RBRACKET
, "]", TG::RBrace
, 5);
306 return SmToken(TRPARENT
, MS_RPARENT
, ")", TG::RBrace
, 5);
308 return SmToken(TNONE
, MS_NONE
, "none", TG::LBrace
| TG::RBrace
, 5);
310 return SmToken(TERROR
, MS_NONE
, "", TG::NONE
, SAL_MAX_UINT16
);
314 SmToken
starmathdatabase::Identify_PrefixPostfix_SmXMLOperatorContext_Impl(sal_Unicode cChar
)
319 return SmToken(TLRLINE
, MS_VERTLINE
, "lrline", TG::LBrace
| TG::RBrace
, 5);
321 return SmToken(TLRDLINE
, MS_DVERTLINE
, "lrdline", TG::LBrace
| TG::RBrace
, 5);
323 return SmToken(TLANGLE
, MS_LMATHANGLE
, "langle", TG::LBrace
, 5);
325 return SmToken(TLANGLE
, MS_LMATHANGLE
, "langle", TG::LBrace
, 5);
327 return SmToken(TLBRACE
, MS_LBRACE
, "lbrace", TG::LBrace
, 5);
329 return SmToken(TLCEIL
, MS_LCEIL
, "lceil", TG::LBrace
, 5);
331 return SmToken(TLFLOOR
, MS_LFLOOR
, "lfloor", TG::LBrace
, 5);
333 return SmToken(TLDBRACKET
, MS_LDBRACKET
, "ldbracket", TG::LBrace
, 5);
335 return SmToken(TLBRACKET
, MS_LBRACKET
, "[", TG::LBrace
, 5);
337 return SmToken(TLPARENT
, MS_LPARENT
, "(", TG::LBrace
, 5);
339 return SmToken(TRANGLE
, MS_RMATHANGLE
, "rangle", TG::RBrace
, 5);
341 return SmToken(TRANGLE
, MS_RMATHANGLE
, "rangle", TG::RBrace
, 5);
343 return SmToken(TRBRACE
, MS_RBRACE
, "rbrace", TG::RBrace
, 5);
345 return SmToken(TRCEIL
, MS_RCEIL
, "rceil", TG::RBrace
, 5);
347 return SmToken(TRFLOOR
, MS_RFLOOR
, "rfloor", TG::RBrace
, 5);
349 return SmToken(TRDBRACKET
, MS_RDBRACKET
, "rdbracket", TG::RBrace
, 5);
351 return SmToken(TRBRACKET
, MS_RBRACKET
, "]", TG::RBrace
, 5);
353 return SmToken(TRPARENT
, MS_RPARENT
, ")", TG::RBrace
, 5);
355 return SmToken(TNONE
, MS_NONE
, "none", TG::LBrace
| TG::RBrace
, 5);
357 return SmToken(TERROR
, MS_NONE
, "", TG::NONE
, SAL_MAX_UINT16
);
361 const SmColorTokenTableEntry
starmathdatabase::aColorTokenTableParse
[]
362 = { { "aliceblue", THTMLCOL
, COL_SM_ALICEBLUE
},
363 { "antiquewhite", THTMLCOL
, COL_SM_ANTIQUEWHITE
},
364 { "aqua", TMATHMLCOL
, COL_SM_AQUA
},
365 { "aquamarine", THTMLCOL
, COL_SM_AQUAMARINE
},
366 { "azure", THTMLCOL
, COL_SM_AZURE
},
367 { "beige", THTMLCOL
, COL_SM_BEIGE
},
368 { "bisque", THTMLCOL
, COL_SM_BISQUE
},
369 { "black", TMATHMLCOL
, COL_SM_BLACK
},
370 { "blanchedalmond", THTMLCOL
, COL_SM_BLANCHEDALMOND
},
371 { "blue", TMATHMLCOL
, COL_SM_BLUE
},
372 { "blueviolet", THTMLCOL
, COL_SM_BLUEVIOLET
},
373 { "brown", THTMLCOL
, COL_SM_BROWN
},
374 { "burlywood", THTMLCOL
, COL_SM_BURLYWOOD
},
375 { "cadetblue", THTMLCOL
, COL_SM_CADETBLUE
},
376 { "chartreuse", THTMLCOL
, COL_SM_CHARTREUSE
},
377 { "chocolate", THTMLCOL
, COL_SM_CHOCOLATE
},
378 { "coral", THTMLCOL
, COL_SM_CORAL
},
379 { "cornflowerblue", THTMLCOL
, COL_SM_CORNFLOWERBLUE
},
380 { "cornsilk", THTMLCOL
, COL_SM_CORNSILK
},
381 { "crimson", THTMLCOL
, COL_SM_CRIMSON
},
382 { "cyan", TMATHMLCOL
, COL_SM_CYAN
},
383 { "darkblue", THTMLCOL
, COL_SM_DARKBLUE
},
384 { "darkcyan", THTMLCOL
, COL_SM_DARKCYAN
},
385 { "darkgoldenrod", THTMLCOL
, COL_SM_DARKGOLDENROD
},
386 { "darkgray", THTMLCOL
, COL_SM_DARKGRAY
},
387 { "darkgreen", THTMLCOL
, COL_SM_DARKGREEN
},
388 { "darkgrey", THTMLCOL
, COL_SM_DARKGREY
},
389 { "darkkhaki", THTMLCOL
, COL_SM_DARKKHAKI
},
390 { "darkmagenta", THTMLCOL
, COL_SM_DARKMAGENTA
},
391 { "darkolivegreen", THTMLCOL
, COL_SM_DARKOLIVEGREEN
},
392 { "darkorange", THTMLCOL
, COL_SM_DARKORANGE
},
393 { "darkorchid", THTMLCOL
, COL_SM_DARKORCHID
},
394 { "darkred", THTMLCOL
, COL_SM_DARKRED
},
395 { "darksalmon", THTMLCOL
, COL_SM_DARKSALMON
},
396 { "darkseagreen", THTMLCOL
, COL_SM_DARKSEAGREEN
},
397 { "darkslateblue", THTMLCOL
, COL_SM_DARKSLATEBLUE
},
398 { "darkslategray", THTMLCOL
, COL_SM_DARKSLATEGRAY
},
399 { "darkslategrey", THTMLCOL
, COL_SM_DARKSLATEGREY
},
400 { "darkturquoise", THTMLCOL
, COL_SM_DARKTURQUOISE
},
401 { "darkviolet", THTMLCOL
, COL_SM_DARKVIOLET
},
402 { "debian", TICONICCOL
, COL_SM_DEBIAN_MAGENTA
},
403 { "deeppink", THTMLCOL
, COL_SM_DEEPPINK
},
404 { "deepskyblue", THTMLCOL
, COL_SM_DEEPSKYBLUE
},
405 { "dimgray", THTMLCOL
, COL_SM_DIMGRAY
},
406 { "dimgrey", THTMLCOL
, COL_SM_DIMGREY
},
407 { "dodgerblue", THTMLCOL
, COL_SM_DODGERBLUE
},
408 { "dvip", TDVIPSNAMESCOL
, COL_SM_BLACK
},
409 { "firebrick", THTMLCOL
, COL_SM_FIREBRICK
},
410 { "floralwhite", THTMLCOL
, COL_SM_FLORALWHITE
},
411 { "forestgreen", THTMLCOL
, COL_SM_FORESTGREEN
},
412 { "fuchsia", TMATHMLCOL
, COL_SM_FUCHSIA
},
413 { "gainsboro", THTMLCOL
, COL_SM_GAINSBORO
},
414 { "ghostwhite", THTMLCOL
, COL_SM_GHOSTWHITE
},
415 { "gold", THTMLCOL
, COL_SM_GOLD
},
416 { "goldenrod", THTMLCOL
, COL_SM_GOLDENROD
},
417 { "gray", TMATHMLCOL
, COL_SM_GRAY
},
418 { "green", TMATHMLCOL
, COL_SM_GREEN
},
419 { "greenyellow", THTMLCOL
, COL_SM_GREENYELLOW
},
420 { "grey", THTMLCOL
, COL_SM_GREY
},
421 { "hex", THEX
, COL_SM_BLACK
},
422 { "honeydew", THTMLCOL
, COL_SM_HONEYDEW
},
423 { "hotpink", THTMLCOL
, COL_SM_HOTPINK
},
424 { "indianred", THTMLCOL
, COL_SM_INDIANRED
},
425 { "indigo", THTMLCOL
, COL_SM_INDIGO
},
426 { "ivory", THTMLCOL
, COL_SM_IVORY
},
427 { "khaki", THTMLCOL
, COL_SM_KHAKI
},
428 { "lavender", THTMLCOL
, COL_SM_LAVENDER
},
429 { "lavenderblush", THTMLCOL
, COL_SM_LAVENDERBLUSH
},
430 { "lawngreen", THTMLCOL
, COL_SM_LAWNGREEN
},
431 { "lemonchiffon", THTMLCOL
, COL_SM_LEMONCHIFFON
},
432 { "lightblue", THTMLCOL
, COL_SM_LIGHTBLUE
},
433 { "lightcoral", THTMLCOL
, COL_SM_LIGHTCORAL
},
434 { "lightcyan", THTMLCOL
, COL_SM_LIGHTCYAN
},
435 { "lightgoldenrodyellow", THTMLCOL
, COL_SM_LIGHTGOLDENRODYELLOW
},
436 { "lightgray", THTMLCOL
, COL_SM_LIGHTGRAY
},
437 { "lightgreen", THTMLCOL
, COL_SM_LIGHTGREEN
},
438 { "lightgrey", THTMLCOL
, COL_SM_LIGHTGREY
},
439 { "lightpink", THTMLCOL
, COL_SM_LIGHTPINK
},
440 { "lightsalmon", THTMLCOL
, COL_SM_LIGHTSALMON
},
441 { "lightseagreen", THTMLCOL
, COL_SM_LIGHTSEAGREEN
},
442 { "lightskyblue", THTMLCOL
, COL_SM_LIGHTSKYBLUE
},
443 { "lightslategray", THTMLCOL
, COL_SM_LIGHTSLATEGRAY
},
444 { "lightslategrey", THTMLCOL
, COL_SM_LIGHTSLATEGREY
},
445 { "lightsteelblue", THTMLCOL
, COL_SM_LIGHTSTEELBLUE
},
446 { "lightyellow", THTMLCOL
, COL_SM_LIGHTYELLOW
},
447 { "lime", TMATHMLCOL
, COL_SM_LIME
},
448 { "limegreen", THTMLCOL
, COL_SM_LIMEGREEN
},
449 { "linen", THTMLCOL
, COL_SM_LINEN
},
450 { "lo", TICONICCOL
, COL_SM_LO_GREEN
},
451 { "magenta", TMATHMLCOL
, COL_SM_MAGENTA
},
452 { "maroon", TMATHMLCOL
, COL_SM_MAROON
},
453 { "mediumaquamarine", THTMLCOL
, COL_SM_MEDIUMAQUAMARINE
},
454 { "mediumblue", THTMLCOL
, COL_SM_MEDIUMBLUE
},
455 { "mediumorchid", THTMLCOL
, COL_SM_MEDIUMORCHID
},
456 { "mediumpurple", THTMLCOL
, COL_SM_MEDIUMPURPLE
},
457 { "mediumseagreen", THTMLCOL
, COL_SM_MEDIUMSEAGREEN
},
458 { "mediumslateblue", THTMLCOL
, COL_SM_MEDIUMSLATEBLUE
},
459 { "mediumspringgreen", THTMLCOL
, COL_SM_MEDIUMSPRINGGREEN
},
460 { "mediumturquoise", THTMLCOL
, COL_SM_MEDIUMTURQUOISE
},
461 { "mediumvioletred", THTMLCOL
, COL_SM_MEDIUMVIOLETRED
},
462 { "midnightblue", THTMLCOL
, COL_SM_MIDNIGHTBLUE
},
463 { "mintcream", THTMLCOL
, COL_SM_MINTCREAM
},
464 { "mistyrose", THTMLCOL
, COL_SM_MISTYROSE
},
465 { "moccasin", THTMLCOL
, COL_SM_MOCCASIN
},
466 { "navajowhite", THTMLCOL
, COL_SM_NAVAJOWHITE
},
467 { "navy", TMATHMLCOL
, COL_SM_NAVY
},
468 { "oldlace", THTMLCOL
, COL_SM_OLDLACE
},
469 { "olive", TMATHMLCOL
, COL_SM_OLIVE
},
470 { "olivedrab", THTMLCOL
, COL_SM_OLIVEDRAB
},
471 { "orange", THTMLCOL
, COL_SM_ORANGE
},
472 { "orangered", THTMLCOL
, COL_SM_ORANGERED
},
473 { "orchid", THTMLCOL
, COL_SM_ORCHID
},
474 { "palegoldenrod", THTMLCOL
, COL_SM_PALEGOLDENROD
},
475 { "palegreen", THTMLCOL
, COL_SM_PALEGREEN
},
476 { "paleturquoise", THTMLCOL
, COL_SM_PALETURQUOISE
},
477 { "palevioletred", THTMLCOL
, COL_SM_PALEVIOLETRED
},
478 { "papayawhip", THTMLCOL
, COL_SM_PAPAYAWHIP
},
479 { "peachpuff", THTMLCOL
, COL_SM_PEACHPUFF
},
480 { "peru", THTMLCOL
, COL_SM_PERU
},
481 { "pink", THTMLCOL
, COL_SM_PINK
},
482 { "plum", THTMLCOL
, COL_SM_PLUM
},
483 { "powderblue", THTMLCOL
, COL_SM_POWDERBLUE
},
484 { "purple", TMATHMLCOL
, COL_SM_PURPLE
},
485 { "rebeccapurple", THTMLCOL
, COL_SM_REBECCAPURPLE
},
486 { "red", TMATHMLCOL
, COL_SM_RED
},
487 { "rgb", TRGB
, COL_AUTO
},
488 { "rgba", TRGBA
, COL_AUTO
},
489 { "rosybrown", THTMLCOL
, COL_SM_ROSYBROWN
},
490 { "royalblue", THTMLCOL
, COL_SM_ROYALBLUE
},
491 { "saddlebrown", THTMLCOL
, COL_SM_SADDLEBROWN
},
492 { "salmon", THTMLCOL
, COL_SM_SALMON
},
493 { "sandybrown", THTMLCOL
, COL_SM_SANDYBROWN
},
494 { "seagreen", THTMLCOL
, COL_SM_SEAGREEN
},
495 { "seashell", THTMLCOL
, COL_SM_SEASHELL
},
496 { "sienna", THTMLCOL
, COL_SM_SIENNA
},
497 { "silver", TMATHMLCOL
, COL_SM_SILVER
},
498 { "skyblue", THTMLCOL
, COL_SM_SKYBLUE
},
499 { "slateblue", THTMLCOL
, COL_SM_SLATEBLUE
},
500 { "slategray", THTMLCOL
, COL_SM_SLATEGRAY
},
501 { "slategrey", THTMLCOL
, COL_SM_SLATEGREY
},
502 { "snow", THTMLCOL
, COL_SM_SNOW
},
503 { "springgreen", THTMLCOL
, COL_SM_SPRINGGREEN
},
504 { "steelblue", THTMLCOL
, COL_SM_STEELBLUE
},
505 { "tan", THTMLCOL
, COL_SM_TAN
},
506 { "teal", TMATHMLCOL
, COL_SM_TEAL
},
507 { "thistle", THTMLCOL
, COL_SM_THISTLE
},
508 { "tomato", THTMLCOL
, COL_SM_TOMATO
},
509 { "turquoise", THTMLCOL
, COL_SM_TURQUOISE
},
510 { "ubuntu", TICONICCOL
, COL_SM_UBUNTU_ORANGE
},
511 { "violet", THTMLCOL
, COL_SM_VIOLET
},
512 { "wheat", THTMLCOL
, COL_SM_WHEAT
},
513 { "white", TMATHMLCOL
, COL_SM_WHITE
},
514 { "whitesmoke", THTMLCOL
, COL_SM_WHITESMOKE
},
515 { "yellow", TMATHMLCOL
, COL_SM_YELLOW
},
516 { "yellowgreen", THTMLCOL
, COL_SM_YELLOWGREEN
} };
518 const SmColorTokenTableEntry
starmathdatabase::aColorTokenTableHTML
[]
519 = { { "aliceblue", THTMLCOL
, COL_SM_ALICEBLUE
},
520 { "antiquewhite", THTMLCOL
, COL_SM_ANTIQUEWHITE
},
521 { "aqua", TMATHMLCOL
, COL_SM_AQUA
},
522 { "aquamarine", THTMLCOL
, COL_SM_AQUAMARINE
},
523 { "azure", THTMLCOL
, COL_SM_AZURE
},
524 { "beige", THTMLCOL
, COL_SM_BEIGE
},
525 { "bisque", THTMLCOL
, COL_SM_BISQUE
},
526 { "black", TMATHMLCOL
, COL_SM_BLACK
},
527 { "blanchedalmond", THTMLCOL
, COL_SM_BLANCHEDALMOND
},
528 { "blue", TMATHMLCOL
, COL_SM_BLUE
},
529 { "blueviolet", THTMLCOL
, COL_SM_BLUEVIOLET
},
530 { "brown", THTMLCOL
, COL_SM_BROWN
},
531 { "burlywood", THTMLCOL
, COL_SM_BURLYWOOD
},
532 { "cadetblue", THTMLCOL
, COL_SM_CADETBLUE
},
533 { "chartreuse", THTMLCOL
, COL_SM_CHARTREUSE
},
534 { "chocolate", THTMLCOL
, COL_SM_CHOCOLATE
},
535 { "coral", THTMLCOL
, COL_SM_CORAL
},
536 { "cornflowerblue", THTMLCOL
, COL_SM_CORNFLOWERBLUE
},
537 { "cornsilk", THTMLCOL
, COL_SM_CORNSILK
},
538 { "crimson", THTMLCOL
, COL_SM_CRIMSON
},
539 { "cyan", TMATHMLCOL
, COL_SM_CYAN
},
540 { "darkblue", THTMLCOL
, COL_SM_DARKBLUE
},
541 { "darkcyan", THTMLCOL
, COL_SM_DARKCYAN
},
542 { "darkgoldenrod", THTMLCOL
, COL_SM_DARKGOLDENROD
},
543 { "darkgray", THTMLCOL
, COL_SM_DARKGRAY
},
544 { "darkgreen", THTMLCOL
, COL_SM_DARKGREEN
},
545 { "darkgrey", THTMLCOL
, COL_SM_DARKGREY
},
546 { "darkkhaki", THTMLCOL
, COL_SM_DARKKHAKI
},
547 { "darkmagenta", THTMLCOL
, COL_SM_DARKMAGENTA
},
548 { "darkolivegreen", THTMLCOL
, COL_SM_DARKOLIVEGREEN
},
549 { "darkorange", THTMLCOL
, COL_SM_DARKORANGE
},
550 { "darkorchid", THTMLCOL
, COL_SM_DARKORCHID
},
551 { "darkred", THTMLCOL
, COL_SM_DARKRED
},
552 { "darksalmon", THTMLCOL
, COL_SM_DARKSALMON
},
553 { "darkseagreen", THTMLCOL
, COL_SM_DARKSEAGREEN
},
554 { "darkslateblue", THTMLCOL
, COL_SM_DARKSLATEBLUE
},
555 { "darkslategray", THTMLCOL
, COL_SM_DARKSLATEGRAY
},
556 { "darkslategrey", THTMLCOL
, COL_SM_DARKSLATEGREY
},
557 { "darkturquoise", THTMLCOL
, COL_SM_DARKTURQUOISE
},
558 { "darkviolet", THTMLCOL
, COL_SM_DARKVIOLET
},
559 { "deeppink", THTMLCOL
, COL_SM_DEEPPINK
},
560 { "deepskyblue", THTMLCOL
, COL_SM_DEEPSKYBLUE
},
561 { "dimgray", THTMLCOL
, COL_SM_DIMGRAY
},
562 { "dimgrey", THTMLCOL
, COL_SM_DIMGREY
},
563 { "dodgerblue", THTMLCOL
, COL_SM_DODGERBLUE
},
564 { "firebrick", THTMLCOL
, COL_SM_FIREBRICK
},
565 { "floralwhite", THTMLCOL
, COL_SM_FLORALWHITE
},
566 { "forestgreen", THTMLCOL
, COL_SM_FORESTGREEN
},
567 { "fuchsia", TMATHMLCOL
, COL_SM_FUCHSIA
},
568 { "gainsboro", THTMLCOL
, COL_SM_GAINSBORO
},
569 { "ghostwhite", THTMLCOL
, COL_SM_GHOSTWHITE
},
570 { "gold", THTMLCOL
, COL_SM_GOLD
},
571 { "goldenrod", THTMLCOL
, COL_SM_GOLDENROD
},
572 { "gray", TMATHMLCOL
, COL_SM_GRAY
},
573 { "green", TMATHMLCOL
, COL_SM_GREEN
},
574 { "greenyellow", THTMLCOL
, COL_SM_GREENYELLOW
},
575 { "grey", THTMLCOL
, COL_SM_GREY
},
576 { "honeydew", THTMLCOL
, COL_SM_HONEYDEW
},
577 { "hotpink", THTMLCOL
, COL_SM_HOTPINK
},
578 { "indianred", THTMLCOL
, COL_SM_INDIANRED
},
579 { "indigo", THTMLCOL
, COL_SM_INDIGO
},
580 { "ivory", THTMLCOL
, COL_SM_IVORY
},
581 { "khaki", THTMLCOL
, COL_SM_KHAKI
},
582 { "lavender", THTMLCOL
, COL_SM_LAVENDER
},
583 { "lavenderblush", THTMLCOL
, COL_SM_LAVENDERBLUSH
},
584 { "lawngreen", THTMLCOL
, COL_SM_LAWNGREEN
},
585 { "lemonchiffon", THTMLCOL
, COL_SM_LEMONCHIFFON
},
586 { "lightblue", THTMLCOL
, COL_SM_LIGHTBLUE
},
587 { "lightcoral", THTMLCOL
, COL_SM_LIGHTCORAL
},
588 { "lightcyan", THTMLCOL
, COL_SM_LIGHTCYAN
},
589 { "lightgoldenrodyellow", THTMLCOL
, COL_SM_LIGHTGOLDENRODYELLOW
},
590 { "lightgray", THTMLCOL
, COL_SM_LIGHTGRAY
},
591 { "lightgreen", THTMLCOL
, COL_SM_LIGHTGREEN
},
592 { "lightgrey", THTMLCOL
, COL_SM_LIGHTGREY
},
593 { "lightpink", THTMLCOL
, COL_SM_LIGHTPINK
},
594 { "lightsalmon", THTMLCOL
, COL_SM_LIGHTSALMON
},
595 { "lightseagreen", THTMLCOL
, COL_SM_LIGHTSEAGREEN
},
596 { "lightskyblue", THTMLCOL
, COL_SM_LIGHTSKYBLUE
},
597 { "lightslategray", THTMLCOL
, COL_SM_LIGHTSLATEGRAY
},
598 { "lightslategrey", THTMLCOL
, COL_SM_LIGHTSLATEGREY
},
599 { "lightsteelblue", THTMLCOL
, COL_SM_LIGHTSTEELBLUE
},
600 { "lightyellow", THTMLCOL
, COL_SM_LIGHTYELLOW
},
601 { "lime", TMATHMLCOL
, COL_SM_LIME
},
602 { "limegreen", THTMLCOL
, COL_SM_LIMEGREEN
},
603 { "linen", THTMLCOL
, COL_SM_LINEN
},
604 { "magenta", TMATHMLCOL
, COL_SM_MAGENTA
},
605 { "maroon", TMATHMLCOL
, COL_SM_MAROON
},
606 { "mediumaquamarine", THTMLCOL
, COL_SM_MEDIUMAQUAMARINE
},
607 { "mediumblue", THTMLCOL
, COL_SM_MEDIUMBLUE
},
608 { "mediumorchid", THTMLCOL
, COL_SM_MEDIUMORCHID
},
609 { "mediumpurple", THTMLCOL
, COL_SM_MEDIUMPURPLE
},
610 { "mediumseagreen", THTMLCOL
, COL_SM_MEDIUMSEAGREEN
},
611 { "mediumslateblue", THTMLCOL
, COL_SM_MEDIUMSLATEBLUE
},
612 { "mediumspringgreen", THTMLCOL
, COL_SM_MEDIUMSPRINGGREEN
},
613 { "mediumturquoise", THTMLCOL
, COL_SM_MEDIUMTURQUOISE
},
614 { "mediumvioletred", THTMLCOL
, COL_SM_MEDIUMVIOLETRED
},
615 { "midnightblue", THTMLCOL
, COL_SM_MIDNIGHTBLUE
},
616 { "mintcream", THTMLCOL
, COL_SM_MINTCREAM
},
617 { "mistyrose", THTMLCOL
, COL_SM_MISTYROSE
},
618 { "moccasin", THTMLCOL
, COL_SM_MOCCASIN
},
619 { "navajowhite", THTMLCOL
, COL_SM_NAVAJOWHITE
},
620 { "navy", TMATHMLCOL
, COL_SM_NAVY
},
621 { "oldlace", THTMLCOL
, COL_SM_OLDLACE
},
622 { "olive", TMATHMLCOL
, COL_SM_OLIVE
},
623 { "olivedrab", THTMLCOL
, COL_SM_OLIVEDRAB
},
624 { "orange", THTMLCOL
, COL_SM_ORANGE
},
625 { "orangered", THTMLCOL
, COL_SM_ORANGERED
},
626 { "orchid", THTMLCOL
, COL_SM_ORCHID
},
627 { "palegoldenrod", THTMLCOL
, COL_SM_PALEGOLDENROD
},
628 { "palegreen", THTMLCOL
, COL_SM_PALEGREEN
},
629 { "paleturquoise", THTMLCOL
, COL_SM_PALETURQUOISE
},
630 { "palevioletred", THTMLCOL
, COL_SM_PALEVIOLETRED
},
631 { "papayawhip", THTMLCOL
, COL_SM_PAPAYAWHIP
},
632 { "peachpuff", THTMLCOL
, COL_SM_PEACHPUFF
},
633 { "peru", THTMLCOL
, COL_SM_PERU
},
634 { "pink", THTMLCOL
, COL_SM_PINK
},
635 { "plum", THTMLCOL
, COL_SM_PLUM
},
636 { "powderblue", THTMLCOL
, COL_SM_POWDERBLUE
},
637 { "purple", TMATHMLCOL
, COL_SM_PURPLE
},
638 { "rebeccapurple", THTMLCOL
, COL_SM_REBECCAPURPLE
},
639 { "red", TMATHMLCOL
, COL_SM_RED
},
640 { "rosybrown", THTMLCOL
, COL_SM_ROSYBROWN
},
641 { "royalblue", THTMLCOL
, COL_SM_ROYALBLUE
},
642 { "saddlebrown", THTMLCOL
, COL_SM_SADDLEBROWN
},
643 { "salmon", THTMLCOL
, COL_SM_SALMON
},
644 { "sandybrown", THTMLCOL
, COL_SM_SANDYBROWN
},
645 { "seagreen", THTMLCOL
, COL_SM_SEAGREEN
},
646 { "seashell", THTMLCOL
, COL_SM_SEASHELL
},
647 { "sienna", THTMLCOL
, COL_SM_SIENNA
},
648 { "silver", TMATHMLCOL
, COL_SM_SILVER
},
649 { "skyblue", THTMLCOL
, COL_SM_SKYBLUE
},
650 { "slateblue", THTMLCOL
, COL_SM_SLATEBLUE
},
651 { "slategray", THTMLCOL
, COL_SM_SLATEGRAY
},
652 { "slategrey", THTMLCOL
, COL_SM_SLATEGREY
},
653 { "snow", THTMLCOL
, COL_SM_SNOW
},
654 { "springgreen", THTMLCOL
, COL_SM_SPRINGGREEN
},
655 { "steelblue", THTMLCOL
, COL_SM_STEELBLUE
},
656 { "tan", THTMLCOL
, COL_SM_TAN
},
657 { "teal", TMATHMLCOL
, COL_SM_TEAL
},
658 { "thistle", THTMLCOL
, COL_SM_THISTLE
},
659 { "tomato", THTMLCOL
, COL_SM_TOMATO
},
660 { "turquoise", THTMLCOL
, COL_SM_TURQUOISE
},
661 { "violet", THTMLCOL
, COL_SM_VIOLET
},
662 { "wheat", THTMLCOL
, COL_SM_WHEAT
},
663 { "white", TMATHMLCOL
, COL_SM_WHITE
},
664 { "whitesmoke", THTMLCOL
, COL_SM_WHITESMOKE
},
665 { "yellow", TMATHMLCOL
, COL_SM_YELLOW
},
666 { "yellowgreen", THTMLCOL
, COL_SM_YELLOWGREEN
} };
668 const SmColorTokenTableEntry
starmathdatabase::aColorTokenTableDVIPS
[]
669 = { { "apricot", TDVIPSNAMESCOL
, COL_SM_DIV_APRICOT
},
670 { "aquamarine", TDVIPSNAMESCOL
, COL_SM_DIV_AQUAMARINE
},
671 { "bittersweet", TDVIPSNAMESCOL
, COL_SM_DIV_BITTERSWEET
},
672 { "black", TDVIPSNAMESCOL
, COL_SM_BLACK
},
673 { "blue", TDVIPSNAMESCOL
, COL_SM_BLACK
} };
675 const SmColorTokenTableEntry
starmathdatabase::aColorTokenTableMATHML
[] = {
677 { "aqua", TMATHMLCOL
, COL_SM_AQUA
},
678 { "black", TMATHMLCOL
, COL_SM_BLACK
},
679 { "blue", TMATHMLCOL
, COL_SM_BLUE
},
680 { "fuchsia", TMATHMLCOL
, COL_SM_FUCHSIA
},
681 { "gray", TMATHMLCOL
, COL_SM_GRAY
},
682 { "green", TMATHMLCOL
, COL_SM_GREEN
},
683 { "lime", TMATHMLCOL
, COL_SM_LIME
},
684 { "maroon", TMATHMLCOL
, COL_SM_MAROON
},
685 { "navy", TMATHMLCOL
, COL_SM_NAVY
},
686 { "olive", TMATHMLCOL
, COL_SM_OLIVE
},
687 { "purple", TMATHMLCOL
, COL_SM_PURPLE
},
688 { "red", TMATHMLCOL
, COL_SM_RED
},
689 { "silver", TMATHMLCOL
, COL_SM_SILVER
},
690 { "teal", TMATHMLCOL
, COL_SM_TEAL
},
691 { "white", TMATHMLCOL
, COL_SM_WHITE
},
692 { "yellow", TMATHMLCOL
, COL_SM_YELLOW
}
696 const SmColorTokenTableEntry
starmathdatabase::aColorTokenTableERROR
[]
697 = { { "", TERROR
, COL_SM_BLACK
} };
699 SmColorTokenTableEntry
starmathdatabase::Identify_Color_Parser(sal_uInt32 cColor
)
701 for (auto i
= std::begin(aColorTokenTableParse
); i
< std::end(aColorTokenTableParse
); ++i
)
702 if (i
->equals(cColor
))
704 for (auto i
= std::begin(aColorTokenTableDVIPS
); i
< std::end(aColorTokenTableDVIPS
); ++i
)
705 if (i
->equals(cColor
))
707 if ((cColor
& 0x00FFFFFF) == cColor
)
708 return SmColorTokenTableEntry("", TRGB
, cColor
);
710 return SmColorTokenTableEntry("", TRGBA
, cColor
);
713 SmColorTokenTableEntry
starmathdatabase::Identify_Color_MATHML(sal_uInt32 cColor
)
715 for (auto i
= std::begin(aColorTokenTableMATHML
); i
< std::end(aColorTokenTableMATHML
); ++i
)
716 if (i
->equals(cColor
))
718 if ((cColor
& 0x00FFFFFF) == cColor
)
719 return SmColorTokenTableEntry("", TRGB
, cColor
);
721 return SmColorTokenTableEntry("", TRGBA
, cColor
);
724 SmColorTokenTableEntry
starmathdatabase::Identify_Color_DVIPSNAMES(sal_uInt32 cColor
)
726 for (auto i
= std::begin(aColorTokenTableDVIPS
); i
< std::end(aColorTokenTableDVIPS
); ++i
)
727 if (i
->equals(cColor
))
729 if ((cColor
& 0x00FFFFFF) == cColor
)
730 return SmColorTokenTableEntry("", TRGB
, cColor
);
732 return SmColorTokenTableEntry("", TRGBA
, cColor
);
735 const SmColorTokenTableEntry
*
736 starmathdatabase::Identify_ColorName_Parser(std::u16string_view colorname
)
738 if (colorname
.empty())
739 return &aColorTokenTableERROR
[0];
740 for (auto i
= std::begin(aColorTokenTableParse
); i
< std::end(aColorTokenTableParse
); ++i
)
742 sal_Int32 matches
= o3tl::compareToIgnoreAsciiCase(colorname
, i
->aIdent
);
748 return &aColorTokenTableERROR
[0];
750 SmColorTokenTableEntry
starmathdatabase::Identify_ColorName_HTML(std::u16string_view colorname
)
752 if (colorname
.empty())
753 return SmColorTokenTableEntry("", TERROR
, COL_SM_BLACK
);
754 if (colorname
[0] == '#')
756 Color col
= Color::STRtoRGB(colorname
);
757 return SmColorTokenTableEntry("", TRGB
, col
);
759 for (auto i
= std::begin(aColorTokenTableHTML
); i
< std::end(aColorTokenTableHTML
); ++i
)
761 sal_Int32 matches
= o3tl::compareToIgnoreAsciiCase(colorname
, i
->aIdent
);
767 return SmColorTokenTableEntry("", TERROR
, COL_SM_BLACK
);
769 const SmColorTokenTableEntry
*
770 starmathdatabase::Identify_ColorName_DVIPSNAMES(std::u16string_view colorname
)
772 if (colorname
.empty())
773 return &aColorTokenTableERROR
[0];
774 for (auto i
= std::begin(aColorTokenTableDVIPS
); i
< std::end(aColorTokenTableDVIPS
); ++i
)
776 sal_Int32 matches
= o3tl::compareToIgnoreAsciiCase(colorname
, i
->aIdent
);
782 return &aColorTokenTableERROR
[0];