tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / svtools / source / svhtml / htmlkywd.cxx
blob434e1cb9e48848a4b2e02f8075ad92c4e96d5ce2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
21 #include <algorithm>
22 #include <string_view>
24 #include <o3tl/string_view.hxx>
25 #include <sal/types.h>
26 #include <rtl/ustring.hxx>
27 #include <svtools/htmltokn.h>
28 #include <svtools/htmlkywd.hxx>
30 // If this is odd, then getOnToken() breaks.
31 static_assert(static_cast<sal_Int16>(HtmlTokenId::ABBREVIATION_ON) % 2 == 0);
33 namespace {
35 template<typename T>
36 struct TokenEntry
38 std::u16string_view sToken;
39 T nToken;
44 template<typename T>
45 static bool sortCompare(const TokenEntry<T> & lhs, const TokenEntry<T> & rhs)
47 return lhs.sToken < rhs.sToken;
49 template<typename T>
50 static bool findCompare(const TokenEntry<T> & lhs, std::u16string_view rhs)
52 return lhs.sToken < rhs;
54 template<typename T, size_t LEN>
55 static T search(TokenEntry<T> const (&dataTable)[LEN], std::u16string_view key, T notFoundValue)
57 auto findIt = std::lower_bound( std::begin(dataTable), std::end(dataTable),
58 key, findCompare<T> );
59 if (findIt != std::end(dataTable) && key == findIt->sToken)
60 return findIt->nToken;
61 return notFoundValue;
64 using HTML_TokenEntry = TokenEntry<HtmlTokenId>;
66 // this array is sorted by the name (even if it doesn't look like it from the constant names)
67 HTML_TokenEntry const aHTMLTokenTab[] = {
68 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_comment), HtmlTokenId::COMMENT},
69 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_doctype), HtmlTokenId::DOCTYPE},
70 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_cdata), HtmlTokenId::CDATA},
71 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_anchor), HtmlTokenId::ANCHOR_ON},
72 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_abbreviation), HtmlTokenId::ABBREVIATION_ON}, // HTML 3.0
73 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_acronym), HtmlTokenId::ACRONYM_ON}, // HTML 3.0
74 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_address), HtmlTokenId::ADDRESS_ON},
75 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_applet), HtmlTokenId::APPLET_ON}, // HotJava
76 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_area), HtmlTokenId::AREA}, // Netscape 2.0
77 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_author), HtmlTokenId::AUTHOR_ON}, // HTML 3.0
78 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_bold), HtmlTokenId::BOLD_ON},
79 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_banner), HtmlTokenId::BANNER_ON}, // HTML 3.0
80 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_base), HtmlTokenId::BASE}, // HTML 3.0
81 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_basefont), HtmlTokenId::BASEFONT_ON}, // Netscape
82 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_bigprint), HtmlTokenId::BIGPRINT_ON}, // HTML 3.0
83 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_blink), HtmlTokenId::BLINK_ON}, // Netscape
84 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_blockquote), HtmlTokenId::BLOCKQUOTE_ON},
85 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_body), HtmlTokenId::BODY_ON},
86 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_blockquote30), HtmlTokenId::BLOCKQUOTE30_ON}, // HTML 3.0
87 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_linebreak), HtmlTokenId::LINEBREAK},
88 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_caption), HtmlTokenId::CAPTION_ON}, // HTML 3.0
89 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_center), HtmlTokenId::CENTER_ON}, // Netscape
90 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_citation), HtmlTokenId::CITATION_ON},
91 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_code), HtmlTokenId::CODE_ON},
92 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_col), HtmlTokenId::COL_ON}, // HTML 3 Table Model Draft
93 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_colgroup), HtmlTokenId::COLGROUP_ON}, // HTML 3 Table Model Draft
94 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_comment2), HtmlTokenId::COMMENT2_ON},
95 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_credit), HtmlTokenId::CREDIT_ON}, // HTML 3.0
96 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_dd), HtmlTokenId::DD_ON},
97 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_deletedtext), HtmlTokenId::DELETEDTEXT_ON}, // HTML 3.0
98 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_definstance), HtmlTokenId::DEFINSTANCE_ON},
99 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_dirlist), HtmlTokenId::DIRLIST_ON},
100 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_division), HtmlTokenId::DIVISION_ON}, // HTML 3.0
101 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_deflist), HtmlTokenId::DEFLIST_ON},
102 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_dt), HtmlTokenId::DT_ON},
103 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_emphasis), HtmlTokenId::EMPHASIS_ON},
104 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_embed), HtmlTokenId::EMBED}, // Netscape 2.0
105 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_figure), HtmlTokenId::FIGURE_ON}, // HTML 3.0
106 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_footnote), HtmlTokenId::FOOTNOTE_ON}, // HTML 3.0
107 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_font), HtmlTokenId::FONT_ON}, // Netscape
108 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_form), HtmlTokenId::FORM_ON},
109 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_frame), HtmlTokenId::FRAME_ON}, // Netscape 2.0
110 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_frameset), HtmlTokenId::FRAMESET_ON}, // Netscape 2.0
111 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_head1), HtmlTokenId::HEAD1_ON},
112 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_head2), HtmlTokenId::HEAD2_ON},
113 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_head3), HtmlTokenId::HEAD3_ON},
114 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_head4), HtmlTokenId::HEAD4_ON},
115 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_head5), HtmlTokenId::HEAD5_ON},
116 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_head6), HtmlTokenId::HEAD6_ON},
117 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_head), HtmlTokenId::HEAD_ON},
118 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_horzrule), HtmlTokenId::HORZRULE},
119 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_html), HtmlTokenId::HTML_ON},
120 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_italic), HtmlTokenId::ITALIC_ON},
121 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_iframe), HtmlTokenId::IFRAME_ON}, // IE 3.0b2
122 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_image), HtmlTokenId::IMAGE},
123 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_input), HtmlTokenId::INPUT},
124 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_insertedtext), HtmlTokenId::INSERTEDTEXT_ON}, // HTML 3.0
125 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_keyboard), HtmlTokenId::KEYBOARD_ON},
126 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_language), HtmlTokenId::LANGUAGE_ON}, // HTML 3.0
127 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_listheader), HtmlTokenId::LISTHEADER_ON}, // HTML 3.0
128 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_li), HtmlTokenId::LI_ON},
129 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_link), HtmlTokenId::LINK}, // HTML 3.0
130 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_listing), HtmlTokenId::LISTING_ON},
131 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_map), HtmlTokenId::MAP_ON}, // Netscape 2.0
132 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_marquee), HtmlTokenId::MARQUEE_ON},
133 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_menulist), HtmlTokenId::MENULIST_ON},
134 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_meta), HtmlTokenId::META}, // HTML 3.0
135 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_multicol), HtmlTokenId::MULTICOL_ON}, // Netscape 3.0b5
136 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_nobr), HtmlTokenId::NOBR_ON}, // Netscape
137 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_noembed), HtmlTokenId::NOEMBED_ON}, // Netscape 2.0 ???
138 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_noframe), HtmlTokenId::NOFRAMES_ON}, // Netscape 2.0 ???
139 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_noframes), HtmlTokenId::NOFRAMES_ON}, // Netscape 2.0
140 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_noscript), HtmlTokenId::NOSCRIPT_ON}, // Netscape 3.0
141 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_note), HtmlTokenId::NOTE_ON}, // HTML 3.0
142 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_object), HtmlTokenId::OBJECT_ON},
143 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_orderlist), HtmlTokenId::ORDERLIST_ON},
144 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_option), HtmlTokenId::OPTION},
145 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_parabreak), HtmlTokenId::PARABREAK_ON},
146 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_param), HtmlTokenId::PARAM}, // HotJava
147 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_person), HtmlTokenId::PERSON_ON}, // HTML 3.0
148 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_plaintext2), HtmlTokenId::PLAINTEXT2_ON},
149 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_preformtxt), HtmlTokenId::PREFORMTXT_ON},
150 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_shortquote), HtmlTokenId::SHORTQUOTE_ON}, // HTML 3.0
151 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_strikethrough), HtmlTokenId::STRIKETHROUGH_ON}, // HTML 3.0
152 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_sample), HtmlTokenId::SAMPLE_ON},
153 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_script), HtmlTokenId::SCRIPT_ON}, // HTML 3.2
154 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_sdfield), HtmlTokenId::SDFIELD_ON},
155 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_select), HtmlTokenId::SELECT_ON},
156 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_smallprint), HtmlTokenId::SMALLPRINT_ON}, // HTML 3.0
157 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_spacer), HtmlTokenId::SPACER}, // Netscape 3.0b5
158 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_span), HtmlTokenId::SPAN_ON}, // Style Sheets
159 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_strike), HtmlTokenId::STRIKE_ON},
160 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_strong), HtmlTokenId::STRONG_ON},
161 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_style), HtmlTokenId::STYLE_ON}, // HTML 3.0
162 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_subscript), HtmlTokenId::SUBSCRIPT_ON}, // HTML 3.0
163 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_superscript), HtmlTokenId::SUPERSCRIPT_ON}, // HTML 3.0
164 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_plaintext), HtmlTokenId::PLAINTEXT_ON}, // HTML 3.0
165 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_table), HtmlTokenId::TABLE_ON}, // HTML 3.0
166 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_tbody), HtmlTokenId::TBODY_ON}, // HTML 3 Table Model Draft
167 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_tabledata), HtmlTokenId::TABLEDATA_ON}, // HTML 3.0
168 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_textarea), HtmlTokenId::TEXTAREA_ON},
169 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_tfoot), HtmlTokenId::TFOOT_ON}, // HTML 3 Table Model Draft
170 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_tableheader), HtmlTokenId::TABLEHEADER_ON}, // HTML 3.0
171 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_thead), HtmlTokenId::THEAD_ON}, // HTML 3 Table Model Draft
172 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_title), HtmlTokenId::TITLE_ON},
173 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_tablerow), HtmlTokenId::TABLEROW_ON}, // HTML 3.0
174 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_teletype), HtmlTokenId::TELETYPE_ON},
175 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_underline), HtmlTokenId::UNDERLINE_ON},
176 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_unorderlist), HtmlTokenId::UNORDERLIST_ON},
177 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_variable), HtmlTokenId::VARIABLE_ON},
178 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_xmp), HtmlTokenId::XMP_ON},
182 HtmlTokenId GetHTMLToken( std::u16string_view rName )
184 static bool bSortKeyWords = false;
185 if( !bSortKeyWords )
187 assert( std::is_sorted( std::begin(aHTMLTokenTab), std::end(aHTMLTokenTab), sortCompare<HtmlTokenId> ) );
188 bSortKeyWords = true;
191 if( o3tl::starts_with( rName, u"" OOO_STRING_SVTOOLS_HTML_comment ))
192 return HtmlTokenId::COMMENT;
194 return search( aHTMLTokenTab, rName, HtmlTokenId::NONE);
197 using HTML_CharEntry = TokenEntry<sal_Unicode>;
199 // Flag: RTF token table has already been sorted
200 static bool bSortCharKeyWords = false;
202 static HTML_CharEntry aHTMLCharNameTab[] = {
203 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_lt), 60},
204 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_gt), 62},
205 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_amp), 38},
206 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_apos), 39},
207 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_quot), 34},
209 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Agrave), 192},
210 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Aacute), 193},
211 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Acirc), 194},
212 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Atilde), 195},
213 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Auml), 196},
214 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Aring), 197},
215 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_AElig), 198},
216 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Ccedil), 199},
217 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Egrave), 200},
218 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Eacute), 201},
219 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Ecirc), 202},
220 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Euml), 203},
221 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Igrave), 204},
222 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Iacute), 205},
223 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Icirc), 206},
224 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Iuml), 207},
225 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_ETH), 208},
226 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Ntilde), 209},
227 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Ograve), 210},
228 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Oacute), 211},
229 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Ocirc), 212},
230 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Otilde), 213},
231 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Ouml), 214},
232 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Oslash), 216},
233 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Ugrave), 217},
234 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Uacute), 218},
235 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Ucirc), 219},
236 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Uuml), 220},
237 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_Yacute), 221},
239 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_THORN), 222},
240 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_C_szlig), 223},
242 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_agrave), 224},
243 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_aacute), 225},
244 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_acirc), 226},
245 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_atilde), 227},
246 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_auml), 228},
247 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_aring), 229},
248 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_aelig), 230},
249 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ccedil), 231},
250 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_egrave), 232},
251 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_eacute), 233},
252 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ecirc), 234},
253 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_euml), 235},
254 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_igrave), 236},
255 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_iacute), 237},
256 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_icirc), 238},
257 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_iuml), 239},
258 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_eth), 240},
259 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ntilde), 241},
260 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ograve), 242},
261 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_oacute), 243},
262 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ocirc), 244},
263 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_otilde), 245},
264 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ouml), 246},
265 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_oslash), 248},
266 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ugrave), 249},
267 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_uacute), 250},
268 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ucirc), 251},
269 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_uuml), 252},
270 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_yacute), 253},
271 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_thorn), 254},
272 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_yuml), 255},
274 // special characters
275 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_acute), 180},
276 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_brvbar), 166},
277 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_cedil), 184},
278 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_cent), 162},
279 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_copy), 169},
280 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_curren), 164},
281 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_deg), 176},
282 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_divide), 247},
283 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_frac12), 189},
284 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_frac14), 188},
285 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_frac34), 190},
286 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_iexcl), 161},
287 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_iquest), 191},
288 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_laquo), 171},
289 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_macr), 175},
290 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_micro), 181},
291 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_middot), 183},
292 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_not), 172},
293 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ordf), 170},
294 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ordm), 186},
295 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_para), 182},
296 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_plusmn), 177},
297 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_pound), 163},
298 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_raquo), 187},
299 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_reg), 174},
300 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sect), 167},
301 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sup1), 185},
302 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sup2), 178},
303 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sup3), 179},
304 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_times), 215},
305 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_uml), 168},
306 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_yen), 165},
308 // special characters), which will be converted to tokens !!!
309 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_nbsp), 1},
310 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_shy), 2},
313 // HTML4
314 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_OElig), 338},
315 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_oelig), 339},
316 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Scaron), 352},
317 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_scaron), 353},
318 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Yuml), 376},
319 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_fnof), 402},
320 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_circ), 710},
321 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_tilde), 732},
322 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Alpha), 913},
323 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Beta), 914},
324 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Gamma), 915},
325 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Delta), 916},
326 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Epsilon), 917},
327 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Zeta), 918},
328 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Eta), 919},
329 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Theta), 920},
330 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Iota), 921},
331 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Kappa), 922},
332 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Lambda), 923},
333 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Mu), 924},
334 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Nu), 925},
335 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Xi), 926},
336 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Omicron), 927},
337 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Pi), 928},
338 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Rho), 929},
339 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Sigma), 931},
340 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Tau), 932},
341 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Upsilon), 933},
342 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Phi), 934},
343 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Chi), 935},
344 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Psi), 936},
345 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Omega), 937},
346 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_alpha), 945},
347 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_beta), 946},
348 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_gamma), 947},
349 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_delta), 948},
350 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_epsilon), 949},
351 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_zeta), 950},
352 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_eta), 951},
353 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_theta), 952},
354 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_iota), 953},
355 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_kappa), 954},
356 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_lambda), 955},
357 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_mu), 956},
358 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_nu), 957},
359 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_xi), 958},
360 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_omicron), 959},
361 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_pi), 960},
362 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_rho), 961},
363 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sigmaf), 962},
364 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sigma), 963},
365 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_tau), 964},
366 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_upsilon), 965},
367 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_phi), 966},
368 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_chi), 967},
369 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_psi), 968},
370 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_omega), 969},
371 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_thetasym), 977},
372 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_upsih), 978},
373 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_piv), 982},
374 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ensp), 8194},
375 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_emsp), 8195},
376 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_thinsp), 8201},
377 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_zwnj), 8204},
378 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_zwj), 8205},
379 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_lrm), 8206},
380 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_rlm), 8207},
381 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ndash), 8211},
382 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_mdash), 8212},
383 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_lsquo), 8216},
384 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_rsquo), 8217},
385 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sbquo), 8218},
386 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ldquo), 8220},
387 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_rdquo), 8221},
388 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_bdquo), 8222},
389 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_dagger), 8224},
390 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Dagger), 8225},
391 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_bull), 8226},
392 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_hellip), 8230},
393 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_permil), 8240},
394 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_prime), 8242},
395 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_Prime), 8243},
396 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_lsaquo), 8249},
397 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_rsaquo), 8250},
398 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_oline), 8254},
399 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_frasl), 8260},
400 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_euro), 8364},
401 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_image), 8465},
402 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_weierp), 8472},
403 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_real), 8476},
404 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_trade), 8482},
405 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_alefsym), 8501},
406 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_larr), 8592},
407 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_uarr), 8593},
408 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_rarr), 8594},
409 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_darr), 8595},
410 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_harr), 8596},
411 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_crarr), 8629},
412 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_lArr), 8656},
413 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_uArr), 8657},
414 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_rArr), 8658},
415 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_dArr), 8659},
416 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_hArr), 8660},
417 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_forall), 8704},
418 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_part), 8706},
419 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_exist), 8707},
420 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_empty), 8709},
421 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_nabla), 8711},
422 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_isin), 8712},
423 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_notin), 8713},
424 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ni), 8715},
425 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_prod), 8719},
426 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sum), 8721},
427 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_minus), 8722},
428 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_lowast), 8727},
429 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_radic), 8730},
430 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_prop), 8733},
431 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_infin), 8734},
432 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ang), 8736},
433 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_and), 8743},
434 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_or), 8744},
435 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_cap), 8745},
436 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_cup), 8746},
437 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_int), 8747},
438 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_there4), 8756},
439 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sim), 8764},
440 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_cong), 8773},
441 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_asymp), 8776},
442 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ne), 8800},
443 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_equiv), 8801},
444 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_le), 8804},
445 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_ge), 8805},
446 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sub), 8834},
447 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sup), 8835},
448 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_nsub), 8836},
449 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sube), 8838},
450 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_supe), 8839},
451 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_oplus), 8853},
452 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_otimes), 8855},
453 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_perp), 8869},
454 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_sdot), 8901},
455 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_lceil), 8968},
456 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_rceil), 8969},
457 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_lfloor), 8970},
458 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_rfloor), 8971},
459 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_lang), 9001},
460 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_rang), 9002},
461 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_loz), 9674},
462 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_spades), 9824},
463 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_clubs), 9827},
464 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_hearts), 9829},
465 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_S_diams), 9830}
468 sal_Unicode GetHTMLCharName( std::u16string_view rName )
470 if( !bSortCharKeyWords )
472 std::sort( std::begin(aHTMLCharNameTab), std::end(aHTMLCharNameTab),
473 sortCompare<sal_Unicode> );
474 bSortCharKeyWords = true;
477 return search<sal_Unicode>( aHTMLCharNameTab, rName, 0);
480 // Flag: Options table has already been sorted
481 static bool bSortOptionKeyWords = false;
483 using HTML_OptionEntry = TokenEntry<HtmlOptionId>;
485 static HTML_OptionEntry aHTMLOptionTab[] = {
487 // Attributes without value
488 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_checked), HtmlOptionId::CHECKED},
489 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_compact), HtmlOptionId::COMPACT},
490 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_declare), HtmlOptionId::DECLARE},
491 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_disabled), HtmlOptionId::DISABLED},
492 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_ismap), HtmlOptionId::ISMAP},
493 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_mayscript), HtmlOptionId::MAYSCRIPT},
494 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_multiple), HtmlOptionId::MULTIPLE},
495 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_nohref), HtmlOptionId::NOHREF}, // Netscape 2.0
496 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_noresize), HtmlOptionId::NORESIZE}, // Netscape 2.0
497 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_noshade), HtmlOptionId::NOSHADE}, // Netscape 2.0
498 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_nowrap), HtmlOptionId::NOWRAP},
499 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_sdfixed), HtmlOptionId::SDFIXED},
500 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_selected), HtmlOptionId::SELECTED},
502 // Attributes with a string value
503 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_accept), HtmlOptionId::ACCEPT},
504 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_accesskey), HtmlOptionId::ACCESSKEY},
505 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_alt), HtmlOptionId::ALT},
506 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_axis), HtmlOptionId::AXIS},
507 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_char), HtmlOptionId::CHAR}, // HTML 3 Table Model Draft
508 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_charset), HtmlOptionId::CHARSET},
509 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_class), HtmlOptionId::CLASS},
510 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_code), HtmlOptionId::CODE}, // HotJava
511 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_codetype), HtmlOptionId::CODETYPE},
512 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_content), HtmlOptionId::CONTENT},
513 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_coords), HtmlOptionId::COORDS}, // Netscape 2.0
514 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_enctype), HtmlOptionId::ENCTYPE},
515 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_face), HtmlOptionId::FACE}, // IExplorer 2.0
516 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_frameborder), HtmlOptionId::FRAMEBORDER}, // IExplorer 3.0
517 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_httpequiv), HtmlOptionId::HTTPEQUIV},
518 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_language), HtmlOptionId::LANGUAGE}, // JavaScript
519 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_name), HtmlOptionId::NAME},
520 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_prompt), HtmlOptionId::PROMPT},
521 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_shape), HtmlOptionId::SHAPE},
522 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_standby), HtmlOptionId::STANDBY},
523 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_style), HtmlOptionId::STYLE},
524 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_title), HtmlOptionId::TITLE},
525 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_value), HtmlOptionId::VALUE},
526 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDval), HtmlOptionId::SDVAL}, // StarDiv NumberValue
527 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_DSval), HtmlOptionId::DSVAL},
528 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDnum), HtmlOptionId::SDNUM}, // StarDiv NumberFormat
529 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_DSnum), HtmlOptionId::DSNUM},
530 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_DSformula), HtmlOptionId::DSFORMULA},
531 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_sdlibrary), HtmlOptionId::SDLIBRARY},
532 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_sdmodule), HtmlOptionId::SDMODULE},
534 // Attributes with a SGML identifier value
535 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_id), HtmlOptionId::ID},
536 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_target), HtmlOptionId::TARGET}, // Netscape 2.0
537 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_to), HtmlOptionId::TO},
539 // Attributes with a URI value
540 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_action), HtmlOptionId::ACTION},
541 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_archive), HtmlOptionId::ARCHIVE},
542 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_background), HtmlOptionId::BACKGROUND},
543 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_classid), HtmlOptionId::CLASSID},
544 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_codebase), HtmlOptionId::CODEBASE}, // HotJava
545 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_data), HtmlOptionId::DATA},
546 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_href), HtmlOptionId::HREF},
547 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_script), HtmlOptionId::SCRIPT},
548 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_src), HtmlOptionId::SRC},
549 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_usemap), HtmlOptionId::USEMAP}, // Netscape 2.0
551 // Attributes with a color value (all Netscape versions)
552 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_alink), HtmlOptionId::ALINK},
553 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_bgcolor), HtmlOptionId::BGCOLOR},
554 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_bordercolor), HtmlOptionId::BORDERCOLOR}, // IExplorer 2.0
555 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_bordercolorlight), HtmlOptionId::BORDERCOLORLIGHT}, // IExplorer 2.0
556 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_bordercolordark), HtmlOptionId::BORDERCOLORDARK}, // IExplorer 2.0
557 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_color), HtmlOptionId::COLOR},
558 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_link), HtmlOptionId::LINK},
559 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_text), HtmlOptionId::TEXT},
560 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_vlink), HtmlOptionId::VLINK},
562 // Attributes with a numerical value
563 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_border), HtmlOptionId::BORDER},
564 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_cellspacing),HtmlOptionId::CELLSPACING}, // HTML 3 Table Model Draft
565 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_cellpadding),HtmlOptionId::CELLPADDING}, // HTML 3 Table Model Draft
566 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_charoff), HtmlOptionId::CHAROFF}, // HTML 3 Table Model Draft
567 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_colspan), HtmlOptionId::COLSPAN},
568 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_framespacing), HtmlOptionId::FRAMESPACING}, // IExplorer 3.0
569 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_gutter), HtmlOptionId::GUTTER}, // Netscape 3.0b5
570 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_height), HtmlOptionId::HEIGHT},
571 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_hspace), HtmlOptionId::HSPACE}, // Netscape
572 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_left), HtmlOptionId::LEFT},
573 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_loop), HtmlOptionId::LOOP}, // IExplorer 2.0
574 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_marginheight),HtmlOptionId::MARGINHEIGHT}, // Netscape 2.0
575 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_marginwidth),HtmlOptionId::MARGINWIDTH}, // Netscape 2.0
576 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_maxlength), HtmlOptionId::MAXLENGTH},
577 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_rowspan), HtmlOptionId::ROWSPAN},
578 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_scrollamount), HtmlOptionId::SCROLLAMOUNT}, // IExplorer 2.0
579 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_scrolldelay), HtmlOptionId::SCROLLDELAY}, // IExplorer 2.0
580 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_span), HtmlOptionId::SPAN}, // HTML 3 Table Model Draft
581 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_tabindex), HtmlOptionId::TABINDEX},
582 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_vspace), HtmlOptionId::VSPACE}, // Netscape
583 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_width), HtmlOptionId::WIDTH},
584 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_zindex), HtmlOptionId::ZINDEX},
586 // Attributes with enum values
587 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_behavior), HtmlOptionId::BEHAVIOR}, // IExplorer 2.0
588 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_clear), HtmlOptionId::CLEAR},
589 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_dir), HtmlOptionId::DIR}, // HTML 3 Table Model Draft
590 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_direction), HtmlOptionId::DIRECTION}, // IExplorer 2.0
591 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_format), HtmlOptionId::FORMAT},
592 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_frame), HtmlOptionId::FRAME}, // HTML 3 Table Model Draft
593 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_lang), HtmlOptionId::LANG},
594 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_method), HtmlOptionId::METHOD},
595 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_rel), HtmlOptionId::REL},
596 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_rev), HtmlOptionId::REV},
597 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_rules), HtmlOptionId::RULES}, // HTML 3 Table Model Draft
598 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_scrolling), HtmlOptionId::SCROLLING}, // Netscape 2.0
599 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_sdreadonly), HtmlOptionId::SDREADONLY},
600 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_subtype), HtmlOptionId::SUBTYPE},
601 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_type), HtmlOptionId::TYPE},
602 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_valign), HtmlOptionId::VALIGN},
603 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_valuetype), HtmlOptionId::VALUETYPE},
604 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_wrap), HtmlOptionId::WRAP},
605 {std::u16string_view(u"" OOO_STRING_SVTOOLS_XHTML_O_xml_space), HtmlOptionId::XML_SPACE},
607 // Attributes with script code value
608 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onblur), HtmlOptionId::ONBLUR}, // JavaScript
609 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onchange), HtmlOptionId::ONCHANGE}, // JavaScript
610 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onclick), HtmlOptionId::ONCLICK}, // JavaScript
611 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onfocus), HtmlOptionId::ONFOCUS}, // JavaScript
612 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onload), HtmlOptionId::ONLOAD}, // JavaScript
613 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onmouseover), HtmlOptionId::ONMOUSEOVER}, // JavaScript
614 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onreset), HtmlOptionId::ONRESET}, // JavaScript
615 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onselect), HtmlOptionId::ONSELECT}, // JavaScript
616 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onsubmit), HtmlOptionId::ONSUBMIT}, // JavaScript
617 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onunload), HtmlOptionId::ONUNLOAD}, // JavaScript
618 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onabort), HtmlOptionId::ONABORT}, // JavaScript
619 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onerror), HtmlOptionId::ONERROR}, // JavaScript
620 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_onmouseout), HtmlOptionId::ONMOUSEOUT}, // JavaScript
622 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonblur), HtmlOptionId::SDONBLUR}, // StarBasic
623 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonchange), HtmlOptionId::SDONCHANGE}, // StarBasic
624 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonclick), HtmlOptionId::SDONCLICK}, // StarBasic
625 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonfocus), HtmlOptionId::SDONFOCUS}, // StarBasic
626 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonload), HtmlOptionId::SDONLOAD}, // StarBasic
627 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonmouseover), HtmlOptionId::SDONMOUSEOVER}, // StarBasic
628 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonreset), HtmlOptionId::SDONRESET}, // StarBasic
629 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonselect), HtmlOptionId::SDONSELECT}, // StarBasic
630 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonsubmit), HtmlOptionId::SDONSUBMIT}, // StarBasic
631 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonunload), HtmlOptionId::SDONUNLOAD}, // StarBasic
632 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonabort), HtmlOptionId::SDONABORT}, // StarBasic
633 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonerror), HtmlOptionId::SDONERROR}, // StarBasic
634 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_SDonmouseout), HtmlOptionId::SDONMOUSEOUT}, // StarBasic
636 // Attributes with context sensitive values
637 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_align), HtmlOptionId::ALIGN},
638 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_cols), HtmlOptionId::COLS}, // Netscape 2.0 vs HTML 2.0
639 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_rows), HtmlOptionId::ROWS}, // Netscape 2.0 vs HTML 2.0
640 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_size), HtmlOptionId::SIZE},
641 {std::u16string_view(u"" OOO_STRING_SVTOOLS_HTML_O_start), HtmlOptionId::START}, // Netscape 2.0 vs IExplorer 2.0
644 HtmlOptionId GetHTMLOption( std::u16string_view rName )
646 if( !bSortOptionKeyWords )
648 std::sort( std::begin(aHTMLOptionTab), std::end(aHTMLOptionTab), sortCompare<HtmlOptionId> );
649 bSortOptionKeyWords = true;
652 return search( aHTMLOptionTab, rName, HtmlOptionId::UNKNOWN);
656 using HTML_ColorEntry = TokenEntry<sal_uInt32>;
658 // Flag: color table has already been sorted
659 static bool bSortColorKeyWords = false;
661 // Color names are not exported (source:
662 // "http://www.uio.no/~mnbjerke/colors_w.html")
663 // "http://www.infi.net/wwwimages/colorindex.html" seem to be buggy.
664 HTML_ColorEntry const aHTMLColorNameTab[] = {
665 { std::u16string_view(u"aliceblue"), 0x00f0f8ffUL },
666 { std::u16string_view(u"antiquewhite"), 0x00faebd7UL },
667 { std::u16string_view(u"aqua"), 0x0000ffffUL },
668 { std::u16string_view(u"aquamarine"), 0x007fffd4UL },
669 { std::u16string_view(u"azure"), 0x00f0ffffUL },
670 { std::u16string_view(u"beige"), 0x00f5f5dcUL },
671 { std::u16string_view(u"bisque"), 0x00ffe4c4UL },
672 { std::u16string_view(u"black"), 0x00000000UL },
673 { std::u16string_view(u"blanchedalmond"), 0x00ffebcdUL },
674 { std::u16string_view(u"blue"), 0x000000ffUL },
675 { std::u16string_view(u"blueviolet"), 0x008a2be2UL },
676 { std::u16string_view(u"brown"), 0x00a52a2aUL },
677 { std::u16string_view(u"burlywood"), 0x00deb887UL },
678 { std::u16string_view(u"cadetblue"), 0x005f9ea0UL },
679 { std::u16string_view(u"chartreuse"), 0x007fff00UL },
680 { std::u16string_view(u"chocolate"), 0x00d2691eUL },
681 { std::u16string_view(u"coral"), 0x00ff7f50UL },
682 { std::u16string_view(u"cornflowerblue"), 0x006495edUL },
683 { std::u16string_view(u"cornsilk"), 0x00fff8dcUL },
684 { std::u16string_view(u"crimson"), 0x00dc143cUL },
685 { std::u16string_view(u"cyan"), 0x0000ffffUL },
686 { std::u16string_view(u"darkblue"), 0x0000008bUL },
687 { std::u16string_view(u"darkcyan"), 0x00008b8bUL },
688 { std::u16string_view(u"darkgoldenrod"), 0x00b8860bUL },
689 { std::u16string_view(u"darkgray"), 0x00a9a9a9UL },
690 { std::u16string_view(u"darkgreen"), 0x00006400UL },
691 { std::u16string_view(u"darkkhaki"), 0x00bdb76bUL },
692 { std::u16string_view(u"darkmagenta"), 0x008b008bUL },
693 { std::u16string_view(u"darkolivegreen"), 0x00556b2fUL },
694 { std::u16string_view(u"darkorange"), 0x00ff8c00UL },
695 { std::u16string_view(u"darkorchid"), 0x009932ccUL },
696 { std::u16string_view(u"darkred"), 0x008b0000UL },
697 { std::u16string_view(u"darksalmon"), 0x00e9967aUL },
698 { std::u16string_view(u"darkseagreen"), 0x008fbc8fUL },
699 { std::u16string_view(u"darkslateblue"), 0x00483d8bUL },
700 { std::u16string_view(u"darkslategray"), 0x002f4f4fUL },
701 { std::u16string_view(u"darkturquoise"), 0x0000ced1UL },
702 { std::u16string_view(u"darkviolet"), 0x009400d3UL },
703 { std::u16string_view(u"deeppink"), 0x00ff1493UL },
704 { std::u16string_view(u"deepskyblue"), 0x0000bfffUL },
705 { std::u16string_view(u"dimgray"), 0x00696969UL },
706 { std::u16string_view(u"dodgerblue"), 0x001e90ffUL },
707 { std::u16string_view(u"firebrick"), 0x00b22222UL },
708 { std::u16string_view(u"floralwhite"), 0x00fffaf0UL },
709 { std::u16string_view(u"forestgreen"), 0x00228b22UL },
710 { std::u16string_view(u"fuchsia"), 0x00ff00ffUL },
711 { std::u16string_view(u"gainsboro"), 0x00dcdcdcUL },
712 { std::u16string_view(u"ghostwhite"), 0x00f8f8ffUL },
713 { std::u16string_view(u"gold"), 0x00ffd700UL },
714 { std::u16string_view(u"goldenrod"), 0x00daa520UL },
715 { std::u16string_view(u"gray"), 0x00808080UL },
716 { std::u16string_view(u"green"), 0x00008000UL },
717 { std::u16string_view(u"greenyellow"), 0x00adff2fUL },
718 { std::u16string_view(u"honeydew"), 0x00f0fff0UL },
719 { std::u16string_view(u"hotpink"), 0x00ff69b4UL },
720 { std::u16string_view(u"indianred"), 0x00cd5c5cUL },
721 { std::u16string_view(u"indigo"), 0x004b0082UL },
722 { std::u16string_view(u"ivory"), 0x00fffff0UL },
723 { std::u16string_view(u"khaki"), 0x00f0e68cUL },
724 { std::u16string_view(u"lavender"), 0x00e6e6faUL },
725 { std::u16string_view(u"lavenderblush"), 0x00fff0f5UL },
726 { std::u16string_view(u"lawngreen"), 0x007cfc00UL },
727 { std::u16string_view(u"lemonchiffon"), 0x00fffacdUL },
728 { std::u16string_view(u"lightblue"), 0x00add8e6UL },
729 { std::u16string_view(u"lightcoral"), 0x00f08080UL },
730 { std::u16string_view(u"lightcyan"), 0x00e0ffffUL },
731 { std::u16string_view(u"lightgoldenrodyellow"), 0x00fafad2UL },
732 { std::u16string_view(u"lightgreen"), 0x0090ee90UL },
733 { std::u16string_view(u"lightgrey"), 0x00d3d3d3UL },
734 { std::u16string_view(u"lightpink"), 0x00ffb6c1UL },
735 { std::u16string_view(u"lightsalmon"), 0x00ffa07aUL },
736 { std::u16string_view(u"lightseagreen"), 0x0020b2aaUL },
737 { std::u16string_view(u"lightskyblue"), 0x0087cefaUL },
738 { std::u16string_view(u"lightslategray"), 0x00778899UL },
739 { std::u16string_view(u"lightsteelblue"), 0x00b0c4deUL },
740 { std::u16string_view(u"lightyellow"), 0x00ffffe0UL },
741 { std::u16string_view(u"lime"), 0x0000ff00UL },
742 { std::u16string_view(u"limegreen"), 0x0032cd32UL },
743 { std::u16string_view(u"linen"), 0x00faf0e6UL },
744 { std::u16string_view(u"magenta"), 0x00ff00ffUL },
745 { std::u16string_view(u"maroon"), 0x00800000UL },
746 { std::u16string_view(u"mediumaquamarine"), 0x0066cdaaUL },
747 { std::u16string_view(u"mediumblue"), 0x000000cdUL },
748 { std::u16string_view(u"mediumorchid"), 0x00ba55d3UL },
749 { std::u16string_view(u"mediumpurple"), 0x009370dbUL },
750 { std::u16string_view(u"mediumseagreen"), 0x003cb371UL },
751 { std::u16string_view(u"mediumslateblue"), 0x007b68eeUL },
752 { std::u16string_view(u"mediumspringgreen"), 0x0000fa9aUL },
753 { std::u16string_view(u"mediumturquoise"), 0x0048d1ccUL },
754 { std::u16string_view(u"mediumvioletred"), 0x00c71585UL },
755 { std::u16string_view(u"midnightblue"), 0x00191970UL },
756 { std::u16string_view(u"mintcream"), 0x00f5fffaUL },
757 { std::u16string_view(u"mistyrose"), 0x00ffe4e1UL },
758 { std::u16string_view(u"moccasin"), 0x00ffe4b5UL },
759 { std::u16string_view(u"navajowhite"), 0x00ffdeadUL },
760 { std::u16string_view(u"navy"), 0x00000080UL },
761 { std::u16string_view(u"oldlace"), 0x00fdf5e6UL },
762 { std::u16string_view(u"olive"), 0x00808000UL },
763 { std::u16string_view(u"olivedrab"), 0x006b8e23UL },
764 { std::u16string_view(u"orange"), 0x00ffa500UL },
765 { std::u16string_view(u"orangered"), 0x00ff4500UL },
766 { std::u16string_view(u"orchid"), 0x00da70d6UL },
767 { std::u16string_view(u"palegoldenrod"), 0x00eee8aaUL },
768 { std::u16string_view(u"palegreen"), 0x0098fb98UL },
769 { std::u16string_view(u"paleturquoise"), 0x00afeeeeUL },
770 { std::u16string_view(u"palevioletred"), 0x00db7093UL },
771 { std::u16string_view(u"papayawhip"), 0x00ffefd5UL },
772 { std::u16string_view(u"peachpuff"), 0x00ffdab9UL },
773 { std::u16string_view(u"peru"), 0x00cd853fUL },
774 { std::u16string_view(u"pink"), 0x00ffc0cbUL },
775 { std::u16string_view(u"plum"), 0x00dda0ddUL },
776 { std::u16string_view(u"powderblue"), 0x00b0e0e6UL },
777 { std::u16string_view(u"purple"), 0x00800080UL },
778 { std::u16string_view(u"red"), 0x00ff0000UL },
779 { std::u16string_view(u"rosybrown"), 0x00bc8f8fUL },
780 { std::u16string_view(u"royalblue"), 0x004169e1UL },
781 { std::u16string_view(u"saddlebrown"), 0x008b4513UL },
782 { std::u16string_view(u"salmon"), 0x00fa8072UL },
783 { std::u16string_view(u"sandybrown"), 0x00f4a460UL },
784 { std::u16string_view(u"seagreen"), 0x002e8b57UL },
785 { std::u16string_view(u"seashell"), 0x00fff5eeUL },
786 { std::u16string_view(u"sienna"), 0x00a0522dUL },
787 { std::u16string_view(u"silver"), 0x00c0c0c0UL },
788 { std::u16string_view(u"skyblue"), 0x0087ceebUL },
789 { std::u16string_view(u"slateblue"), 0x006a5acdUL },
790 { std::u16string_view(u"slategray"), 0x00708090UL },
791 { std::u16string_view(u"snow"), 0x00fffafaUL },
792 { std::u16string_view(u"springgreen"), 0x0000ff7fUL },
793 { std::u16string_view(u"steelblue"), 0x004682b4UL },
794 { std::u16string_view(u"tan"), 0x00d2b48cUL },
795 { std::u16string_view(u"teal"), 0x00008080UL },
796 { std::u16string_view(u"thistle"), 0x00d8bfd8UL },
797 { std::u16string_view(u"tomato"), 0x00ff6347UL },
798 { std::u16string_view(u"turquoise"), 0x0040e0d0UL },
799 { std::u16string_view(u"violet"), 0x00ee82eeUL },
800 { std::u16string_view(u"wheat"), 0x00f5deb3UL },
801 { std::u16string_view(u"white"), 0x00ffffffUL },
802 { std::u16string_view(u"whitesmoke"), 0x00f5f5f5UL },
803 { std::u16string_view(u"yellow"), 0x00ffff00UL },
804 { std::u16string_view(u"yellowgreen"), 0x009acd32UL }
807 sal_uInt32 GetHTMLColor( const OUString& rName )
809 if( !bSortColorKeyWords )
811 assert( std::is_sorted( std::begin(aHTMLColorNameTab), std::end(aHTMLColorNameTab),
812 sortCompare<sal_uInt32> ) );
813 bSortColorKeyWords = true;
816 OUString aLowerCase(rName.toAsciiLowerCase());
818 return search<sal_uInt32>( aHTMLColorNameTab, aLowerCase, SAL_MAX_UINT32);
821 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */