1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_svtools.hxx" 26 27 #include <ctype.h> 28 #include <stdlib.h> 29 #include <string.h> 30 #include <limits.h> 31 32 #include <svtools/svparser.hxx> 33 #include <svtools/htmlkywd.hxx> 34 #include <svtools/htmltokn.h> 35 36 // die Tabelle muss noch sortiert werden 37 struct HTML_TokenEntry 38 { 39 union 40 { 41 const sal_Char *sToken; 42 const String *pUToken; 43 }; 44 int nToken; 45 }; 46 47 // Flag: RTF-Token Tabelle wurde schon sortiert 48 static int __FAR_DATA bSortKeyWords = sal_False; 49 50 static HTML_TokenEntry __FAR_DATA aHTMLTokenTab[] = { 51 {{OOO_STRING_SVTOOLS_HTML_area}, HTML_AREA}, // Netscape 2.0 52 {{OOO_STRING_SVTOOLS_HTML_base}, HTML_BASE}, // HTML 3.0 53 {{OOO_STRING_SVTOOLS_HTML_comment}, HTML_COMMENT}, 54 {{OOO_STRING_SVTOOLS_HTML_doctype}, HTML_DOCTYPE}, 55 {{OOO_STRING_SVTOOLS_HTML_embed}, HTML_EMBED}, // Netscape 2.0 56 {{OOO_STRING_SVTOOLS_HTML_figureoverlay}, HTML_FIGUREOVERLAY}, // HTML 3.0 57 {{OOO_STRING_SVTOOLS_HTML_horzrule}, HTML_HORZRULE}, 58 {{OOO_STRING_SVTOOLS_HTML_horztab}, HTML_HORZTAB}, // HTML 3.0 59 {{OOO_STRING_SVTOOLS_HTML_image}, HTML_IMAGE}, 60 {{OOO_STRING_SVTOOLS_HTML_image2}, HTML_IMAGE}, 61 {{OOO_STRING_SVTOOLS_HTML_input}, HTML_INPUT}, 62 {{OOO_STRING_SVTOOLS_HTML_isindex}, HTML_ISINDEX}, // HTML 3.0 63 {{OOO_STRING_SVTOOLS_HTML_li}, HTML_LI_ON}, 64 {{OOO_STRING_SVTOOLS_HTML_linebreak}, HTML_LINEBREAK}, 65 {{OOO_STRING_SVTOOLS_HTML_link}, HTML_LINK}, // HTML 3.0 66 {{OOO_STRING_SVTOOLS_HTML_meta}, HTML_META}, // HTML 3.0 67 {{OOO_STRING_SVTOOLS_HTML_nextid}, HTML_NEXTID}, // HTML 3.0 68 {{OOO_STRING_SVTOOLS_HTML_of}, HTML_OF}, // HTML 3.0 69 {{OOO_STRING_SVTOOLS_HTML_option}, HTML_OPTION}, 70 {{OOO_STRING_SVTOOLS_HTML_param}, HTML_PARAM}, // HotJava 71 {{OOO_STRING_SVTOOLS_HTML_range}, HTML_RANGE}, // HTML 3.0 72 {{OOO_STRING_SVTOOLS_HTML_spacer}, HTML_SPACER}, // Netscape 3.0b5 73 {{OOO_STRING_SVTOOLS_HTML_wbr}, HTML_WBR}, // Netscape 74 75 {{OOO_STRING_SVTOOLS_HTML_abbreviation}, HTML_ABBREVIATION_ON}, // HTML 3.0 76 {{OOO_STRING_SVTOOLS_HTML_above}, HTML_ABOVE_ON}, // HTML 3.0 77 {{OOO_STRING_SVTOOLS_HTML_acronym}, HTML_ACRONYM_ON}, // HTML 3.0 78 {{OOO_STRING_SVTOOLS_HTML_address}, HTML_ADDRESS_ON}, 79 {{OOO_STRING_SVTOOLS_HTML_anchor}, HTML_ANCHOR_ON}, 80 {{OOO_STRING_SVTOOLS_HTML_applet}, HTML_APPLET_ON}, // HotJava 81 {{OOO_STRING_SVTOOLS_HTML_array}, HTML_ARRAY_ON}, // HTML 3.0 82 {{OOO_STRING_SVTOOLS_HTML_author}, HTML_AUTHOR_ON}, // HTML 3.0 83 {{OOO_STRING_SVTOOLS_HTML_banner}, HTML_BANNER_ON}, // HTML 3.0 84 {{OOO_STRING_SVTOOLS_HTML_bar}, HTML_BAR_ON}, // HTML 3.0 85 {{OOO_STRING_SVTOOLS_HTML_basefont}, HTML_BASEFONT_ON}, // Netscape 86 {{OOO_STRING_SVTOOLS_HTML_below}, HTML_BELOW_ON}, // HTML 3.0 87 {{OOO_STRING_SVTOOLS_HTML_bigprint}, HTML_BIGPRINT_ON}, // HTML 3.0 88 {{OOO_STRING_SVTOOLS_HTML_blink}, HTML_BLINK_ON}, // Netscape 89 {{OOO_STRING_SVTOOLS_HTML_blockquote}, HTML_BLOCKQUOTE_ON}, 90 {{OOO_STRING_SVTOOLS_HTML_blockquote30}, HTML_BLOCKQUOTE30_ON}, // HTML 3.0 91 {{OOO_STRING_SVTOOLS_HTML_body}, HTML_BODY_ON}, 92 {{OOO_STRING_SVTOOLS_HTML_bold}, HTML_BOLD_ON}, 93 {{OOO_STRING_SVTOOLS_HTML_boldtext}, HTML_BOLDTEXT_ON}, // HTML 3.0 94 {{OOO_STRING_SVTOOLS_HTML_box}, HTML_BOX_ON}, // HTML 3.0 95 {{OOO_STRING_SVTOOLS_HTML_caption}, HTML_CAPTION_ON}, // HTML 3.0 96 {{OOO_STRING_SVTOOLS_HTML_center}, HTML_CENTER_ON}, // Netscape 97 {{OOO_STRING_SVTOOLS_HTML_citiation}, HTML_CITIATION_ON}, 98 {{OOO_STRING_SVTOOLS_HTML_col}, HTML_COL_ON}, // HTML 3 Table Model Draft 99 {{OOO_STRING_SVTOOLS_HTML_colgroup}, HTML_COLGROUP_ON}, // HTML 3 Table Model Draft 100 {{OOO_STRING_SVTOOLS_HTML_code}, HTML_CODE_ON}, 101 {{OOO_STRING_SVTOOLS_HTML_credit}, HTML_CREDIT_ON}, // HTML 3.0 102 {{OOO_STRING_SVTOOLS_HTML_dd}, HTML_DD_ON}, 103 {{OOO_STRING_SVTOOLS_HTML_deflist}, HTML_DEFLIST_ON}, 104 {{OOO_STRING_SVTOOLS_HTML_deletedtext}, HTML_DELETEDTEXT_ON}, // HTML 3.0 105 {{OOO_STRING_SVTOOLS_HTML_dirlist}, HTML_DIRLIST_ON}, 106 {{OOO_STRING_SVTOOLS_HTML_division}, HTML_DIVISION_ON}, // HTML 3.0 107 {{OOO_STRING_SVTOOLS_HTML_dot}, HTML_DOT_ON}, // HTML 3.0 108 {{OOO_STRING_SVTOOLS_HTML_doubledot}, HTML_DOUBLEDOT_ON}, // HTML 3.0 109 {{OOO_STRING_SVTOOLS_HTML_dt}, HTML_DT_ON}, 110 {{OOO_STRING_SVTOOLS_HTML_emphasis}, HTML_EMPHASIS_ON}, 111 {{OOO_STRING_SVTOOLS_HTML_figure}, HTML_FIGURE_ON}, // HTML 3.0 112 {{OOO_STRING_SVTOOLS_HTML_font}, HTML_FONT_ON}, // Netscpe 113 {{OOO_STRING_SVTOOLS_HTML_footnote}, HTML_FOOTNOTE_ON}, // HTML 3.0 114 {{OOO_STRING_SVTOOLS_HTML_form}, HTML_FORM_ON}, 115 {{OOO_STRING_SVTOOLS_HTML_frame}, HTML_FRAME_ON}, // Netscape 2.0 116 {{OOO_STRING_SVTOOLS_HTML_frameset}, HTML_FRAMESET_ON}, // Netscape 2.0 117 {{OOO_STRING_SVTOOLS_HTML_hat}, HTML_HAT_ON}, // HTML 3.0 118 {{OOO_STRING_SVTOOLS_HTML_head}, HTML_HEAD_ON}, 119 {{OOO_STRING_SVTOOLS_HTML_head1}, HTML_HEAD1_ON}, 120 {{OOO_STRING_SVTOOLS_HTML_head2}, HTML_HEAD2_ON}, 121 {{OOO_STRING_SVTOOLS_HTML_head3}, HTML_HEAD3_ON}, 122 {{OOO_STRING_SVTOOLS_HTML_head4}, HTML_HEAD4_ON}, 123 {{OOO_STRING_SVTOOLS_HTML_head5}, HTML_HEAD5_ON}, 124 {{OOO_STRING_SVTOOLS_HTML_head6}, HTML_HEAD6_ON}, 125 {{OOO_STRING_SVTOOLS_HTML_html}, HTML_HTML_ON}, 126 {{OOO_STRING_SVTOOLS_HTML_iframe}, HTML_IFRAME_ON}, // IE 3.0b2 127 {{OOO_STRING_SVTOOLS_HTML_ilayer}, HTML_ILAYER_ON}, 128 {{OOO_STRING_SVTOOLS_HTML_insertedtext}, HTML_INSERTEDTEXT_ON}, // HTML 3.0 129 {{OOO_STRING_SVTOOLS_HTML_italic}, HTML_ITALIC_ON}, 130 {{OOO_STRING_SVTOOLS_HTML_item}, HTML_ITEM_ON}, // HTML 3.0 131 {{OOO_STRING_SVTOOLS_HTML_keyboard}, HTML_KEYBOARD_ON}, 132 {{OOO_STRING_SVTOOLS_HTML_language}, HTML_LANGUAGE_ON}, // HTML 3.0 133 {{OOO_STRING_SVTOOLS_HTML_layer}, HTML_LAYER_ON}, 134 {{OOO_STRING_SVTOOLS_HTML_listheader}, HTML_LISTHEADER_ON}, // HTML 3.0 135 {{OOO_STRING_SVTOOLS_HTML_map}, HTML_MAP_ON}, // Netscape 2.0 136 {{OOO_STRING_SVTOOLS_HTML_math}, HTML_MATH_ON}, // HTML 3.0 137 {{OOO_STRING_SVTOOLS_HTML_menulist}, HTML_MENULIST_ON}, 138 {{OOO_STRING_SVTOOLS_HTML_multicol}, HTML_MULTICOL_ON}, // Netscape 3.0b5 139 {{OOO_STRING_SVTOOLS_HTML_nobr}, HTML_NOBR_ON}, // Netscape 140 {{OOO_STRING_SVTOOLS_HTML_noembed}, HTML_NOEMBED_ON}, // Netscape 2.0 ??? 141 {{OOO_STRING_SVTOOLS_HTML_noframe}, HTML_NOFRAMES_ON}, // Netscape 2.0 ??? 142 {{OOO_STRING_SVTOOLS_HTML_noframes}, HTML_NOFRAMES_ON}, // Netscape 2.0 143 {{OOO_STRING_SVTOOLS_HTML_noscript}, HTML_NOSCRIPT_ON}, // Netscape 3.0 144 {{OOO_STRING_SVTOOLS_HTML_note}, HTML_NOTE_ON}, // HTML 3.0 145 {{OOO_STRING_SVTOOLS_HTML_object}, HTML_OBJECT_ON}, 146 {{OOO_STRING_SVTOOLS_HTML_orderlist}, HTML_ORDERLIST_ON}, 147 {{OOO_STRING_SVTOOLS_HTML_parabreak}, HTML_PARABREAK_ON}, 148 {{OOO_STRING_SVTOOLS_HTML_person}, HTML_PERSON_ON}, // HTML 3.0 149 {{OOO_STRING_SVTOOLS_HTML_plaintext}, HTML_PLAINTEXT_ON}, // HTML 3.0 150 {{OOO_STRING_SVTOOLS_HTML_preformtxt}, HTML_PREFORMTXT_ON}, 151 {{OOO_STRING_SVTOOLS_HTML_root}, HTML_ROOT_ON}, // HTML 3.0 152 {{OOO_STRING_SVTOOLS_HTML_row}, HTML_ROW_ON}, // HTML 3.0 153 {{OOO_STRING_SVTOOLS_HTML_sample}, HTML_SAMPLE_ON}, 154 {{OOO_STRING_SVTOOLS_HTML_script}, HTML_SCRIPT_ON}, // HTML 3.2 155 {{OOO_STRING_SVTOOLS_HTML_select}, HTML_SELECT_ON}, 156 {{OOO_STRING_SVTOOLS_HTML_shortquote}, HTML_SHORTQUOTE_ON}, // HTML 3.0 157 {{OOO_STRING_SVTOOLS_HTML_smallprint}, HTML_SMALLPRINT_ON}, // HTML 3.0 158 {{OOO_STRING_SVTOOLS_HTML_span}, HTML_SPAN_ON}, // Style Sheets 159 {{OOO_STRING_SVTOOLS_HTML_squareroot}, HTML_SQUAREROOT_ON}, // HTML 3.0 160 {{OOO_STRING_SVTOOLS_HTML_strikethrough},HTML_STRIKETHROUGH_ON}, // HTML 3.0 161 {{OOO_STRING_SVTOOLS_HTML_strong}, HTML_STRONG_ON}, 162 {{OOO_STRING_SVTOOLS_HTML_style}, HTML_STYLE_ON}, // HTML 3.0 163 {{OOO_STRING_SVTOOLS_HTML_subscript}, HTML_SUBSCRIPT_ON}, // HTML 3.0 164 {{OOO_STRING_SVTOOLS_HTML_superscript}, HTML_SUPERSCRIPT_ON}, // HTML 3.0 165 {{OOO_STRING_SVTOOLS_HTML_table}, HTML_TABLE_ON}, // HTML 3.0 166 {{OOO_STRING_SVTOOLS_HTML_tabledata}, HTML_TABLEDATA_ON}, // HTML 3.0 167 {{OOO_STRING_SVTOOLS_HTML_tableheader}, HTML_TABLEHEADER_ON}, // HTML 3.0 168 {{OOO_STRING_SVTOOLS_HTML_tablerow}, HTML_TABLEROW_ON}, // HTML 3.0 169 {{OOO_STRING_SVTOOLS_HTML_tbody}, HTML_TBODY_ON}, // HTML 3 Table Model Draft 170 {{OOO_STRING_SVTOOLS_HTML_teletype}, HTML_TELETYPE_ON}, 171 {{OOO_STRING_SVTOOLS_HTML_text}, HTML_TEXT_ON}, // HTML 3.0 172 {{OOO_STRING_SVTOOLS_HTML_textarea}, HTML_TEXTAREA_ON}, 173 {{OOO_STRING_SVTOOLS_HTML_textflow}, HTML_TEXTFLOW_ON}, 174 {{OOO_STRING_SVTOOLS_HTML_tfoot}, HTML_TFOOT_ON}, // HTML 3 Table Model Draft 175 {{OOO_STRING_SVTOOLS_HTML_thead}, HTML_THEAD_ON}, // HTML 3 Table Model Draft 176 {{OOO_STRING_SVTOOLS_HTML_tilde}, HTML_TILDE_ON}, // HTML 3.0 177 {{OOO_STRING_SVTOOLS_HTML_title}, HTML_TITLE_ON}, 178 {{OOO_STRING_SVTOOLS_HTML_underline}, HTML_UNDERLINE_ON}, 179 {{OOO_STRING_SVTOOLS_HTML_unorderlist}, HTML_UNORDERLIST_ON}, 180 {{OOO_STRING_SVTOOLS_HTML_variable}, HTML_VARIABLE_ON}, 181 {{OOO_STRING_SVTOOLS_HTML_vector}, HTML_VECTOR_ON}, // HTML 3.0 182 183 {{OOO_STRING_SVTOOLS_HTML_xmp}, HTML_XMP_ON}, 184 {{OOO_STRING_SVTOOLS_HTML_listing}, HTML_LISTING_ON}, 185 186 {{OOO_STRING_SVTOOLS_HTML_definstance}, HTML_DEFINSTANCE_ON}, 187 {{OOO_STRING_SVTOOLS_HTML_strike}, HTML_STRIKE_ON}, 188 189 {{OOO_STRING_SVTOOLS_HTML_bgsound}, HTML_BGSOUND}, 190 {{OOO_STRING_SVTOOLS_HTML_comment2}, HTML_COMMENT2_ON}, 191 {{OOO_STRING_SVTOOLS_HTML_marquee}, HTML_MARQUEE_ON}, 192 {{OOO_STRING_SVTOOLS_HTML_plaintext2}, HTML_PLAINTEXT2_ON}, 193 194 {{OOO_STRING_SVTOOLS_HTML_sdfield}, HTML_SDFIELD_ON} 195 }; 196 197 198 extern "C" 199 { 200 201 static int 202 #if defined( WNT ) 203 __cdecl 204 #endif 205 #if defined( ICC ) && defined( OS2 ) 206 _Optlink 207 #endif 208 HTMLKeyCompare( const void *pFirst, const void *pSecond) 209 { 210 int nRet = 0; 211 if( -1 == ((HTML_TokenEntry*)pFirst)->nToken ) 212 { 213 if( -1 == ((HTML_TokenEntry*)pSecond)->nToken ) 214 nRet = ((HTML_TokenEntry*)pFirst)->pUToken->CompareTo( 215 *((HTML_TokenEntry*)pSecond)->pUToken ); 216 else 217 nRet = ((HTML_TokenEntry*)pFirst)->pUToken->CompareToAscii( 218 ((HTML_TokenEntry*)pSecond)->sToken ); 219 } 220 else 221 { 222 if( -1 == ((HTML_TokenEntry*)pSecond)->nToken ) 223 nRet = -1 * ((HTML_TokenEntry*)pSecond)->pUToken->CompareToAscii( 224 ((HTML_TokenEntry*)pFirst)->sToken ); 225 else 226 nRet = strcmp( ((HTML_TokenEntry*)pFirst)->sToken, 227 ((HTML_TokenEntry*)pSecond)->sToken ); 228 } 229 230 return nRet; 231 } 232 233 } 234 235 int GetHTMLToken( const String& rName ) 236 { 237 if( !bSortKeyWords ) 238 { 239 qsort( (void*) aHTMLTokenTab, 240 sizeof( aHTMLTokenTab ) / sizeof( HTML_TokenEntry ), 241 sizeof( HTML_TokenEntry ), 242 HTMLKeyCompare ); 243 bSortKeyWords = sal_True; 244 } 245 246 int nRet = 0; 247 248 if( !rName.CompareToAscii( OOO_STRING_SVTOOLS_HTML_comment, 3UL) ) 249 return HTML_COMMENT; 250 251 void* pFound; 252 HTML_TokenEntry aSrch; 253 aSrch.pUToken = &rName; 254 aSrch.nToken = -1; 255 256 if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch, 257 (void*) aHTMLTokenTab, 258 sizeof( aHTMLTokenTab ) / sizeof( HTML_TokenEntry ), 259 sizeof( HTML_TokenEntry ), 260 HTMLKeyCompare ))) 261 nRet = ((HTML_TokenEntry*)pFound)->nToken; 262 return nRet; 263 } 264 265 /**/ 266 267 struct HTML_CharEntry 268 { 269 union 270 { 271 const sal_Char *sName; 272 const String *pUName; 273 }; 274 sal_Unicode cChar; 275 }; 276 277 // Flag: RTF-Token Tabelle wurde schon sortiert 278 static int __FAR_DATA bSortCharKeyWords = sal_False; 279 280 static HTML_CharEntry __FAR_DATA aHTMLCharNameTab[] = { 281 {{OOO_STRING_SVTOOLS_HTML_C_lt}, 60}, 282 {{OOO_STRING_SVTOOLS_HTML_C_gt}, 62}, 283 {{OOO_STRING_SVTOOLS_HTML_C_amp}, 38}, 284 {{OOO_STRING_SVTOOLS_HTML_C_quot}, 34}, 285 286 {{OOO_STRING_SVTOOLS_HTML_C_Agrave}, 192}, 287 {{OOO_STRING_SVTOOLS_HTML_C_Aacute}, 193}, 288 {{OOO_STRING_SVTOOLS_HTML_C_Acirc}, 194}, 289 {{OOO_STRING_SVTOOLS_HTML_C_Atilde}, 195}, 290 {{OOO_STRING_SVTOOLS_HTML_C_Auml}, 196}, 291 {{OOO_STRING_SVTOOLS_HTML_C_Aring}, 197}, 292 {{OOO_STRING_SVTOOLS_HTML_C_AElig}, 198}, 293 {{OOO_STRING_SVTOOLS_HTML_C_Ccedil}, 199}, 294 {{OOO_STRING_SVTOOLS_HTML_C_Egrave}, 200}, 295 {{OOO_STRING_SVTOOLS_HTML_C_Eacute}, 201}, 296 {{OOO_STRING_SVTOOLS_HTML_C_Ecirc}, 202}, 297 {{OOO_STRING_SVTOOLS_HTML_C_Euml}, 203}, 298 {{OOO_STRING_SVTOOLS_HTML_C_Igrave}, 204}, 299 {{OOO_STRING_SVTOOLS_HTML_C_Iacute}, 205}, 300 {{OOO_STRING_SVTOOLS_HTML_C_Icirc}, 206}, 301 {{OOO_STRING_SVTOOLS_HTML_C_Iuml}, 207}, 302 {{OOO_STRING_SVTOOLS_HTML_C_ETH}, 208}, 303 {{OOO_STRING_SVTOOLS_HTML_C_Ntilde}, 209}, 304 {{OOO_STRING_SVTOOLS_HTML_C_Ograve}, 210}, 305 {{OOO_STRING_SVTOOLS_HTML_C_Oacute}, 211}, 306 {{OOO_STRING_SVTOOLS_HTML_C_Ocirc}, 212}, 307 {{OOO_STRING_SVTOOLS_HTML_C_Otilde}, 213}, 308 {{OOO_STRING_SVTOOLS_HTML_C_Ouml}, 214}, 309 {{OOO_STRING_SVTOOLS_HTML_C_Oslash}, 216}, 310 {{OOO_STRING_SVTOOLS_HTML_C_Ugrave}, 217}, 311 {{OOO_STRING_SVTOOLS_HTML_C_Uacute}, 218}, 312 {{OOO_STRING_SVTOOLS_HTML_C_Ucirc}, 219}, 313 {{OOO_STRING_SVTOOLS_HTML_C_Uuml}, 220}, 314 {{OOO_STRING_SVTOOLS_HTML_C_Yacute}, 221}, 315 316 {{OOO_STRING_SVTOOLS_HTML_C_THORN}, 222}, 317 {{OOO_STRING_SVTOOLS_HTML_C_szlig}, 223}, 318 319 {{OOO_STRING_SVTOOLS_HTML_S_agrave}, 224}, 320 {{OOO_STRING_SVTOOLS_HTML_S_aacute}, 225}, 321 {{OOO_STRING_SVTOOLS_HTML_S_acirc}, 226}, 322 {{OOO_STRING_SVTOOLS_HTML_S_atilde}, 227}, 323 {{OOO_STRING_SVTOOLS_HTML_S_auml}, 228}, 324 {{OOO_STRING_SVTOOLS_HTML_S_aring}, 229}, 325 {{OOO_STRING_SVTOOLS_HTML_S_aelig}, 230}, 326 {{OOO_STRING_SVTOOLS_HTML_S_ccedil}, 231}, 327 {{OOO_STRING_SVTOOLS_HTML_S_egrave}, 232}, 328 {{OOO_STRING_SVTOOLS_HTML_S_eacute}, 233}, 329 {{OOO_STRING_SVTOOLS_HTML_S_ecirc}, 234}, 330 {{OOO_STRING_SVTOOLS_HTML_S_euml}, 235}, 331 {{OOO_STRING_SVTOOLS_HTML_S_igrave}, 236}, 332 {{OOO_STRING_SVTOOLS_HTML_S_iacute}, 237}, 333 {{OOO_STRING_SVTOOLS_HTML_S_icirc}, 238}, 334 {{OOO_STRING_SVTOOLS_HTML_S_iuml}, 239}, 335 {{OOO_STRING_SVTOOLS_HTML_S_eth}, 240}, 336 {{OOO_STRING_SVTOOLS_HTML_S_ntilde}, 241}, 337 {{OOO_STRING_SVTOOLS_HTML_S_ograve}, 242}, 338 {{OOO_STRING_SVTOOLS_HTML_S_oacute}, 243}, 339 {{OOO_STRING_SVTOOLS_HTML_S_ocirc}, 244}, 340 {{OOO_STRING_SVTOOLS_HTML_S_otilde}, 245}, 341 {{OOO_STRING_SVTOOLS_HTML_S_ouml}, 246}, 342 {{OOO_STRING_SVTOOLS_HTML_S_oslash}, 248}, 343 {{OOO_STRING_SVTOOLS_HTML_S_ugrave}, 249}, 344 {{OOO_STRING_SVTOOLS_HTML_S_uacute}, 250}, 345 {{OOO_STRING_SVTOOLS_HTML_S_ucirc}, 251}, 346 {{OOO_STRING_SVTOOLS_HTML_S_uuml}, 252}, 347 {{OOO_STRING_SVTOOLS_HTML_S_yacute}, 253}, 348 {{OOO_STRING_SVTOOLS_HTML_S_thorn}, 254}, 349 {{OOO_STRING_SVTOOLS_HTML_S_yuml}, 255}, 350 351 // Sonderzeichen 352 {{OOO_STRING_SVTOOLS_HTML_S_acute}, 180}, 353 {{OOO_STRING_SVTOOLS_HTML_S_brvbar}, 166}, 354 {{OOO_STRING_SVTOOLS_HTML_S_cedil}, 184}, 355 {{OOO_STRING_SVTOOLS_HTML_S_cent}, 162}, 356 {{OOO_STRING_SVTOOLS_HTML_S_copy}, 169}, 357 {{OOO_STRING_SVTOOLS_HTML_S_curren}, 164}, 358 {{OOO_STRING_SVTOOLS_HTML_S_deg}, 176}, 359 {{OOO_STRING_SVTOOLS_HTML_S_divide}, 247}, 360 {{OOO_STRING_SVTOOLS_HTML_S_frac12}, 189}, 361 {{OOO_STRING_SVTOOLS_HTML_S_frac14}, 188}, 362 {{OOO_STRING_SVTOOLS_HTML_S_frac34}, 190}, 363 {{OOO_STRING_SVTOOLS_HTML_S_iexcl}, 161}, 364 {{OOO_STRING_SVTOOLS_HTML_S_iquest}, 191}, 365 {{OOO_STRING_SVTOOLS_HTML_S_laquo}, 171}, 366 {{OOO_STRING_SVTOOLS_HTML_S_macr}, 175}, 367 {{OOO_STRING_SVTOOLS_HTML_S_micro}, 181}, 368 {{OOO_STRING_SVTOOLS_HTML_S_middot}, 183}, 369 {{OOO_STRING_SVTOOLS_HTML_S_not}, 172}, 370 {{OOO_STRING_SVTOOLS_HTML_S_ordf}, 170}, 371 {{OOO_STRING_SVTOOLS_HTML_S_ordm}, 186}, 372 {{OOO_STRING_SVTOOLS_HTML_S_para}, 182}, 373 {{OOO_STRING_SVTOOLS_HTML_S_plusmn}, 177}, 374 {{OOO_STRING_SVTOOLS_HTML_S_pound}, 163}, 375 {{OOO_STRING_SVTOOLS_HTML_S_raquo}, 187}, 376 {{OOO_STRING_SVTOOLS_HTML_S_reg}, 174}, 377 {{OOO_STRING_SVTOOLS_HTML_S_sect}, 167}, 378 {{OOO_STRING_SVTOOLS_HTML_S_sup1}, 185}, 379 {{OOO_STRING_SVTOOLS_HTML_S_sup2}, 178}, 380 {{OOO_STRING_SVTOOLS_HTML_S_sup3}, 179}, 381 {{OOO_STRING_SVTOOLS_HTML_S_times}, 215}, 382 {{OOO_STRING_SVTOOLS_HTML_S_uml}, 168}, 383 {{OOO_STRING_SVTOOLS_HTML_S_yen}, 165}, 384 385 // Netscape kennt noch ein paar in Grossbuchstaben ... 386 {{OOO_STRING_SVTOOLS_HTML_C_LT}, 60}, 387 {{OOO_STRING_SVTOOLS_HTML_C_GT}, 62}, 388 {{OOO_STRING_SVTOOLS_HTML_C_AMP}, 38}, 389 {{OOO_STRING_SVTOOLS_HTML_C_QUOT}, 34}, 390 {{OOO_STRING_SVTOOLS_HTML_S_COPY}, 169}, 391 {{OOO_STRING_SVTOOLS_HTML_S_REG}, 174}, 392 393 // Sonderzeichen, die zu Tokens konvertiert werden !!! 394 {{OOO_STRING_SVTOOLS_HTML_S_nbsp}, 1}, 395 {{OOO_STRING_SVTOOLS_HTML_S_shy}, 2}, 396 397 398 // HTML4 399 {{OOO_STRING_SVTOOLS_HTML_S_OElig}, 338}, 400 {{OOO_STRING_SVTOOLS_HTML_S_oelig}, 339}, 401 {{OOO_STRING_SVTOOLS_HTML_S_Scaron}, 352}, 402 {{OOO_STRING_SVTOOLS_HTML_S_scaron}, 353}, 403 {{OOO_STRING_SVTOOLS_HTML_S_Yuml}, 376}, 404 {{OOO_STRING_SVTOOLS_HTML_S_fnof}, 402}, 405 {{OOO_STRING_SVTOOLS_HTML_S_circ}, 710}, 406 {{OOO_STRING_SVTOOLS_HTML_S_tilde}, 732}, 407 {{OOO_STRING_SVTOOLS_HTML_S_Alpha}, 913}, 408 {{OOO_STRING_SVTOOLS_HTML_S_Beta}, 914}, 409 {{OOO_STRING_SVTOOLS_HTML_S_Gamma}, 915}, 410 {{OOO_STRING_SVTOOLS_HTML_S_Delta}, 916}, 411 {{OOO_STRING_SVTOOLS_HTML_S_Epsilon}, 917}, 412 {{OOO_STRING_SVTOOLS_HTML_S_Zeta}, 918}, 413 {{OOO_STRING_SVTOOLS_HTML_S_Eta}, 919}, 414 {{OOO_STRING_SVTOOLS_HTML_S_Theta}, 920}, 415 {{OOO_STRING_SVTOOLS_HTML_S_Iota}, 921}, 416 {{OOO_STRING_SVTOOLS_HTML_S_Kappa}, 922}, 417 {{OOO_STRING_SVTOOLS_HTML_S_Lambda}, 923}, 418 {{OOO_STRING_SVTOOLS_HTML_S_Mu}, 924}, 419 {{OOO_STRING_SVTOOLS_HTML_S_Nu}, 925}, 420 {{OOO_STRING_SVTOOLS_HTML_S_Xi}, 926}, 421 {{OOO_STRING_SVTOOLS_HTML_S_Omicron}, 927}, 422 {{OOO_STRING_SVTOOLS_HTML_S_Pi}, 928}, 423 {{OOO_STRING_SVTOOLS_HTML_S_Rho}, 929}, 424 {{OOO_STRING_SVTOOLS_HTML_S_Sigma}, 931}, 425 {{OOO_STRING_SVTOOLS_HTML_S_Tau}, 932}, 426 {{OOO_STRING_SVTOOLS_HTML_S_Upsilon}, 933}, 427 {{OOO_STRING_SVTOOLS_HTML_S_Phi}, 934}, 428 {{OOO_STRING_SVTOOLS_HTML_S_Chi}, 935}, 429 {{OOO_STRING_SVTOOLS_HTML_S_Psi}, 936}, 430 {{OOO_STRING_SVTOOLS_HTML_S_Omega}, 937}, 431 {{OOO_STRING_SVTOOLS_HTML_S_alpha}, 945}, 432 {{OOO_STRING_SVTOOLS_HTML_S_beta}, 946}, 433 {{OOO_STRING_SVTOOLS_HTML_S_gamma}, 947}, 434 {{OOO_STRING_SVTOOLS_HTML_S_delta}, 948}, 435 {{OOO_STRING_SVTOOLS_HTML_S_epsilon}, 949}, 436 {{OOO_STRING_SVTOOLS_HTML_S_zeta}, 950}, 437 {{OOO_STRING_SVTOOLS_HTML_S_eta}, 951}, 438 {{OOO_STRING_SVTOOLS_HTML_S_theta}, 952}, 439 {{OOO_STRING_SVTOOLS_HTML_S_iota}, 953}, 440 {{OOO_STRING_SVTOOLS_HTML_S_kappa}, 954}, 441 {{OOO_STRING_SVTOOLS_HTML_S_lambda}, 955}, 442 {{OOO_STRING_SVTOOLS_HTML_S_mu}, 956}, 443 {{OOO_STRING_SVTOOLS_HTML_S_nu}, 957}, 444 {{OOO_STRING_SVTOOLS_HTML_S_xi}, 958}, 445 {{OOO_STRING_SVTOOLS_HTML_S_omicron}, 959}, 446 {{OOO_STRING_SVTOOLS_HTML_S_pi}, 960}, 447 {{OOO_STRING_SVTOOLS_HTML_S_rho}, 961}, 448 {{OOO_STRING_SVTOOLS_HTML_S_sigmaf}, 962}, 449 {{OOO_STRING_SVTOOLS_HTML_S_sigma}, 963}, 450 {{OOO_STRING_SVTOOLS_HTML_S_tau}, 964}, 451 {{OOO_STRING_SVTOOLS_HTML_S_upsilon}, 965}, 452 {{OOO_STRING_SVTOOLS_HTML_S_phi}, 966}, 453 {{OOO_STRING_SVTOOLS_HTML_S_chi}, 967}, 454 {{OOO_STRING_SVTOOLS_HTML_S_psi}, 968}, 455 {{OOO_STRING_SVTOOLS_HTML_S_omega}, 969}, 456 {{OOO_STRING_SVTOOLS_HTML_S_thetasym}, 977}, 457 {{OOO_STRING_SVTOOLS_HTML_S_upsih}, 978}, 458 {{OOO_STRING_SVTOOLS_HTML_S_piv}, 982}, 459 {{OOO_STRING_SVTOOLS_HTML_S_ensp}, 8194}, 460 {{OOO_STRING_SVTOOLS_HTML_S_emsp}, 8195}, 461 {{OOO_STRING_SVTOOLS_HTML_S_thinsp}, 8201}, 462 {{OOO_STRING_SVTOOLS_HTML_S_zwnj}, 8204}, 463 {{OOO_STRING_SVTOOLS_HTML_S_zwj}, 8205}, 464 {{OOO_STRING_SVTOOLS_HTML_S_lrm}, 8206}, 465 {{OOO_STRING_SVTOOLS_HTML_S_rlm}, 8207}, 466 {{OOO_STRING_SVTOOLS_HTML_S_ndash}, 8211}, 467 {{OOO_STRING_SVTOOLS_HTML_S_mdash}, 8212}, 468 {{OOO_STRING_SVTOOLS_HTML_S_lsquo}, 8216}, 469 {{OOO_STRING_SVTOOLS_HTML_S_rsquo}, 8217}, 470 {{OOO_STRING_SVTOOLS_HTML_S_sbquo}, 8218}, 471 {{OOO_STRING_SVTOOLS_HTML_S_ldquo}, 8220}, 472 {{OOO_STRING_SVTOOLS_HTML_S_rdquo}, 8221}, 473 {{OOO_STRING_SVTOOLS_HTML_S_bdquo}, 8222}, 474 {{OOO_STRING_SVTOOLS_HTML_S_dagger}, 8224}, 475 {{OOO_STRING_SVTOOLS_HTML_S_Dagger}, 8225}, 476 {{OOO_STRING_SVTOOLS_HTML_S_bull}, 8226}, 477 {{OOO_STRING_SVTOOLS_HTML_S_hellip}, 8230}, 478 {{OOO_STRING_SVTOOLS_HTML_S_permil}, 8240}, 479 {{OOO_STRING_SVTOOLS_HTML_S_prime}, 8242}, 480 {{OOO_STRING_SVTOOLS_HTML_S_Prime}, 8243}, 481 {{OOO_STRING_SVTOOLS_HTML_S_lsaquo}, 8249}, 482 {{OOO_STRING_SVTOOLS_HTML_S_rsaquo}, 8250}, 483 {{OOO_STRING_SVTOOLS_HTML_S_oline}, 8254}, 484 {{OOO_STRING_SVTOOLS_HTML_S_frasl}, 8260}, 485 {{OOO_STRING_SVTOOLS_HTML_S_euro}, 8364}, 486 {{OOO_STRING_SVTOOLS_HTML_S_image}, 8465}, 487 {{OOO_STRING_SVTOOLS_HTML_S_weierp}, 8472}, 488 {{OOO_STRING_SVTOOLS_HTML_S_real}, 8476}, 489 {{OOO_STRING_SVTOOLS_HTML_S_trade}, 8482}, 490 {{OOO_STRING_SVTOOLS_HTML_S_alefsym}, 8501}, 491 {{OOO_STRING_SVTOOLS_HTML_S_larr}, 8592}, 492 {{OOO_STRING_SVTOOLS_HTML_S_uarr}, 8593}, 493 {{OOO_STRING_SVTOOLS_HTML_S_rarr}, 8594}, 494 {{OOO_STRING_SVTOOLS_HTML_S_darr}, 8595}, 495 {{OOO_STRING_SVTOOLS_HTML_S_harr}, 8596}, 496 {{OOO_STRING_SVTOOLS_HTML_S_crarr}, 8629}, 497 {{OOO_STRING_SVTOOLS_HTML_S_lArr}, 8656}, 498 {{OOO_STRING_SVTOOLS_HTML_S_uArr}, 8657}, 499 {{OOO_STRING_SVTOOLS_HTML_S_rArr}, 8658}, 500 {{OOO_STRING_SVTOOLS_HTML_S_dArr}, 8659}, 501 {{OOO_STRING_SVTOOLS_HTML_S_hArr}, 8660}, 502 {{OOO_STRING_SVTOOLS_HTML_S_forall}, 8704}, 503 {{OOO_STRING_SVTOOLS_HTML_S_part}, 8706}, 504 {{OOO_STRING_SVTOOLS_HTML_S_exist}, 8707}, 505 {{OOO_STRING_SVTOOLS_HTML_S_empty}, 8709}, 506 {{OOO_STRING_SVTOOLS_HTML_S_nabla}, 8711}, 507 {{OOO_STRING_SVTOOLS_HTML_S_isin}, 8712}, 508 {{OOO_STRING_SVTOOLS_HTML_S_notin}, 8713}, 509 {{OOO_STRING_SVTOOLS_HTML_S_ni}, 8715}, 510 {{OOO_STRING_SVTOOLS_HTML_S_prod}, 8719}, 511 {{OOO_STRING_SVTOOLS_HTML_S_sum}, 8721}, 512 {{OOO_STRING_SVTOOLS_HTML_S_minus}, 8722}, 513 {{OOO_STRING_SVTOOLS_HTML_S_lowast}, 8727}, 514 {{OOO_STRING_SVTOOLS_HTML_S_radic}, 8730}, 515 {{OOO_STRING_SVTOOLS_HTML_S_prop}, 8733}, 516 {{OOO_STRING_SVTOOLS_HTML_S_infin}, 8734}, 517 {{OOO_STRING_SVTOOLS_HTML_S_ang}, 8736}, 518 {{OOO_STRING_SVTOOLS_HTML_S_and}, 8743}, 519 {{OOO_STRING_SVTOOLS_HTML_S_or}, 8744}, 520 {{OOO_STRING_SVTOOLS_HTML_S_cap}, 8745}, 521 {{OOO_STRING_SVTOOLS_HTML_S_cup}, 8746}, 522 {{OOO_STRING_SVTOOLS_HTML_S_int}, 8747}, 523 {{OOO_STRING_SVTOOLS_HTML_S_there4}, 8756}, 524 {{OOO_STRING_SVTOOLS_HTML_S_sim}, 8764}, 525 {{OOO_STRING_SVTOOLS_HTML_S_cong}, 8773}, 526 {{OOO_STRING_SVTOOLS_HTML_S_asymp}, 8776}, 527 {{OOO_STRING_SVTOOLS_HTML_S_ne}, 8800}, 528 {{OOO_STRING_SVTOOLS_HTML_S_equiv}, 8801}, 529 {{OOO_STRING_SVTOOLS_HTML_S_le}, 8804}, 530 {{OOO_STRING_SVTOOLS_HTML_S_ge}, 8805}, 531 {{OOO_STRING_SVTOOLS_HTML_S_sub}, 8834}, 532 {{OOO_STRING_SVTOOLS_HTML_S_sup}, 8835}, 533 {{OOO_STRING_SVTOOLS_HTML_S_nsub}, 8836}, 534 {{OOO_STRING_SVTOOLS_HTML_S_sube}, 8838}, 535 {{OOO_STRING_SVTOOLS_HTML_S_supe}, 8839}, 536 {{OOO_STRING_SVTOOLS_HTML_S_oplus}, 8853}, 537 {{OOO_STRING_SVTOOLS_HTML_S_otimes}, 8855}, 538 {{OOO_STRING_SVTOOLS_HTML_S_perp}, 8869}, 539 {{OOO_STRING_SVTOOLS_HTML_S_sdot}, 8901}, 540 {{OOO_STRING_SVTOOLS_HTML_S_lceil}, 8968}, 541 {{OOO_STRING_SVTOOLS_HTML_S_rceil}, 8969}, 542 {{OOO_STRING_SVTOOLS_HTML_S_lfloor}, 8970}, 543 {{OOO_STRING_SVTOOLS_HTML_S_rfloor}, 8971}, 544 {{OOO_STRING_SVTOOLS_HTML_S_lang}, 9001}, 545 {{OOO_STRING_SVTOOLS_HTML_S_rang}, 9002}, 546 {{OOO_STRING_SVTOOLS_HTML_S_loz}, 9674}, 547 {{OOO_STRING_SVTOOLS_HTML_S_spades}, 9824}, 548 {{OOO_STRING_SVTOOLS_HTML_S_clubs}, 9827}, 549 {{OOO_STRING_SVTOOLS_HTML_S_hearts}, 9829}, 550 {{OOO_STRING_SVTOOLS_HTML_S_diams}, 9830} 551 }; 552 553 extern "C" 554 { 555 556 static int 557 #if defined( WNT ) 558 __cdecl 559 #endif 560 #if defined( ICC ) && defined( OS2 ) 561 _Optlink 562 #endif 563 HTMLCharNameCompare( const void *pFirst, const void *pSecond) 564 { 565 int nRet = 0; 566 if( USHRT_MAX == ((HTML_CharEntry*)pFirst)->cChar ) 567 { 568 if( USHRT_MAX == ((HTML_CharEntry*)pSecond)->cChar ) 569 nRet = ((HTML_CharEntry*)pFirst)->pUName->CompareTo( 570 *((HTML_CharEntry*)pSecond)->pUName ); 571 else 572 nRet = ((HTML_CharEntry*)pFirst)->pUName->CompareToAscii( 573 ((HTML_CharEntry*)pSecond)->sName ); 574 } 575 else 576 { 577 if( USHRT_MAX == ((HTML_CharEntry*)pSecond)->cChar ) 578 nRet = -1 * ((HTML_CharEntry*)pSecond)->pUName->CompareToAscii( 579 ((HTML_CharEntry*)pFirst)->sName ); 580 else 581 nRet = strcmp( ((HTML_CharEntry*)pFirst)->sName, 582 ((HTML_CharEntry*)pSecond)->sName ); 583 } 584 585 return nRet; 586 } 587 588 } 589 590 sal_Unicode GetHTMLCharName( const String& rName ) 591 { 592 if( !bSortCharKeyWords ) 593 { 594 qsort( (void*) aHTMLCharNameTab, 595 sizeof( aHTMLCharNameTab ) / sizeof( HTML_CharEntry ), 596 sizeof( HTML_CharEntry ), 597 HTMLCharNameCompare ); 598 bSortCharKeyWords = sal_True; 599 } 600 601 sal_Unicode cRet = 0; 602 void* pFound; 603 HTML_CharEntry aSrch; 604 aSrch.pUName = &rName; 605 aSrch.cChar = USHRT_MAX; 606 607 if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch, 608 (void*) aHTMLCharNameTab, 609 sizeof( aHTMLCharNameTab) / sizeof( HTML_CharEntry ), 610 sizeof( HTML_CharEntry ), 611 HTMLCharNameCompare ))) 612 cRet = ((HTML_CharEntry*)pFound)->cChar; 613 return cRet; 614 } 615 616 /**/ 617 618 // Flag: Optionen-Tabelle wurde schon sortiert 619 static int __FAR_DATA bSortOptionKeyWords = sal_False; 620 621 static HTML_TokenEntry __FAR_DATA aHTMLOptionTab[] = { 622 623 // Attribute ohne Wert 624 {{OOO_STRING_SVTOOLS_HTML_O_box}, HTML_O_BOX}, 625 {{OOO_STRING_SVTOOLS_HTML_O_checked}, HTML_O_CHECKED}, 626 {{OOO_STRING_SVTOOLS_HTML_O_compact}, HTML_O_COMPACT}, 627 {{OOO_STRING_SVTOOLS_HTML_O_continue}, HTML_O_CONTINUE}, 628 {{OOO_STRING_SVTOOLS_HTML_O_controls}, HTML_O_CONTROLS}, // IExplorer 2.0 629 {{OOO_STRING_SVTOOLS_HTML_O_declare}, HTML_O_DECLARE}, 630 {{OOO_STRING_SVTOOLS_HTML_O_disabled}, HTML_O_DISABLED}, 631 {{OOO_STRING_SVTOOLS_HTML_O_folded}, HTML_O_FOLDED}, // Netscape internal 632 {{OOO_STRING_SVTOOLS_HTML_O_ismap}, HTML_O_ISMAP}, 633 {{OOO_STRING_SVTOOLS_HTML_O_mayscript}, HTML_O_MAYSCRIPT}, 634 {{OOO_STRING_SVTOOLS_HTML_O_multiple}, HTML_O_MULTIPLE}, 635 {{OOO_STRING_SVTOOLS_HTML_O_noflow}, HTML_O_NOFLOW}, 636 {{OOO_STRING_SVTOOLS_HTML_O_nohref}, HTML_O_NOHREF}, // Netscape 2.0 637 {{OOO_STRING_SVTOOLS_HTML_O_noresize}, HTML_O_NORESIZE}, // Netscape 2.0 638 {{OOO_STRING_SVTOOLS_HTML_O_noshade}, HTML_O_NOSHADE}, // Netscape 2.0 639 {{OOO_STRING_SVTOOLS_HTML_O_nowrap}, HTML_O_NOWRAP}, 640 {{OOO_STRING_SVTOOLS_HTML_O_plain}, HTML_O_PLAIN}, 641 {{OOO_STRING_SVTOOLS_HTML_O_sdfixed}, HTML_O_SDFIXED}, 642 {{OOO_STRING_SVTOOLS_HTML_O_selected}, HTML_O_SELECTED}, 643 {{OOO_STRING_SVTOOLS_HTML_O_shapes}, HTML_O_SHAPES}, 644 645 // Attribute mit einem String als Wert 646 {{OOO_STRING_SVTOOLS_HTML_O_above}, HTML_O_ABOVE}, 647 {{OOO_STRING_SVTOOLS_HTML_O_accept}, HTML_O_ACCEPT}, 648 {{OOO_STRING_SVTOOLS_HTML_O_accesskey}, HTML_O_ACCESSKEY}, 649 {{OOO_STRING_SVTOOLS_HTML_O_add_date}, HTML_O_ADD_DATE}, // Netscape internal 650 {{OOO_STRING_SVTOOLS_HTML_O_alt}, HTML_O_ALT}, 651 {{OOO_STRING_SVTOOLS_HTML_O_axes}, HTML_O_AXES}, 652 {{OOO_STRING_SVTOOLS_HTML_O_axis}, HTML_O_AXIS}, 653 {{OOO_STRING_SVTOOLS_HTML_O_below}, HTML_O_BELOW}, 654 {{OOO_STRING_SVTOOLS_HTML_O_char}, HTML_O_CHAR}, // HTML 3 Table Model Draft 655 {{OOO_STRING_SVTOOLS_HTML_O_class}, HTML_O_CLASS}, 656 {{OOO_STRING_SVTOOLS_HTML_O_clip}, HTML_O_CLIP}, 657 {{OOO_STRING_SVTOOLS_HTML_O_code}, HTML_O_CODE}, // HotJava 658 {{OOO_STRING_SVTOOLS_HTML_O_codetype}, HTML_O_CODETYPE}, 659 {{OOO_STRING_SVTOOLS_HTML_O_colspec}, HTML_O_COLSPEC}, 660 {{OOO_STRING_SVTOOLS_HTML_O_content}, HTML_O_CONTENT}, 661 {{OOO_STRING_SVTOOLS_HTML_O_coords}, HTML_O_COORDS}, // Netscape 2.0 662 {{OOO_STRING_SVTOOLS_HTML_O_dp}, HTML_O_DP}, 663 {{OOO_STRING_SVTOOLS_HTML_O_enctype}, HTML_O_ENCTYPE}, 664 {{OOO_STRING_SVTOOLS_HTML_O_error}, HTML_O_ERROR}, 665 {{OOO_STRING_SVTOOLS_HTML_O_face}, HTML_O_FACE}, // IExplorer 2.0 666 {{OOO_STRING_SVTOOLS_HTML_O_frameborder}, HTML_O_FRAMEBORDER}, // IExplorer 3.0 667 {{OOO_STRING_SVTOOLS_HTML_O_httpequiv}, HTML_O_HTTPEQUIV}, 668 {{OOO_STRING_SVTOOLS_HTML_O_language}, HTML_O_LANGUAGE}, // JavaScript 669 {{OOO_STRING_SVTOOLS_HTML_O_last_modified}, HTML_O_LAST_MODIFIED}, // Netscape internal 670 {{OOO_STRING_SVTOOLS_HTML_O_last_visit}, HTML_O_LAST_VISIT}, // Netscape internal 671 {{OOO_STRING_SVTOOLS_HTML_O_md}, HTML_O_MD}, 672 {{OOO_STRING_SVTOOLS_HTML_O_n}, HTML_O_N}, 673 {{OOO_STRING_SVTOOLS_HTML_O_name}, HTML_O_NAME}, 674 {{OOO_STRING_SVTOOLS_HTML_O_notation}, HTML_O_NOTATION}, 675 {{OOO_STRING_SVTOOLS_HTML_O_prompt}, HTML_O_PROMPT}, 676 {{OOO_STRING_SVTOOLS_HTML_O_shape}, HTML_O_SHAPE}, 677 {{OOO_STRING_SVTOOLS_HTML_O_standby}, HTML_O_STANDBY}, 678 {{OOO_STRING_SVTOOLS_HTML_O_style}, HTML_O_STYLE}, 679 {{OOO_STRING_SVTOOLS_HTML_O_title}, HTML_O_TITLE}, 680 {{OOO_STRING_SVTOOLS_HTML_O_value}, HTML_O_VALUE}, 681 {{OOO_STRING_SVTOOLS_HTML_O_SDval}, HTML_O_SDVAL}, // StarDiv NumberValue 682 {{OOO_STRING_SVTOOLS_HTML_O_SDnum}, HTML_O_SDNUM}, // StarDiv NumberFormat 683 {{OOO_STRING_SVTOOLS_HTML_O_sdlibrary}, HTML_O_SDLIBRARY}, 684 {{OOO_STRING_SVTOOLS_HTML_O_sdmodule}, HTML_O_SDMODULE}, 685 686 // Attribute mit einem SGML-Identifier als Wert 687 {{OOO_STRING_SVTOOLS_HTML_O_from}, HTML_O_FROM}, 688 {{OOO_STRING_SVTOOLS_HTML_O_id}, HTML_O_ID}, 689 {{OOO_STRING_SVTOOLS_HTML_O_target}, HTML_O_TARGET}, // Netscape 2.0 690 {{OOO_STRING_SVTOOLS_HTML_O_to}, HTML_O_TO}, 691 {{OOO_STRING_SVTOOLS_HTML_O_until}, HTML_O_UNTIL}, 692 693 // Attribute mit einem URI als Wert 694 {{OOO_STRING_SVTOOLS_HTML_O_action}, HTML_O_ACTION}, 695 {{OOO_STRING_SVTOOLS_HTML_O_archive}, HTML_O_ARCHIVE}, 696 {{OOO_STRING_SVTOOLS_HTML_O_background}, HTML_O_BACKGROUND}, 697 {{OOO_STRING_SVTOOLS_HTML_O_classid}, HTML_O_CLASSID}, 698 {{OOO_STRING_SVTOOLS_HTML_O_codebase}, HTML_O_CODEBASE}, // HotJava 699 {{OOO_STRING_SVTOOLS_HTML_O_data}, HTML_O_DATA}, 700 {{OOO_STRING_SVTOOLS_HTML_O_dynsrc}, HTML_O_DYNSRC}, // IExplorer 3.0b1 701 {{OOO_STRING_SVTOOLS_HTML_O_dynsync}, HTML_O_DYNSYNC}, // IExplorer 2.0 702 {{OOO_STRING_SVTOOLS_HTML_O_imagemap}, HTML_O_IMAGEMAP}, 703 {{OOO_STRING_SVTOOLS_HTML_O_href}, HTML_O_HREF}, 704 {{OOO_STRING_SVTOOLS_HTML_O_lowsrc}, HTML_O_LOWSRC}, // Netscape 3.0 705 {{OOO_STRING_SVTOOLS_HTML_O_script}, HTML_O_SCRIPT}, 706 {{OOO_STRING_SVTOOLS_HTML_O_src}, HTML_O_SRC}, 707 {{OOO_STRING_SVTOOLS_HTML_O_usemap}, HTML_O_USEMAP}, // Netscape 2.0 708 709 // Attribute mit Entity-Namen als Wert 710 {{OOO_STRING_SVTOOLS_HTML_O_dingbat}, HTML_O_DINGBAT}, 711 {{OOO_STRING_SVTOOLS_HTML_O_sym}, HTML_O_SYM}, 712 713 // Attribute mit einer Farbe als Wert (alle Netscape) 714 {{OOO_STRING_SVTOOLS_HTML_O_alink}, HTML_O_ALINK}, 715 {{OOO_STRING_SVTOOLS_HTML_O_bgcolor}, HTML_O_BGCOLOR}, 716 {{OOO_STRING_SVTOOLS_HTML_O_bordercolor}, HTML_O_BORDERCOLOR}, // IExplorer 2.0 717 {{OOO_STRING_SVTOOLS_HTML_O_bordercolorlight}, HTML_O_BORDERCOLORLIGHT}, // IExplorer 2.0 718 {{OOO_STRING_SVTOOLS_HTML_O_bordercolordark}, HTML_O_BORDERCOLORDARK}, // IExplorer 2.0 719 {{OOO_STRING_SVTOOLS_HTML_O_color}, HTML_O_COLOR}, 720 {{OOO_STRING_SVTOOLS_HTML_O_link}, HTML_O_LINK}, 721 {{OOO_STRING_SVTOOLS_HTML_O_text}, HTML_O_TEXT}, 722 {{OOO_STRING_SVTOOLS_HTML_O_vlink}, HTML_O_VLINK}, 723 724 // Attribute mit einem numerischen Wert 725 {{OOO_STRING_SVTOOLS_HTML_O_border}, HTML_O_BORDER}, 726 {{OOO_STRING_SVTOOLS_HTML_O_cellspacing},HTML_O_CELLSPACING}, // HTML 3 Table Model Draft 727 {{OOO_STRING_SVTOOLS_HTML_O_cellpadding},HTML_O_CELLPADDING}, // HTML 3 Table Model Draft 728 {{OOO_STRING_SVTOOLS_HTML_O_charoff}, HTML_O_CHAROFF}, // HTML 3 Table Model Draft 729 {{OOO_STRING_SVTOOLS_HTML_O_colspan}, HTML_O_COLSPAN}, 730 {{OOO_STRING_SVTOOLS_HTML_O_framespacing}, HTML_O_FRAMESPACING}, // IExplorer 3.0 731 {{OOO_STRING_SVTOOLS_HTML_O_gutter}, HTML_O_GUTTER}, // Netscape 3.0b5 732 {{OOO_STRING_SVTOOLS_HTML_O_indent}, HTML_O_INDENT}, 733 {{OOO_STRING_SVTOOLS_HTML_O_height}, HTML_O_HEIGHT}, 734 {{OOO_STRING_SVTOOLS_HTML_O_hspace}, HTML_O_HSPACE}, // Netscape 735 {{OOO_STRING_SVTOOLS_HTML_O_left}, HTML_O_LEFT}, 736 {{OOO_STRING_SVTOOLS_HTML_O_leftmargin}, HTML_O_LEFTMARGIN}, // IExplorer 2.0 737 {{OOO_STRING_SVTOOLS_HTML_O_loop}, HTML_O_LOOP}, // IExplorer 2.0 738 {{OOO_STRING_SVTOOLS_HTML_O_marginheight},HTML_O_MARGINHEIGHT}, // Netscape 2.0 739 {{OOO_STRING_SVTOOLS_HTML_O_marginwidth},HTML_O_MARGINWIDTH}, // Netscape 2.0 740 {{OOO_STRING_SVTOOLS_HTML_O_max}, HTML_O_MAX}, 741 {{OOO_STRING_SVTOOLS_HTML_O_maxlength}, HTML_O_MAXLENGTH}, 742 {{OOO_STRING_SVTOOLS_HTML_O_min}, HTML_O_MIN}, 743 {{OOO_STRING_SVTOOLS_HTML_O_pagex}, HTML_O_PAGEX}, 744 {{OOO_STRING_SVTOOLS_HTML_O_pagey}, HTML_O_PAGEY}, 745 {{OOO_STRING_SVTOOLS_HTML_O_pointsize}, HTML_O_POINTSIZE}, 746 {{OOO_STRING_SVTOOLS_HTML_O_rowspan}, HTML_O_ROWSPAN}, 747 {{OOO_STRING_SVTOOLS_HTML_O_scrollamount}, HTML_O_SCROLLAMOUNT}, // IExplorer 2.0 748 {{OOO_STRING_SVTOOLS_HTML_O_scrolldelay}, HTML_O_SCROLLDELAY}, // IExplorer 2.0 749 {{OOO_STRING_SVTOOLS_HTML_O_seqnum}, HTML_O_SEQNUM}, 750 {{OOO_STRING_SVTOOLS_HTML_O_skip}, HTML_O_SKIP}, 751 {{OOO_STRING_SVTOOLS_HTML_O_span}, HTML_O_SPAN}, // HTML 3 Table Model Draft 752 {{OOO_STRING_SVTOOLS_HTML_O_tabindex}, HTML_O_TABINDEX}, 753 {{OOO_STRING_SVTOOLS_HTML_O_top}, HTML_O_TOP}, 754 {{OOO_STRING_SVTOOLS_HTML_O_topmargin}, HTML_O_TOPMARGIN}, // IExplorer 2.0 755 {{OOO_STRING_SVTOOLS_HTML_O_vspace}, HTML_O_VSPACE}, // Netscape 756 {{OOO_STRING_SVTOOLS_HTML_O_weight}, HTML_O_WEIGHT}, 757 {{OOO_STRING_SVTOOLS_HTML_O_width}, HTML_O_WIDTH}, 758 {{OOO_STRING_SVTOOLS_HTML_O_x}, HTML_O_X}, 759 {{OOO_STRING_SVTOOLS_HTML_O_y}, HTML_O_Y}, 760 {{OOO_STRING_SVTOOLS_HTML_O_zindex}, HTML_O_ZINDEX}, 761 762 // Attribute mit Enum-Werten 763 {{OOO_STRING_SVTOOLS_HTML_O_bgproperties}, HTML_O_BGPROPERTIES}, // IExplorer 2.0 764 {{OOO_STRING_SVTOOLS_HTML_O_behavior}, HTML_O_BEHAVIOR}, // IExplorer 2.0 765 {{OOO_STRING_SVTOOLS_HTML_O_clear}, HTML_O_CLEAR}, 766 {{OOO_STRING_SVTOOLS_HTML_O_dir}, HTML_O_DIR}, // HTML 3 Table Model Draft 767 {{OOO_STRING_SVTOOLS_HTML_O_direction}, HTML_O_DIRECTION}, // IExplorer 2.0 768 {{OOO_STRING_SVTOOLS_HTML_O_format}, HTML_O_FORMAT}, 769 {{OOO_STRING_SVTOOLS_HTML_O_frame}, HTML_O_FRAME}, // HTML 3 Table Model Draft 770 {{OOO_STRING_SVTOOLS_HTML_O_lang}, HTML_O_LANG}, 771 {{OOO_STRING_SVTOOLS_HTML_O_method}, HTML_O_METHOD}, 772 {{OOO_STRING_SVTOOLS_HTML_O_palette}, HTML_O_PALETTE}, 773 {{OOO_STRING_SVTOOLS_HTML_O_rel}, HTML_O_REL}, 774 {{OOO_STRING_SVTOOLS_HTML_O_rev}, HTML_O_REV}, 775 {{OOO_STRING_SVTOOLS_HTML_O_rules}, HTML_O_RULES}, // HTML 3 Table Model Draft 776 {{OOO_STRING_SVTOOLS_HTML_O_scrolling}, HTML_O_SCROLLING}, // Netscape 2.0 777 {{OOO_STRING_SVTOOLS_HTML_O_sdreadonly}, HTML_O_SDREADONLY}, 778 {{OOO_STRING_SVTOOLS_HTML_O_subtype}, HTML_O_SUBTYPE}, 779 {{OOO_STRING_SVTOOLS_HTML_O_type}, HTML_O_TYPE}, 780 {{OOO_STRING_SVTOOLS_HTML_O_valign}, HTML_O_VALIGN}, 781 {{OOO_STRING_SVTOOLS_HTML_O_valuetype}, HTML_O_VALUETYPE}, 782 {{OOO_STRING_SVTOOLS_HTML_O_wrap}, HTML_O_WRAP}, 783 {{OOO_STRING_SVTOOLS_HTML_O_visibility}, HTML_O_VISIBILITY}, 784 785 // Attribute mit Script-Code als Wert 786 {{OOO_STRING_SVTOOLS_HTML_O_onblur}, HTML_O_ONBLUR}, // JavaScript 787 {{OOO_STRING_SVTOOLS_HTML_O_onchange}, HTML_O_ONCHANGE}, // JavaScript 788 {{OOO_STRING_SVTOOLS_HTML_O_onclick}, HTML_O_ONCLICK}, // JavaScript 789 {{OOO_STRING_SVTOOLS_HTML_O_onfocus}, HTML_O_ONFOCUS}, // JavaScript 790 {{OOO_STRING_SVTOOLS_HTML_O_onload}, HTML_O_ONLOAD}, // JavaScript 791 {{OOO_STRING_SVTOOLS_HTML_O_onmouseover}, HTML_O_ONMOUSEOVER}, // JavaScript 792 {{OOO_STRING_SVTOOLS_HTML_O_onreset}, HTML_O_ONRESET}, // JavaScript 793 {{OOO_STRING_SVTOOLS_HTML_O_onselect}, HTML_O_ONSELECT}, // JavaScript 794 {{OOO_STRING_SVTOOLS_HTML_O_onsubmit}, HTML_O_ONSUBMIT}, // JavaScript 795 {{OOO_STRING_SVTOOLS_HTML_O_onunload}, HTML_O_ONUNLOAD}, // JavaScript 796 {{OOO_STRING_SVTOOLS_HTML_O_onabort}, HTML_O_ONABORT}, // JavaScript 797 {{OOO_STRING_SVTOOLS_HTML_O_onerror}, HTML_O_ONERROR}, // JavaScript 798 {{OOO_STRING_SVTOOLS_HTML_O_onmouseout}, HTML_O_ONMOUSEOUT}, // JavaScript 799 800 {{OOO_STRING_SVTOOLS_HTML_O_SDonblur}, HTML_O_SDONBLUR}, // StarBasic 801 {{OOO_STRING_SVTOOLS_HTML_O_SDonchange}, HTML_O_SDONCHANGE}, // StarBasic 802 {{OOO_STRING_SVTOOLS_HTML_O_SDonclick}, HTML_O_SDONCLICK}, // StarBasic 803 {{OOO_STRING_SVTOOLS_HTML_O_SDonfocus}, HTML_O_SDONFOCUS}, // StarBasic 804 {{OOO_STRING_SVTOOLS_HTML_O_SDonload}, HTML_O_SDONLOAD}, // StarBasic 805 {{OOO_STRING_SVTOOLS_HTML_O_SDonmouseover}, HTML_O_SDONMOUSEOVER}, // StarBasic 806 {{OOO_STRING_SVTOOLS_HTML_O_SDonreset}, HTML_O_SDONRESET}, // StarBasic 807 {{OOO_STRING_SVTOOLS_HTML_O_SDonselect}, HTML_O_SDONSELECT}, // StarBasic 808 {{OOO_STRING_SVTOOLS_HTML_O_SDonsubmit}, HTML_O_SDONSUBMIT}, // StarBasic 809 {{OOO_STRING_SVTOOLS_HTML_O_SDonunload}, HTML_O_SDONUNLOAD}, // StarBasic 810 {{OOO_STRING_SVTOOLS_HTML_O_SDonabort}, HTML_O_SDONABORT}, // StarBasic 811 {{OOO_STRING_SVTOOLS_HTML_O_SDonerror}, HTML_O_SDONERROR}, // StarBasic 812 {{OOO_STRING_SVTOOLS_HTML_O_SDonmouseout}, HTML_O_SDONMOUSEOUT}, // StarBasic 813 814 // Attribute mit Kontext-abhaengigen Werten 815 {{OOO_STRING_SVTOOLS_HTML_O_align}, HTML_O_ALIGN}, 816 {{OOO_STRING_SVTOOLS_HTML_O_cols}, HTML_O_COLS}, // Netscape 2.0 vs HTML 2.0 817 {{OOO_STRING_SVTOOLS_HTML_O_rows}, HTML_O_ROWS}, // Netscape 2.0 vs HTML 2.0 818 {{OOO_STRING_SVTOOLS_HTML_O_size}, HTML_O_SIZE}, 819 {{OOO_STRING_SVTOOLS_HTML_O_start}, HTML_O_START}, // Netscape 2.0 vs IExplorer 2.0 820 {{OOO_STRING_SVTOOLS_HTML_O_units}, HTML_O_UNITS} 821 }; 822 823 int GetHTMLOption( const String& rName ) 824 { 825 if( !bSortOptionKeyWords ) 826 { 827 qsort( (void*) aHTMLOptionTab, 828 sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ), 829 sizeof( HTML_TokenEntry ), 830 HTMLKeyCompare ); 831 bSortOptionKeyWords = sal_True; 832 } 833 834 int nRet = HTML_O_UNKNOWN; 835 void* pFound; 836 HTML_TokenEntry aSrch; 837 aSrch.pUToken = &rName; 838 aSrch.nToken = -1; 839 840 if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch, 841 (void*) aHTMLOptionTab, 842 sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ), 843 sizeof( HTML_TokenEntry ), 844 HTMLKeyCompare ))) 845 nRet = ((HTML_TokenEntry*)pFound)->nToken; 846 return nRet; 847 } 848 849 /**/ 850 851 // Flag: Farb-Tabelle wurde schon sortiert 852 struct HTML_ColorEntry 853 { 854 union 855 { 856 const sal_Char* sName; 857 const String *pUName; 858 }; 859 sal_uLong nColor; 860 }; 861 862 static int __FAR_DATA bSortColorKeyWords = sal_False; 863 864 #define HTML_NO_COLOR 0xffffffffUL 865 866 // die Farbnamen werden nicht exportiert 867 // Sie stammen aus "http://www.uio.no/~mnbjerke/colors_w.html" 868 // und scheinen im Gegensatz zu denen aus 869 // "http://www.infi.net/wwwimages/colorindex.html" 870 // zu stimmen 871 static HTML_ColorEntry __FAR_DATA aHTMLColorNameTab[] = { 872 { { "ALICEBLUE" }, 0x00f0f8ffUL }, 873 { { "ANTIQUEWHITE" }, 0x00faebd7UL }, 874 { { "AQUA" }, 0x0000ffffUL }, 875 { { "AQUAMARINE" }, 0x007fffd4UL }, 876 { { "AZURE" }, 0x00f0ffffUL }, 877 { { "BEIGE" }, 0x00f5f5dcUL }, 878 { { "BISQUE" }, 0x00ffe4c4UL }, 879 { { "BLACK" }, 0x00000000UL }, 880 { { "BLANCHEDALMOND" }, 0x00ffebcdUL }, 881 { { "BLUE" }, 0x000000ffUL }, 882 { { "BLUEVIOLET" }, 0x008a2be2UL }, 883 { { "BROWN" }, 0x00a52a2aUL }, 884 { { "BURLYWOOD" }, 0x00deb887UL }, 885 { { "CADETBLUE" }, 0x005f9ea0UL }, 886 { { "CHARTREUSE" }, 0x007fff00UL }, 887 { { "CHOCOLATE" }, 0x00d2691eUL }, 888 { { "CORAL" }, 0x00ff7f50UL }, 889 { { "CORNFLOWERBLUE" }, 0x006495edUL }, 890 { { "CORNSILK" }, 0x00fff8dcUL }, 891 { { "CRIMSON" }, 0x00dc143cUL }, 892 { { "CYAN" }, 0x0000ffffUL }, 893 { { "DARKBLUE" }, 0x0000008bUL }, 894 { { "DARKCYAN" }, 0x00008b8bUL }, 895 { { "DARKGOLDENROD" }, 0x00b8860bUL }, 896 { { "DARKGRAY" }, 0x00a9a9a9UL }, 897 { { "DARKGREEN" }, 0x00006400UL }, 898 { { "DARKKHAKI" }, 0x00bdb76bUL }, 899 { { "DARKMAGENTA" }, 0x008b008bUL }, 900 { { "DARKOLIVEGREEN" }, 0x00556b2fUL }, 901 { { "DARKORANGE" }, 0x00ff8c00UL }, 902 { { "DARKORCHID" }, 0x009932ccUL }, 903 { { "DARKRED" }, 0x008b0000UL }, 904 { { "DARKSALMON" }, 0x00e9967aUL }, 905 { { "DARKSEAGREEN" }, 0x008fbc8fUL }, 906 { { "DARKSLATEBLUE" }, 0x00483d8bUL }, 907 { { "DARKSLATEGRAY" }, 0x002f4f4fUL }, 908 { { "DARKTURQUOISE" }, 0x0000ced1UL }, 909 { { "DARKVIOLET" }, 0x009400d3UL }, 910 { { "DEEPPINK" }, 0x00ff1493UL }, 911 { { "DEEPSKYBLUE" }, 0x0000bfffUL }, 912 { { "DIMGRAY" }, 0x00696969UL }, 913 { { "DODGERBLUE" }, 0x001e90ffUL }, 914 { { "FIREBRICK" }, 0x00b22222UL }, 915 { { "FLORALWHITE" }, 0x00fffaf0UL }, 916 { { "FORESTGREEN" }, 0x00228b22UL }, 917 { { "FUCHSIA" }, 0x00ff00ffUL }, 918 { { "GAINSBORO" }, 0x00dcdcdcUL }, 919 { { "GHOSTWHITE" }, 0x00f8f8ffUL }, 920 { { "GOLD" }, 0x00ffd700UL }, 921 { { "GOLDENROD" }, 0x00daa520UL }, 922 { { "GRAY" }, 0x00808080UL }, 923 { { "GREEN" }, 0x00008000UL }, 924 { { "GREENYELLOW" }, 0x00adff2fUL }, 925 { { "HONEYDEW" }, 0x00f0fff0UL }, 926 { { "HOTPINK" }, 0x00ff69b4UL }, 927 { { "INDIANRED" }, 0x00cd5c5cUL }, 928 { { "INDIGO" }, 0x004b0082UL }, 929 { { "IVORY" }, 0x00fffff0UL }, 930 { { "KHAKI" }, 0x00f0e68cUL }, 931 { { "LAVENDER" }, 0x00e6e6faUL }, 932 { { "LAVENDERBLUSH" }, 0x00fff0f5UL }, 933 { { "LAWNGREEN" }, 0x007cfc00UL }, 934 { { "LEMONCHIFFON" }, 0x00fffacdUL }, 935 { { "LIGHTBLUE" }, 0x00add8e6UL }, 936 { { "LIGHTCORAL" }, 0x00f08080UL }, 937 { { "LIGHTCYAN" }, 0x00e0ffffUL }, 938 { { "LIGHTGOLDENRODYELLOW" }, 0x00fafad2UL }, 939 { { "LIGHTGREEN" }, 0x0090ee90UL }, 940 { { "LIGHTGREY" }, 0x00d3d3d3UL }, 941 { { "LIGHTPINK" }, 0x00ffb6c1UL }, 942 { { "LIGHTSALMON" }, 0x00ffa07aUL }, 943 { { "LIGHTSEAGREEN" }, 0x0020b2aaUL }, 944 { { "LIGHTSKYBLUE" }, 0x0087cefaUL }, 945 { { "LIGHTSLATEGRAY" }, 0x00778899UL }, 946 { { "LIGHTSTEELBLUE" }, 0x00b0c4deUL }, 947 { { "LIGHTYELLOW" }, 0x00ffffe0UL }, 948 { { "LIME" }, 0x0000ff00UL }, 949 { { "LIMEGREEN" }, 0x0032cd32UL }, 950 { { "LINEN" }, 0x00faf0e6UL }, 951 { { "MAGENTA" }, 0x00ff00ffUL }, 952 { { "MAROON" }, 0x00800000UL }, 953 { { "MEDIUMAQUAMARINE" }, 0x0066cdaaUL }, 954 { { "MEDIUMBLUE" }, 0x000000cdUL }, 955 { { "MEDIUMORCHID" }, 0x00ba55d3UL }, 956 { { "MEDIUMPURPLE" }, 0x009370dbUL }, 957 { { "MEDIUMSEAGREEN" }, 0x003cb371UL }, 958 { { "MEDIUMSLATEBLUE" }, 0x007b68eeUL }, 959 { { "MEDIUMSPRINGGREEN" }, 0x0000fa9aUL }, 960 { { "MEDIUMTURQUOISE" }, 0x0048d1ccUL }, 961 { { "MEDIUMVIOLETRED" }, 0x00c71585UL }, 962 { { "MIDNIGHTBLUE" }, 0x00191970UL }, 963 { { "MINTCREAM" }, 0x00f5fffaUL }, 964 { { "MISTYROSE" }, 0x00ffe4e1UL }, 965 { { "MOCCASIN" }, 0x00ffe4b5UL }, 966 { { "NAVAJOWHITE" }, 0x00ffdeadUL }, 967 { { "NAVY" }, 0x00000080UL }, 968 { { "OLDLACE" }, 0x00fdf5e6UL }, 969 { { "OLIVE" }, 0x00808000UL }, 970 { { "OLIVEDRAB" }, 0x006b8e23UL }, 971 { { "ORANGE" }, 0x00ffa500UL }, 972 { { "ORANGERED" }, 0x00ff4500UL }, 973 { { "ORCHID" }, 0x00da70d6UL }, 974 { { "PALEGOLDENROD" }, 0x00eee8aaUL }, 975 { { "PALEGREEN" }, 0x0098fb98UL }, 976 { { "PALETURQUOISE" }, 0x00afeeeeUL }, 977 { { "PALEVIOLETRED" }, 0x00db7093UL }, 978 { { "PAPAYAWHIP" }, 0x00ffefd5UL }, 979 { { "PEACHPUFF" }, 0x00ffdab9UL }, 980 { { "PERU" }, 0x00cd853fUL }, 981 { { "PINK" }, 0x00ffc0cbUL }, 982 { { "PLUM" }, 0x00dda0ddUL }, 983 { { "POWDERBLUE" }, 0x00b0e0e6UL }, 984 { { "PURPLE" }, 0x00800080UL }, 985 { { "RED" }, 0x00ff0000UL }, 986 { { "ROSYBROWN" }, 0x00bc8f8fUL }, 987 { { "ROYALBLUE" }, 0x004169e1UL }, 988 { { "SADDLEBROWN" }, 0x008b4513UL }, 989 { { "SALMON" }, 0x00fa8072UL }, 990 { { "SANDYBROWN" }, 0x00f4a460UL }, 991 { { "SEAGREEN" }, 0x002e8b57UL }, 992 { { "SEASHELL" }, 0x00fff5eeUL }, 993 { { "SIENNA" }, 0x00a0522dUL }, 994 { { "SILVER" }, 0x00c0c0c0UL }, 995 { { "SKYBLUE" }, 0x0087ceebUL }, 996 { { "SLATEBLUE" }, 0x006a5acdUL }, 997 { { "SLATEGRAY" }, 0x00708090UL }, 998 { { "SNOW" }, 0x00fffafaUL }, 999 { { "SPRINGGREEN" }, 0x0000ff7fUL }, 1000 { { "STEELBLUE" }, 0x004682b4UL }, 1001 { { "TAN" }, 0x00d2b48cUL }, 1002 { { "TEAL" }, 0x00008080UL }, 1003 { { "THISTLE" }, 0x00d8bfd8UL }, 1004 { { "TOMATO" }, 0x00ff6347UL }, 1005 { { "TURQUOISE" }, 0x0040e0d0UL }, 1006 { { "VIOLET" }, 0x00ee82eeUL }, 1007 { { "WHEAT" }, 0x00f5deb3UL }, 1008 { { "WHITE" }, 0x00ffffffUL }, 1009 { { "WHITESMOKE" }, 0x00f5f5f5UL }, 1010 { { "YELLOW" }, 0x00ffff00UL }, 1011 { { "YELLOWGREEN" }, 0x009acd32UL } 1012 }; 1013 1014 extern "C" 1015 { 1016 1017 static int 1018 #if defined( WNT ) 1019 __cdecl 1020 #endif 1021 #if defined( ICC ) && defined( OS2 ) 1022 _Optlink 1023 #endif 1024 HTMLColorNameCompare( const void *pFirst, const void *pSecond) 1025 { 1026 int nRet = 0; 1027 if( HTML_NO_COLOR == ((HTML_ColorEntry*)pFirst)->nColor ) 1028 { 1029 if( HTML_NO_COLOR == ((HTML_ColorEntry*)pSecond)->nColor ) 1030 nRet = ((HTML_ColorEntry*)pFirst)->pUName->CompareTo( 1031 *((HTML_ColorEntry*)pSecond)->pUName ); 1032 else 1033 nRet = ((HTML_ColorEntry*)pFirst)->pUName->CompareToAscii( 1034 ((HTML_ColorEntry*)pSecond)->sName ); 1035 } 1036 else 1037 { 1038 if( HTML_NO_COLOR == ((HTML_ColorEntry*)pSecond)->nColor ) 1039 nRet = -1 * ((HTML_ColorEntry*)pSecond)->pUName->CompareToAscii( 1040 ((HTML_ColorEntry*)pFirst)->sName ); 1041 else 1042 nRet = strcmp( ((HTML_ColorEntry*)pFirst)->sName, 1043 ((HTML_ColorEntry*)pSecond)->sName ); 1044 } 1045 1046 return nRet; 1047 } 1048 1049 } 1050 1051 sal_uLong GetHTMLColor( const String& rName ) 1052 { 1053 if( !bSortColorKeyWords ) 1054 { 1055 qsort( (void*) aHTMLColorNameTab, 1056 sizeof( aHTMLColorNameTab ) / sizeof( HTML_ColorEntry ), 1057 sizeof( HTML_ColorEntry ), 1058 HTMLColorNameCompare ); 1059 bSortColorKeyWords = sal_True; 1060 } 1061 1062 sal_uLong nRet = ULONG_MAX; 1063 void* pFound; 1064 HTML_ColorEntry aSrch; 1065 aSrch.pUName = &rName; 1066 aSrch.nColor = HTML_NO_COLOR; 1067 1068 if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch, 1069 (void*) aHTMLColorNameTab, 1070 sizeof( aHTMLColorNameTab) / sizeof( HTML_ColorEntry ), 1071 sizeof( HTML_ColorEntry ), 1072 HTMLColorNameCompare ))) 1073 nRet = ((HTML_ColorEntry*)pFound)->nColor; 1074 1075 return nRet; 1076 } 1077 1078