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