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 HTMLKeyCompare( const void *pFirst, const void *pSecond) 206 { 207 int nRet = 0; 208 if( -1 == ((HTML_TokenEntry*)pFirst)->nToken ) 209 { 210 if( -1 == ((HTML_TokenEntry*)pSecond)->nToken ) 211 nRet = ((HTML_TokenEntry*)pFirst)->pUToken->CompareTo( 212 *((HTML_TokenEntry*)pSecond)->pUToken ); 213 else 214 nRet = ((HTML_TokenEntry*)pFirst)->pUToken->CompareToAscii( 215 ((HTML_TokenEntry*)pSecond)->sToken ); 216 } 217 else 218 { 219 if( -1 == ((HTML_TokenEntry*)pSecond)->nToken ) 220 nRet = -1 * ((HTML_TokenEntry*)pSecond)->pUToken->CompareToAscii( 221 ((HTML_TokenEntry*)pFirst)->sToken ); 222 else 223 nRet = strcmp( ((HTML_TokenEntry*)pFirst)->sToken, 224 ((HTML_TokenEntry*)pSecond)->sToken ); 225 } 226 227 return nRet; 228 } 229 230 } 231 232 int GetHTMLToken( const String& rName ) 233 { 234 if( !bSortKeyWords ) 235 { 236 qsort( (void*) aHTMLTokenTab, 237 sizeof( aHTMLTokenTab ) / sizeof( HTML_TokenEntry ), 238 sizeof( HTML_TokenEntry ), 239 HTMLKeyCompare ); 240 bSortKeyWords = sal_True; 241 } 242 243 int nRet = 0; 244 245 if( !rName.CompareToAscii( OOO_STRING_SVTOOLS_HTML_comment, 3UL) ) 246 return HTML_COMMENT; 247 248 void* pFound; 249 HTML_TokenEntry aSrch; 250 aSrch.pUToken = &rName; 251 aSrch.nToken = -1; 252 253 if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch, 254 (void*) aHTMLTokenTab, 255 sizeof( aHTMLTokenTab ) / sizeof( HTML_TokenEntry ), 256 sizeof( HTML_TokenEntry ), 257 HTMLKeyCompare ))) 258 nRet = ((HTML_TokenEntry*)pFound)->nToken; 259 return nRet; 260 } 261 262 /**/ 263 264 struct HTML_CharEntry 265 { 266 union 267 { 268 const sal_Char *sName; 269 const String *pUName; 270 }; 271 sal_Unicode cChar; 272 }; 273 274 // Flag: RTF-Token Tabelle wurde schon sortiert 275 static int __FAR_DATA bSortCharKeyWords = sal_False; 276 277 static HTML_CharEntry __FAR_DATA aHTMLCharNameTab[] = { 278 {{OOO_STRING_SVTOOLS_HTML_C_lt}, 60}, 279 {{OOO_STRING_SVTOOLS_HTML_C_gt}, 62}, 280 {{OOO_STRING_SVTOOLS_HTML_C_amp}, 38}, 281 {{OOO_STRING_SVTOOLS_HTML_C_quot}, 34}, 282 283 {{OOO_STRING_SVTOOLS_HTML_C_Agrave}, 192}, 284 {{OOO_STRING_SVTOOLS_HTML_C_Aacute}, 193}, 285 {{OOO_STRING_SVTOOLS_HTML_C_Acirc}, 194}, 286 {{OOO_STRING_SVTOOLS_HTML_C_Atilde}, 195}, 287 {{OOO_STRING_SVTOOLS_HTML_C_Auml}, 196}, 288 {{OOO_STRING_SVTOOLS_HTML_C_Aring}, 197}, 289 {{OOO_STRING_SVTOOLS_HTML_C_AElig}, 198}, 290 {{OOO_STRING_SVTOOLS_HTML_C_Ccedil}, 199}, 291 {{OOO_STRING_SVTOOLS_HTML_C_Egrave}, 200}, 292 {{OOO_STRING_SVTOOLS_HTML_C_Eacute}, 201}, 293 {{OOO_STRING_SVTOOLS_HTML_C_Ecirc}, 202}, 294 {{OOO_STRING_SVTOOLS_HTML_C_Euml}, 203}, 295 {{OOO_STRING_SVTOOLS_HTML_C_Igrave}, 204}, 296 {{OOO_STRING_SVTOOLS_HTML_C_Iacute}, 205}, 297 {{OOO_STRING_SVTOOLS_HTML_C_Icirc}, 206}, 298 {{OOO_STRING_SVTOOLS_HTML_C_Iuml}, 207}, 299 {{OOO_STRING_SVTOOLS_HTML_C_ETH}, 208}, 300 {{OOO_STRING_SVTOOLS_HTML_C_Ntilde}, 209}, 301 {{OOO_STRING_SVTOOLS_HTML_C_Ograve}, 210}, 302 {{OOO_STRING_SVTOOLS_HTML_C_Oacute}, 211}, 303 {{OOO_STRING_SVTOOLS_HTML_C_Ocirc}, 212}, 304 {{OOO_STRING_SVTOOLS_HTML_C_Otilde}, 213}, 305 {{OOO_STRING_SVTOOLS_HTML_C_Ouml}, 214}, 306 {{OOO_STRING_SVTOOLS_HTML_C_Oslash}, 216}, 307 {{OOO_STRING_SVTOOLS_HTML_C_Ugrave}, 217}, 308 {{OOO_STRING_SVTOOLS_HTML_C_Uacute}, 218}, 309 {{OOO_STRING_SVTOOLS_HTML_C_Ucirc}, 219}, 310 {{OOO_STRING_SVTOOLS_HTML_C_Uuml}, 220}, 311 {{OOO_STRING_SVTOOLS_HTML_C_Yacute}, 221}, 312 313 {{OOO_STRING_SVTOOLS_HTML_C_THORN}, 222}, 314 {{OOO_STRING_SVTOOLS_HTML_C_szlig}, 223}, 315 316 {{OOO_STRING_SVTOOLS_HTML_S_agrave}, 224}, 317 {{OOO_STRING_SVTOOLS_HTML_S_aacute}, 225}, 318 {{OOO_STRING_SVTOOLS_HTML_S_acirc}, 226}, 319 {{OOO_STRING_SVTOOLS_HTML_S_atilde}, 227}, 320 {{OOO_STRING_SVTOOLS_HTML_S_auml}, 228}, 321 {{OOO_STRING_SVTOOLS_HTML_S_aring}, 229}, 322 {{OOO_STRING_SVTOOLS_HTML_S_aelig}, 230}, 323 {{OOO_STRING_SVTOOLS_HTML_S_ccedil}, 231}, 324 {{OOO_STRING_SVTOOLS_HTML_S_egrave}, 232}, 325 {{OOO_STRING_SVTOOLS_HTML_S_eacute}, 233}, 326 {{OOO_STRING_SVTOOLS_HTML_S_ecirc}, 234}, 327 {{OOO_STRING_SVTOOLS_HTML_S_euml}, 235}, 328 {{OOO_STRING_SVTOOLS_HTML_S_igrave}, 236}, 329 {{OOO_STRING_SVTOOLS_HTML_S_iacute}, 237}, 330 {{OOO_STRING_SVTOOLS_HTML_S_icirc}, 238}, 331 {{OOO_STRING_SVTOOLS_HTML_S_iuml}, 239}, 332 {{OOO_STRING_SVTOOLS_HTML_S_eth}, 240}, 333 {{OOO_STRING_SVTOOLS_HTML_S_ntilde}, 241}, 334 {{OOO_STRING_SVTOOLS_HTML_S_ograve}, 242}, 335 {{OOO_STRING_SVTOOLS_HTML_S_oacute}, 243}, 336 {{OOO_STRING_SVTOOLS_HTML_S_ocirc}, 244}, 337 {{OOO_STRING_SVTOOLS_HTML_S_otilde}, 245}, 338 {{OOO_STRING_SVTOOLS_HTML_S_ouml}, 246}, 339 {{OOO_STRING_SVTOOLS_HTML_S_oslash}, 248}, 340 {{OOO_STRING_SVTOOLS_HTML_S_ugrave}, 249}, 341 {{OOO_STRING_SVTOOLS_HTML_S_uacute}, 250}, 342 {{OOO_STRING_SVTOOLS_HTML_S_ucirc}, 251}, 343 {{OOO_STRING_SVTOOLS_HTML_S_uuml}, 252}, 344 {{OOO_STRING_SVTOOLS_HTML_S_yacute}, 253}, 345 {{OOO_STRING_SVTOOLS_HTML_S_thorn}, 254}, 346 {{OOO_STRING_SVTOOLS_HTML_S_yuml}, 255}, 347 348 // Sonderzeichen 349 {{OOO_STRING_SVTOOLS_HTML_S_acute}, 180}, 350 {{OOO_STRING_SVTOOLS_HTML_S_brvbar}, 166}, 351 {{OOO_STRING_SVTOOLS_HTML_S_cedil}, 184}, 352 {{OOO_STRING_SVTOOLS_HTML_S_cent}, 162}, 353 {{OOO_STRING_SVTOOLS_HTML_S_copy}, 169}, 354 {{OOO_STRING_SVTOOLS_HTML_S_curren}, 164}, 355 {{OOO_STRING_SVTOOLS_HTML_S_deg}, 176}, 356 {{OOO_STRING_SVTOOLS_HTML_S_divide}, 247}, 357 {{OOO_STRING_SVTOOLS_HTML_S_frac12}, 189}, 358 {{OOO_STRING_SVTOOLS_HTML_S_frac14}, 188}, 359 {{OOO_STRING_SVTOOLS_HTML_S_frac34}, 190}, 360 {{OOO_STRING_SVTOOLS_HTML_S_iexcl}, 161}, 361 {{OOO_STRING_SVTOOLS_HTML_S_iquest}, 191}, 362 {{OOO_STRING_SVTOOLS_HTML_S_laquo}, 171}, 363 {{OOO_STRING_SVTOOLS_HTML_S_macr}, 175}, 364 {{OOO_STRING_SVTOOLS_HTML_S_micro}, 181}, 365 {{OOO_STRING_SVTOOLS_HTML_S_middot}, 183}, 366 {{OOO_STRING_SVTOOLS_HTML_S_not}, 172}, 367 {{OOO_STRING_SVTOOLS_HTML_S_ordf}, 170}, 368 {{OOO_STRING_SVTOOLS_HTML_S_ordm}, 186}, 369 {{OOO_STRING_SVTOOLS_HTML_S_para}, 182}, 370 {{OOO_STRING_SVTOOLS_HTML_S_plusmn}, 177}, 371 {{OOO_STRING_SVTOOLS_HTML_S_pound}, 163}, 372 {{OOO_STRING_SVTOOLS_HTML_S_raquo}, 187}, 373 {{OOO_STRING_SVTOOLS_HTML_S_reg}, 174}, 374 {{OOO_STRING_SVTOOLS_HTML_S_sect}, 167}, 375 {{OOO_STRING_SVTOOLS_HTML_S_sup1}, 185}, 376 {{OOO_STRING_SVTOOLS_HTML_S_sup2}, 178}, 377 {{OOO_STRING_SVTOOLS_HTML_S_sup3}, 179}, 378 {{OOO_STRING_SVTOOLS_HTML_S_times}, 215}, 379 {{OOO_STRING_SVTOOLS_HTML_S_uml}, 168}, 380 {{OOO_STRING_SVTOOLS_HTML_S_yen}, 165}, 381 382 // Netscape kennt noch ein paar in Grossbuchstaben ... 383 {{OOO_STRING_SVTOOLS_HTML_C_LT}, 60}, 384 {{OOO_STRING_SVTOOLS_HTML_C_GT}, 62}, 385 {{OOO_STRING_SVTOOLS_HTML_C_AMP}, 38}, 386 {{OOO_STRING_SVTOOLS_HTML_C_QUOT}, 34}, 387 {{OOO_STRING_SVTOOLS_HTML_S_COPY}, 169}, 388 {{OOO_STRING_SVTOOLS_HTML_S_REG}, 174}, 389 390 // Sonderzeichen, die zu Tokens konvertiert werden !!! 391 {{OOO_STRING_SVTOOLS_HTML_S_nbsp}, 1}, 392 {{OOO_STRING_SVTOOLS_HTML_S_shy}, 2}, 393 394 395 // HTML4 396 {{OOO_STRING_SVTOOLS_HTML_S_OElig}, 338}, 397 {{OOO_STRING_SVTOOLS_HTML_S_oelig}, 339}, 398 {{OOO_STRING_SVTOOLS_HTML_S_Scaron}, 352}, 399 {{OOO_STRING_SVTOOLS_HTML_S_scaron}, 353}, 400 {{OOO_STRING_SVTOOLS_HTML_S_Yuml}, 376}, 401 {{OOO_STRING_SVTOOLS_HTML_S_fnof}, 402}, 402 {{OOO_STRING_SVTOOLS_HTML_S_circ}, 710}, 403 {{OOO_STRING_SVTOOLS_HTML_S_tilde}, 732}, 404 {{OOO_STRING_SVTOOLS_HTML_S_Alpha}, 913}, 405 {{OOO_STRING_SVTOOLS_HTML_S_Beta}, 914}, 406 {{OOO_STRING_SVTOOLS_HTML_S_Gamma}, 915}, 407 {{OOO_STRING_SVTOOLS_HTML_S_Delta}, 916}, 408 {{OOO_STRING_SVTOOLS_HTML_S_Epsilon}, 917}, 409 {{OOO_STRING_SVTOOLS_HTML_S_Zeta}, 918}, 410 {{OOO_STRING_SVTOOLS_HTML_S_Eta}, 919}, 411 {{OOO_STRING_SVTOOLS_HTML_S_Theta}, 920}, 412 {{OOO_STRING_SVTOOLS_HTML_S_Iota}, 921}, 413 {{OOO_STRING_SVTOOLS_HTML_S_Kappa}, 922}, 414 {{OOO_STRING_SVTOOLS_HTML_S_Lambda}, 923}, 415 {{OOO_STRING_SVTOOLS_HTML_S_Mu}, 924}, 416 {{OOO_STRING_SVTOOLS_HTML_S_Nu}, 925}, 417 {{OOO_STRING_SVTOOLS_HTML_S_Xi}, 926}, 418 {{OOO_STRING_SVTOOLS_HTML_S_Omicron}, 927}, 419 {{OOO_STRING_SVTOOLS_HTML_S_Pi}, 928}, 420 {{OOO_STRING_SVTOOLS_HTML_S_Rho}, 929}, 421 {{OOO_STRING_SVTOOLS_HTML_S_Sigma}, 931}, 422 {{OOO_STRING_SVTOOLS_HTML_S_Tau}, 932}, 423 {{OOO_STRING_SVTOOLS_HTML_S_Upsilon}, 933}, 424 {{OOO_STRING_SVTOOLS_HTML_S_Phi}, 934}, 425 {{OOO_STRING_SVTOOLS_HTML_S_Chi}, 935}, 426 {{OOO_STRING_SVTOOLS_HTML_S_Psi}, 936}, 427 {{OOO_STRING_SVTOOLS_HTML_S_Omega}, 937}, 428 {{OOO_STRING_SVTOOLS_HTML_S_alpha}, 945}, 429 {{OOO_STRING_SVTOOLS_HTML_S_beta}, 946}, 430 {{OOO_STRING_SVTOOLS_HTML_S_gamma}, 947}, 431 {{OOO_STRING_SVTOOLS_HTML_S_delta}, 948}, 432 {{OOO_STRING_SVTOOLS_HTML_S_epsilon}, 949}, 433 {{OOO_STRING_SVTOOLS_HTML_S_zeta}, 950}, 434 {{OOO_STRING_SVTOOLS_HTML_S_eta}, 951}, 435 {{OOO_STRING_SVTOOLS_HTML_S_theta}, 952}, 436 {{OOO_STRING_SVTOOLS_HTML_S_iota}, 953}, 437 {{OOO_STRING_SVTOOLS_HTML_S_kappa}, 954}, 438 {{OOO_STRING_SVTOOLS_HTML_S_lambda}, 955}, 439 {{OOO_STRING_SVTOOLS_HTML_S_mu}, 956}, 440 {{OOO_STRING_SVTOOLS_HTML_S_nu}, 957}, 441 {{OOO_STRING_SVTOOLS_HTML_S_xi}, 958}, 442 {{OOO_STRING_SVTOOLS_HTML_S_omicron}, 959}, 443 {{OOO_STRING_SVTOOLS_HTML_S_pi}, 960}, 444 {{OOO_STRING_SVTOOLS_HTML_S_rho}, 961}, 445 {{OOO_STRING_SVTOOLS_HTML_S_sigmaf}, 962}, 446 {{OOO_STRING_SVTOOLS_HTML_S_sigma}, 963}, 447 {{OOO_STRING_SVTOOLS_HTML_S_tau}, 964}, 448 {{OOO_STRING_SVTOOLS_HTML_S_upsilon}, 965}, 449 {{OOO_STRING_SVTOOLS_HTML_S_phi}, 966}, 450 {{OOO_STRING_SVTOOLS_HTML_S_chi}, 967}, 451 {{OOO_STRING_SVTOOLS_HTML_S_psi}, 968}, 452 {{OOO_STRING_SVTOOLS_HTML_S_omega}, 969}, 453 {{OOO_STRING_SVTOOLS_HTML_S_thetasym}, 977}, 454 {{OOO_STRING_SVTOOLS_HTML_S_upsih}, 978}, 455 {{OOO_STRING_SVTOOLS_HTML_S_piv}, 982}, 456 {{OOO_STRING_SVTOOLS_HTML_S_ensp}, 8194}, 457 {{OOO_STRING_SVTOOLS_HTML_S_emsp}, 8195}, 458 {{OOO_STRING_SVTOOLS_HTML_S_thinsp}, 8201}, 459 {{OOO_STRING_SVTOOLS_HTML_S_zwnj}, 8204}, 460 {{OOO_STRING_SVTOOLS_HTML_S_zwj}, 8205}, 461 {{OOO_STRING_SVTOOLS_HTML_S_lrm}, 8206}, 462 {{OOO_STRING_SVTOOLS_HTML_S_rlm}, 8207}, 463 {{OOO_STRING_SVTOOLS_HTML_S_ndash}, 8211}, 464 {{OOO_STRING_SVTOOLS_HTML_S_mdash}, 8212}, 465 {{OOO_STRING_SVTOOLS_HTML_S_lsquo}, 8216}, 466 {{OOO_STRING_SVTOOLS_HTML_S_rsquo}, 8217}, 467 {{OOO_STRING_SVTOOLS_HTML_S_sbquo}, 8218}, 468 {{OOO_STRING_SVTOOLS_HTML_S_ldquo}, 8220}, 469 {{OOO_STRING_SVTOOLS_HTML_S_rdquo}, 8221}, 470 {{OOO_STRING_SVTOOLS_HTML_S_bdquo}, 8222}, 471 {{OOO_STRING_SVTOOLS_HTML_S_dagger}, 8224}, 472 {{OOO_STRING_SVTOOLS_HTML_S_Dagger}, 8225}, 473 {{OOO_STRING_SVTOOLS_HTML_S_bull}, 8226}, 474 {{OOO_STRING_SVTOOLS_HTML_S_hellip}, 8230}, 475 {{OOO_STRING_SVTOOLS_HTML_S_permil}, 8240}, 476 {{OOO_STRING_SVTOOLS_HTML_S_prime}, 8242}, 477 {{OOO_STRING_SVTOOLS_HTML_S_Prime}, 8243}, 478 {{OOO_STRING_SVTOOLS_HTML_S_lsaquo}, 8249}, 479 {{OOO_STRING_SVTOOLS_HTML_S_rsaquo}, 8250}, 480 {{OOO_STRING_SVTOOLS_HTML_S_oline}, 8254}, 481 {{OOO_STRING_SVTOOLS_HTML_S_frasl}, 8260}, 482 {{OOO_STRING_SVTOOLS_HTML_S_euro}, 8364}, 483 {{OOO_STRING_SVTOOLS_HTML_S_image}, 8465}, 484 {{OOO_STRING_SVTOOLS_HTML_S_weierp}, 8472}, 485 {{OOO_STRING_SVTOOLS_HTML_S_real}, 8476}, 486 {{OOO_STRING_SVTOOLS_HTML_S_trade}, 8482}, 487 {{OOO_STRING_SVTOOLS_HTML_S_alefsym}, 8501}, 488 {{OOO_STRING_SVTOOLS_HTML_S_larr}, 8592}, 489 {{OOO_STRING_SVTOOLS_HTML_S_uarr}, 8593}, 490 {{OOO_STRING_SVTOOLS_HTML_S_rarr}, 8594}, 491 {{OOO_STRING_SVTOOLS_HTML_S_darr}, 8595}, 492 {{OOO_STRING_SVTOOLS_HTML_S_harr}, 8596}, 493 {{OOO_STRING_SVTOOLS_HTML_S_crarr}, 8629}, 494 {{OOO_STRING_SVTOOLS_HTML_S_lArr}, 8656}, 495 {{OOO_STRING_SVTOOLS_HTML_S_uArr}, 8657}, 496 {{OOO_STRING_SVTOOLS_HTML_S_rArr}, 8658}, 497 {{OOO_STRING_SVTOOLS_HTML_S_dArr}, 8659}, 498 {{OOO_STRING_SVTOOLS_HTML_S_hArr}, 8660}, 499 {{OOO_STRING_SVTOOLS_HTML_S_forall}, 8704}, 500 {{OOO_STRING_SVTOOLS_HTML_S_part}, 8706}, 501 {{OOO_STRING_SVTOOLS_HTML_S_exist}, 8707}, 502 {{OOO_STRING_SVTOOLS_HTML_S_empty}, 8709}, 503 {{OOO_STRING_SVTOOLS_HTML_S_nabla}, 8711}, 504 {{OOO_STRING_SVTOOLS_HTML_S_isin}, 8712}, 505 {{OOO_STRING_SVTOOLS_HTML_S_notin}, 8713}, 506 {{OOO_STRING_SVTOOLS_HTML_S_ni}, 8715}, 507 {{OOO_STRING_SVTOOLS_HTML_S_prod}, 8719}, 508 {{OOO_STRING_SVTOOLS_HTML_S_sum}, 8721}, 509 {{OOO_STRING_SVTOOLS_HTML_S_minus}, 8722}, 510 {{OOO_STRING_SVTOOLS_HTML_S_lowast}, 8727}, 511 {{OOO_STRING_SVTOOLS_HTML_S_radic}, 8730}, 512 {{OOO_STRING_SVTOOLS_HTML_S_prop}, 8733}, 513 {{OOO_STRING_SVTOOLS_HTML_S_infin}, 8734}, 514 {{OOO_STRING_SVTOOLS_HTML_S_ang}, 8736}, 515 {{OOO_STRING_SVTOOLS_HTML_S_and}, 8743}, 516 {{OOO_STRING_SVTOOLS_HTML_S_or}, 8744}, 517 {{OOO_STRING_SVTOOLS_HTML_S_cap}, 8745}, 518 {{OOO_STRING_SVTOOLS_HTML_S_cup}, 8746}, 519 {{OOO_STRING_SVTOOLS_HTML_S_int}, 8747}, 520 {{OOO_STRING_SVTOOLS_HTML_S_there4}, 8756}, 521 {{OOO_STRING_SVTOOLS_HTML_S_sim}, 8764}, 522 {{OOO_STRING_SVTOOLS_HTML_S_cong}, 8773}, 523 {{OOO_STRING_SVTOOLS_HTML_S_asymp}, 8776}, 524 {{OOO_STRING_SVTOOLS_HTML_S_ne}, 8800}, 525 {{OOO_STRING_SVTOOLS_HTML_S_equiv}, 8801}, 526 {{OOO_STRING_SVTOOLS_HTML_S_le}, 8804}, 527 {{OOO_STRING_SVTOOLS_HTML_S_ge}, 8805}, 528 {{OOO_STRING_SVTOOLS_HTML_S_sub}, 8834}, 529 {{OOO_STRING_SVTOOLS_HTML_S_sup}, 8835}, 530 {{OOO_STRING_SVTOOLS_HTML_S_nsub}, 8836}, 531 {{OOO_STRING_SVTOOLS_HTML_S_sube}, 8838}, 532 {{OOO_STRING_SVTOOLS_HTML_S_supe}, 8839}, 533 {{OOO_STRING_SVTOOLS_HTML_S_oplus}, 8853}, 534 {{OOO_STRING_SVTOOLS_HTML_S_otimes}, 8855}, 535 {{OOO_STRING_SVTOOLS_HTML_S_perp}, 8869}, 536 {{OOO_STRING_SVTOOLS_HTML_S_sdot}, 8901}, 537 {{OOO_STRING_SVTOOLS_HTML_S_lceil}, 8968}, 538 {{OOO_STRING_SVTOOLS_HTML_S_rceil}, 8969}, 539 {{OOO_STRING_SVTOOLS_HTML_S_lfloor}, 8970}, 540 {{OOO_STRING_SVTOOLS_HTML_S_rfloor}, 8971}, 541 {{OOO_STRING_SVTOOLS_HTML_S_lang}, 9001}, 542 {{OOO_STRING_SVTOOLS_HTML_S_rang}, 9002}, 543 {{OOO_STRING_SVTOOLS_HTML_S_loz}, 9674}, 544 {{OOO_STRING_SVTOOLS_HTML_S_spades}, 9824}, 545 {{OOO_STRING_SVTOOLS_HTML_S_clubs}, 9827}, 546 {{OOO_STRING_SVTOOLS_HTML_S_hearts}, 9829}, 547 {{OOO_STRING_SVTOOLS_HTML_S_diams}, 9830} 548 }; 549 550 extern "C" 551 { 552 553 static int 554 #if defined( WNT ) 555 __cdecl 556 #endif 557 HTMLCharNameCompare( const void *pFirst, const void *pSecond) 558 { 559 int nRet = 0; 560 if( USHRT_MAX == ((HTML_CharEntry*)pFirst)->cChar ) 561 { 562 if( USHRT_MAX == ((HTML_CharEntry*)pSecond)->cChar ) 563 nRet = ((HTML_CharEntry*)pFirst)->pUName->CompareTo( 564 *((HTML_CharEntry*)pSecond)->pUName ); 565 else 566 nRet = ((HTML_CharEntry*)pFirst)->pUName->CompareToAscii( 567 ((HTML_CharEntry*)pSecond)->sName ); 568 } 569 else 570 { 571 if( USHRT_MAX == ((HTML_CharEntry*)pSecond)->cChar ) 572 nRet = -1 * ((HTML_CharEntry*)pSecond)->pUName->CompareToAscii( 573 ((HTML_CharEntry*)pFirst)->sName ); 574 else 575 nRet = strcmp( ((HTML_CharEntry*)pFirst)->sName, 576 ((HTML_CharEntry*)pSecond)->sName ); 577 } 578 579 return nRet; 580 } 581 582 } 583 584 sal_Unicode GetHTMLCharName( const String& rName ) 585 { 586 if( !bSortCharKeyWords ) 587 { 588 qsort( (void*) aHTMLCharNameTab, 589 sizeof( aHTMLCharNameTab ) / sizeof( HTML_CharEntry ), 590 sizeof( HTML_CharEntry ), 591 HTMLCharNameCompare ); 592 bSortCharKeyWords = sal_True; 593 } 594 595 sal_Unicode cRet = 0; 596 void* pFound; 597 HTML_CharEntry aSrch; 598 aSrch.pUName = &rName; 599 aSrch.cChar = USHRT_MAX; 600 601 if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch, 602 (void*) aHTMLCharNameTab, 603 sizeof( aHTMLCharNameTab) / sizeof( HTML_CharEntry ), 604 sizeof( HTML_CharEntry ), 605 HTMLCharNameCompare ))) 606 cRet = ((HTML_CharEntry*)pFound)->cChar; 607 return cRet; 608 } 609 610 /**/ 611 612 // Flag: Optionen-Tabelle wurde schon sortiert 613 static int __FAR_DATA bSortOptionKeyWords = sal_False; 614 615 static HTML_TokenEntry __FAR_DATA aHTMLOptionTab[] = { 616 617 // Attribute ohne Wert 618 {{OOO_STRING_SVTOOLS_HTML_O_box}, HTML_O_BOX}, 619 {{OOO_STRING_SVTOOLS_HTML_O_checked}, HTML_O_CHECKED}, 620 {{OOO_STRING_SVTOOLS_HTML_O_compact}, HTML_O_COMPACT}, 621 {{OOO_STRING_SVTOOLS_HTML_O_continue}, HTML_O_CONTINUE}, 622 {{OOO_STRING_SVTOOLS_HTML_O_controls}, HTML_O_CONTROLS}, // IExplorer 2.0 623 {{OOO_STRING_SVTOOLS_HTML_O_declare}, HTML_O_DECLARE}, 624 {{OOO_STRING_SVTOOLS_HTML_O_disabled}, HTML_O_DISABLED}, 625 {{OOO_STRING_SVTOOLS_HTML_O_folded}, HTML_O_FOLDED}, // Netscape internal 626 {{OOO_STRING_SVTOOLS_HTML_O_ismap}, HTML_O_ISMAP}, 627 {{OOO_STRING_SVTOOLS_HTML_O_mayscript}, HTML_O_MAYSCRIPT}, 628 {{OOO_STRING_SVTOOLS_HTML_O_multiple}, HTML_O_MULTIPLE}, 629 {{OOO_STRING_SVTOOLS_HTML_O_noflow}, HTML_O_NOFLOW}, 630 {{OOO_STRING_SVTOOLS_HTML_O_nohref}, HTML_O_NOHREF}, // Netscape 2.0 631 {{OOO_STRING_SVTOOLS_HTML_O_noresize}, HTML_O_NORESIZE}, // Netscape 2.0 632 {{OOO_STRING_SVTOOLS_HTML_O_noshade}, HTML_O_NOSHADE}, // Netscape 2.0 633 {{OOO_STRING_SVTOOLS_HTML_O_nowrap}, HTML_O_NOWRAP}, 634 {{OOO_STRING_SVTOOLS_HTML_O_plain}, HTML_O_PLAIN}, 635 {{OOO_STRING_SVTOOLS_HTML_O_sdfixed}, HTML_O_SDFIXED}, 636 {{OOO_STRING_SVTOOLS_HTML_O_selected}, HTML_O_SELECTED}, 637 {{OOO_STRING_SVTOOLS_HTML_O_shapes}, HTML_O_SHAPES}, 638 639 // Attribute mit einem String als Wert 640 {{OOO_STRING_SVTOOLS_HTML_O_above}, HTML_O_ABOVE}, 641 {{OOO_STRING_SVTOOLS_HTML_O_accept}, HTML_O_ACCEPT}, 642 {{OOO_STRING_SVTOOLS_HTML_O_accesskey}, HTML_O_ACCESSKEY}, 643 {{OOO_STRING_SVTOOLS_HTML_O_add_date}, HTML_O_ADD_DATE}, // Netscape internal 644 {{OOO_STRING_SVTOOLS_HTML_O_alt}, HTML_O_ALT}, 645 {{OOO_STRING_SVTOOLS_HTML_O_axes}, HTML_O_AXES}, 646 {{OOO_STRING_SVTOOLS_HTML_O_axis}, HTML_O_AXIS}, 647 {{OOO_STRING_SVTOOLS_HTML_O_below}, HTML_O_BELOW}, 648 {{OOO_STRING_SVTOOLS_HTML_O_char}, HTML_O_CHAR}, // HTML 3 Table Model Draft 649 {{OOO_STRING_SVTOOLS_HTML_O_class}, HTML_O_CLASS}, 650 {{OOO_STRING_SVTOOLS_HTML_O_clip}, HTML_O_CLIP}, 651 {{OOO_STRING_SVTOOLS_HTML_O_code}, HTML_O_CODE}, // HotJava 652 {{OOO_STRING_SVTOOLS_HTML_O_codetype}, HTML_O_CODETYPE}, 653 {{OOO_STRING_SVTOOLS_HTML_O_colspec}, HTML_O_COLSPEC}, 654 {{OOO_STRING_SVTOOLS_HTML_O_content}, HTML_O_CONTENT}, 655 {{OOO_STRING_SVTOOLS_HTML_O_coords}, HTML_O_COORDS}, // Netscape 2.0 656 {{OOO_STRING_SVTOOLS_HTML_O_dp}, HTML_O_DP}, 657 {{OOO_STRING_SVTOOLS_HTML_O_enctype}, HTML_O_ENCTYPE}, 658 {{OOO_STRING_SVTOOLS_HTML_O_error}, HTML_O_ERROR}, 659 {{OOO_STRING_SVTOOLS_HTML_O_face}, HTML_O_FACE}, // IExplorer 2.0 660 {{OOO_STRING_SVTOOLS_HTML_O_frameborder}, HTML_O_FRAMEBORDER}, // IExplorer 3.0 661 {{OOO_STRING_SVTOOLS_HTML_O_httpequiv}, HTML_O_HTTPEQUIV}, 662 {{OOO_STRING_SVTOOLS_HTML_O_language}, HTML_O_LANGUAGE}, // JavaScript 663 {{OOO_STRING_SVTOOLS_HTML_O_last_modified}, HTML_O_LAST_MODIFIED}, // Netscape internal 664 {{OOO_STRING_SVTOOLS_HTML_O_last_visit}, HTML_O_LAST_VISIT}, // Netscape internal 665 {{OOO_STRING_SVTOOLS_HTML_O_md}, HTML_O_MD}, 666 {{OOO_STRING_SVTOOLS_HTML_O_n}, HTML_O_N}, 667 {{OOO_STRING_SVTOOLS_HTML_O_name}, HTML_O_NAME}, 668 {{OOO_STRING_SVTOOLS_HTML_O_notation}, HTML_O_NOTATION}, 669 {{OOO_STRING_SVTOOLS_HTML_O_prompt}, HTML_O_PROMPT}, 670 {{OOO_STRING_SVTOOLS_HTML_O_shape}, HTML_O_SHAPE}, 671 {{OOO_STRING_SVTOOLS_HTML_O_standby}, HTML_O_STANDBY}, 672 {{OOO_STRING_SVTOOLS_HTML_O_style}, HTML_O_STYLE}, 673 {{OOO_STRING_SVTOOLS_HTML_O_title}, HTML_O_TITLE}, 674 {{OOO_STRING_SVTOOLS_HTML_O_value}, HTML_O_VALUE}, 675 {{OOO_STRING_SVTOOLS_HTML_O_SDval}, HTML_O_SDVAL}, // StarDiv NumberValue 676 {{OOO_STRING_SVTOOLS_HTML_O_SDnum}, HTML_O_SDNUM}, // StarDiv NumberFormat 677 {{OOO_STRING_SVTOOLS_HTML_O_sdlibrary}, HTML_O_SDLIBRARY}, 678 {{OOO_STRING_SVTOOLS_HTML_O_sdmodule}, HTML_O_SDMODULE}, 679 680 // Attribute mit einem SGML-Identifier als Wert 681 {{OOO_STRING_SVTOOLS_HTML_O_from}, HTML_O_FROM}, 682 {{OOO_STRING_SVTOOLS_HTML_O_id}, HTML_O_ID}, 683 {{OOO_STRING_SVTOOLS_HTML_O_target}, HTML_O_TARGET}, // Netscape 2.0 684 {{OOO_STRING_SVTOOLS_HTML_O_to}, HTML_O_TO}, 685 {{OOO_STRING_SVTOOLS_HTML_O_until}, HTML_O_UNTIL}, 686 687 // Attribute mit einem URI als Wert 688 {{OOO_STRING_SVTOOLS_HTML_O_action}, HTML_O_ACTION}, 689 {{OOO_STRING_SVTOOLS_HTML_O_archive}, HTML_O_ARCHIVE}, 690 {{OOO_STRING_SVTOOLS_HTML_O_background}, HTML_O_BACKGROUND}, 691 {{OOO_STRING_SVTOOLS_HTML_O_classid}, HTML_O_CLASSID}, 692 {{OOO_STRING_SVTOOLS_HTML_O_codebase}, HTML_O_CODEBASE}, // HotJava 693 {{OOO_STRING_SVTOOLS_HTML_O_data}, HTML_O_DATA}, 694 {{OOO_STRING_SVTOOLS_HTML_O_dynsrc}, HTML_O_DYNSRC}, // IExplorer 3.0b1 695 {{OOO_STRING_SVTOOLS_HTML_O_dynsync}, HTML_O_DYNSYNC}, // IExplorer 2.0 696 {{OOO_STRING_SVTOOLS_HTML_O_imagemap}, HTML_O_IMAGEMAP}, 697 {{OOO_STRING_SVTOOLS_HTML_O_href}, HTML_O_HREF}, 698 {{OOO_STRING_SVTOOLS_HTML_O_lowsrc}, HTML_O_LOWSRC}, // Netscape 3.0 699 {{OOO_STRING_SVTOOLS_HTML_O_script}, HTML_O_SCRIPT}, 700 {{OOO_STRING_SVTOOLS_HTML_O_src}, HTML_O_SRC}, 701 {{OOO_STRING_SVTOOLS_HTML_O_usemap}, HTML_O_USEMAP}, // Netscape 2.0 702 703 // Attribute mit Entity-Namen als Wert 704 {{OOO_STRING_SVTOOLS_HTML_O_dingbat}, HTML_O_DINGBAT}, 705 {{OOO_STRING_SVTOOLS_HTML_O_sym}, HTML_O_SYM}, 706 707 // Attribute mit einer Farbe als Wert (alle Netscape) 708 {{OOO_STRING_SVTOOLS_HTML_O_alink}, HTML_O_ALINK}, 709 {{OOO_STRING_SVTOOLS_HTML_O_bgcolor}, HTML_O_BGCOLOR}, 710 {{OOO_STRING_SVTOOLS_HTML_O_bordercolor}, HTML_O_BORDERCOLOR}, // IExplorer 2.0 711 {{OOO_STRING_SVTOOLS_HTML_O_bordercolorlight}, HTML_O_BORDERCOLORLIGHT}, // IExplorer 2.0 712 {{OOO_STRING_SVTOOLS_HTML_O_bordercolordark}, HTML_O_BORDERCOLORDARK}, // IExplorer 2.0 713 {{OOO_STRING_SVTOOLS_HTML_O_color}, HTML_O_COLOR}, 714 {{OOO_STRING_SVTOOLS_HTML_O_link}, HTML_O_LINK}, 715 {{OOO_STRING_SVTOOLS_HTML_O_text}, HTML_O_TEXT}, 716 {{OOO_STRING_SVTOOLS_HTML_O_vlink}, HTML_O_VLINK}, 717 718 // Attribute mit einem numerischen Wert 719 {{OOO_STRING_SVTOOLS_HTML_O_border}, HTML_O_BORDER}, 720 {{OOO_STRING_SVTOOLS_HTML_O_cellspacing},HTML_O_CELLSPACING}, // HTML 3 Table Model Draft 721 {{OOO_STRING_SVTOOLS_HTML_O_cellpadding},HTML_O_CELLPADDING}, // HTML 3 Table Model Draft 722 {{OOO_STRING_SVTOOLS_HTML_O_charoff}, HTML_O_CHAROFF}, // HTML 3 Table Model Draft 723 {{OOO_STRING_SVTOOLS_HTML_O_colspan}, HTML_O_COLSPAN}, 724 {{OOO_STRING_SVTOOLS_HTML_O_framespacing}, HTML_O_FRAMESPACING}, // IExplorer 3.0 725 {{OOO_STRING_SVTOOLS_HTML_O_gutter}, HTML_O_GUTTER}, // Netscape 3.0b5 726 {{OOO_STRING_SVTOOLS_HTML_O_indent}, HTML_O_INDENT}, 727 {{OOO_STRING_SVTOOLS_HTML_O_height}, HTML_O_HEIGHT}, 728 {{OOO_STRING_SVTOOLS_HTML_O_hspace}, HTML_O_HSPACE}, // Netscape 729 {{OOO_STRING_SVTOOLS_HTML_O_left}, HTML_O_LEFT}, 730 {{OOO_STRING_SVTOOLS_HTML_O_leftmargin}, HTML_O_LEFTMARGIN}, // IExplorer 2.0 731 {{OOO_STRING_SVTOOLS_HTML_O_loop}, HTML_O_LOOP}, // IExplorer 2.0 732 {{OOO_STRING_SVTOOLS_HTML_O_marginheight},HTML_O_MARGINHEIGHT}, // Netscape 2.0 733 {{OOO_STRING_SVTOOLS_HTML_O_marginwidth},HTML_O_MARGINWIDTH}, // Netscape 2.0 734 {{OOO_STRING_SVTOOLS_HTML_O_max}, HTML_O_MAX}, 735 {{OOO_STRING_SVTOOLS_HTML_O_maxlength}, HTML_O_MAXLENGTH}, 736 {{OOO_STRING_SVTOOLS_HTML_O_min}, HTML_O_MIN}, 737 {{OOO_STRING_SVTOOLS_HTML_O_pagex}, HTML_O_PAGEX}, 738 {{OOO_STRING_SVTOOLS_HTML_O_pagey}, HTML_O_PAGEY}, 739 {{OOO_STRING_SVTOOLS_HTML_O_pointsize}, HTML_O_POINTSIZE}, 740 {{OOO_STRING_SVTOOLS_HTML_O_rowspan}, HTML_O_ROWSPAN}, 741 {{OOO_STRING_SVTOOLS_HTML_O_scrollamount}, HTML_O_SCROLLAMOUNT}, // IExplorer 2.0 742 {{OOO_STRING_SVTOOLS_HTML_O_scrolldelay}, HTML_O_SCROLLDELAY}, // IExplorer 2.0 743 {{OOO_STRING_SVTOOLS_HTML_O_seqnum}, HTML_O_SEQNUM}, 744 {{OOO_STRING_SVTOOLS_HTML_O_skip}, HTML_O_SKIP}, 745 {{OOO_STRING_SVTOOLS_HTML_O_span}, HTML_O_SPAN}, // HTML 3 Table Model Draft 746 {{OOO_STRING_SVTOOLS_HTML_O_tabindex}, HTML_O_TABINDEX}, 747 {{OOO_STRING_SVTOOLS_HTML_O_top}, HTML_O_TOP}, 748 {{OOO_STRING_SVTOOLS_HTML_O_topmargin}, HTML_O_TOPMARGIN}, // IExplorer 2.0 749 {{OOO_STRING_SVTOOLS_HTML_O_vspace}, HTML_O_VSPACE}, // Netscape 750 {{OOO_STRING_SVTOOLS_HTML_O_weight}, HTML_O_WEIGHT}, 751 {{OOO_STRING_SVTOOLS_HTML_O_width}, HTML_O_WIDTH}, 752 {{OOO_STRING_SVTOOLS_HTML_O_x}, HTML_O_X}, 753 {{OOO_STRING_SVTOOLS_HTML_O_y}, HTML_O_Y}, 754 {{OOO_STRING_SVTOOLS_HTML_O_zindex}, HTML_O_ZINDEX}, 755 756 // Attribute mit Enum-Werten 757 {{OOO_STRING_SVTOOLS_HTML_O_bgproperties}, HTML_O_BGPROPERTIES}, // IExplorer 2.0 758 {{OOO_STRING_SVTOOLS_HTML_O_behavior}, HTML_O_BEHAVIOR}, // IExplorer 2.0 759 {{OOO_STRING_SVTOOLS_HTML_O_clear}, HTML_O_CLEAR}, 760 {{OOO_STRING_SVTOOLS_HTML_O_dir}, HTML_O_DIR}, // HTML 3 Table Model Draft 761 {{OOO_STRING_SVTOOLS_HTML_O_direction}, HTML_O_DIRECTION}, // IExplorer 2.0 762 {{OOO_STRING_SVTOOLS_HTML_O_format}, HTML_O_FORMAT}, 763 {{OOO_STRING_SVTOOLS_HTML_O_frame}, HTML_O_FRAME}, // HTML 3 Table Model Draft 764 {{OOO_STRING_SVTOOLS_HTML_O_lang}, HTML_O_LANG}, 765 {{OOO_STRING_SVTOOLS_HTML_O_method}, HTML_O_METHOD}, 766 {{OOO_STRING_SVTOOLS_HTML_O_palette}, HTML_O_PALETTE}, 767 {{OOO_STRING_SVTOOLS_HTML_O_rel}, HTML_O_REL}, 768 {{OOO_STRING_SVTOOLS_HTML_O_rev}, HTML_O_REV}, 769 {{OOO_STRING_SVTOOLS_HTML_O_rules}, HTML_O_RULES}, // HTML 3 Table Model Draft 770 {{OOO_STRING_SVTOOLS_HTML_O_scrolling}, HTML_O_SCROLLING}, // Netscape 2.0 771 {{OOO_STRING_SVTOOLS_HTML_O_sdreadonly}, HTML_O_SDREADONLY}, 772 {{OOO_STRING_SVTOOLS_HTML_O_subtype}, HTML_O_SUBTYPE}, 773 {{OOO_STRING_SVTOOLS_HTML_O_type}, HTML_O_TYPE}, 774 {{OOO_STRING_SVTOOLS_HTML_O_valign}, HTML_O_VALIGN}, 775 {{OOO_STRING_SVTOOLS_HTML_O_valuetype}, HTML_O_VALUETYPE}, 776 {{OOO_STRING_SVTOOLS_HTML_O_wrap}, HTML_O_WRAP}, 777 {{OOO_STRING_SVTOOLS_HTML_O_visibility}, HTML_O_VISIBILITY}, 778 779 // Attribute mit Script-Code als Wert 780 {{OOO_STRING_SVTOOLS_HTML_O_onblur}, HTML_O_ONBLUR}, // JavaScript 781 {{OOO_STRING_SVTOOLS_HTML_O_onchange}, HTML_O_ONCHANGE}, // JavaScript 782 {{OOO_STRING_SVTOOLS_HTML_O_onclick}, HTML_O_ONCLICK}, // JavaScript 783 {{OOO_STRING_SVTOOLS_HTML_O_onfocus}, HTML_O_ONFOCUS}, // JavaScript 784 {{OOO_STRING_SVTOOLS_HTML_O_onload}, HTML_O_ONLOAD}, // JavaScript 785 {{OOO_STRING_SVTOOLS_HTML_O_onmouseover}, HTML_O_ONMOUSEOVER}, // JavaScript 786 {{OOO_STRING_SVTOOLS_HTML_O_onreset}, HTML_O_ONRESET}, // JavaScript 787 {{OOO_STRING_SVTOOLS_HTML_O_onselect}, HTML_O_ONSELECT}, // JavaScript 788 {{OOO_STRING_SVTOOLS_HTML_O_onsubmit}, HTML_O_ONSUBMIT}, // JavaScript 789 {{OOO_STRING_SVTOOLS_HTML_O_onunload}, HTML_O_ONUNLOAD}, // JavaScript 790 {{OOO_STRING_SVTOOLS_HTML_O_onabort}, HTML_O_ONABORT}, // JavaScript 791 {{OOO_STRING_SVTOOLS_HTML_O_onerror}, HTML_O_ONERROR}, // JavaScript 792 {{OOO_STRING_SVTOOLS_HTML_O_onmouseout}, HTML_O_ONMOUSEOUT}, // JavaScript 793 794 {{OOO_STRING_SVTOOLS_HTML_O_SDonblur}, HTML_O_SDONBLUR}, // StarBasic 795 {{OOO_STRING_SVTOOLS_HTML_O_SDonchange}, HTML_O_SDONCHANGE}, // StarBasic 796 {{OOO_STRING_SVTOOLS_HTML_O_SDonclick}, HTML_O_SDONCLICK}, // StarBasic 797 {{OOO_STRING_SVTOOLS_HTML_O_SDonfocus}, HTML_O_SDONFOCUS}, // StarBasic 798 {{OOO_STRING_SVTOOLS_HTML_O_SDonload}, HTML_O_SDONLOAD}, // StarBasic 799 {{OOO_STRING_SVTOOLS_HTML_O_SDonmouseover}, HTML_O_SDONMOUSEOVER}, // StarBasic 800 {{OOO_STRING_SVTOOLS_HTML_O_SDonreset}, HTML_O_SDONRESET}, // StarBasic 801 {{OOO_STRING_SVTOOLS_HTML_O_SDonselect}, HTML_O_SDONSELECT}, // StarBasic 802 {{OOO_STRING_SVTOOLS_HTML_O_SDonsubmit}, HTML_O_SDONSUBMIT}, // StarBasic 803 {{OOO_STRING_SVTOOLS_HTML_O_SDonunload}, HTML_O_SDONUNLOAD}, // StarBasic 804 {{OOO_STRING_SVTOOLS_HTML_O_SDonabort}, HTML_O_SDONABORT}, // StarBasic 805 {{OOO_STRING_SVTOOLS_HTML_O_SDonerror}, HTML_O_SDONERROR}, // StarBasic 806 {{OOO_STRING_SVTOOLS_HTML_O_SDonmouseout}, HTML_O_SDONMOUSEOUT}, // StarBasic 807 808 // Attribute mit Kontext-abhaengigen Werten 809 {{OOO_STRING_SVTOOLS_HTML_O_align}, HTML_O_ALIGN}, 810 {{OOO_STRING_SVTOOLS_HTML_O_cols}, HTML_O_COLS}, // Netscape 2.0 vs HTML 2.0 811 {{OOO_STRING_SVTOOLS_HTML_O_rows}, HTML_O_ROWS}, // Netscape 2.0 vs HTML 2.0 812 {{OOO_STRING_SVTOOLS_HTML_O_size}, HTML_O_SIZE}, 813 {{OOO_STRING_SVTOOLS_HTML_O_start}, HTML_O_START}, // Netscape 2.0 vs IExplorer 2.0 814 {{OOO_STRING_SVTOOLS_HTML_O_units}, HTML_O_UNITS} 815 }; 816 817 int GetHTMLOption( const String& rName ) 818 { 819 if( !bSortOptionKeyWords ) 820 { 821 qsort( (void*) aHTMLOptionTab, 822 sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ), 823 sizeof( HTML_TokenEntry ), 824 HTMLKeyCompare ); 825 bSortOptionKeyWords = sal_True; 826 } 827 828 int nRet = HTML_O_UNKNOWN; 829 void* pFound; 830 HTML_TokenEntry aSrch; 831 aSrch.pUToken = &rName; 832 aSrch.nToken = -1; 833 834 if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch, 835 (void*) aHTMLOptionTab, 836 sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ), 837 sizeof( HTML_TokenEntry ), 838 HTMLKeyCompare ))) 839 nRet = ((HTML_TokenEntry*)pFound)->nToken; 840 return nRet; 841 } 842 843 /**/ 844 845 // Flag: Farb-Tabelle wurde schon sortiert 846 struct HTML_ColorEntry 847 { 848 union 849 { 850 const sal_Char* sName; 851 const String *pUName; 852 }; 853 sal_uLong nColor; 854 }; 855 856 static int __FAR_DATA bSortColorKeyWords = sal_False; 857 858 #define HTML_NO_COLOR 0xffffffffUL 859 860 // die Farbnamen werden nicht exportiert 861 // Sie stammen aus "http://www.uio.no/~mnbjerke/colors_w.html" 862 // und scheinen im Gegensatz zu denen aus 863 // "http://www.infi.net/wwwimages/colorindex.html" 864 // zu stimmen 865 static HTML_ColorEntry __FAR_DATA aHTMLColorNameTab[] = { 866 { { "ALICEBLUE" }, 0x00f0f8ffUL }, 867 { { "ANTIQUEWHITE" }, 0x00faebd7UL }, 868 { { "AQUA" }, 0x0000ffffUL }, 869 { { "AQUAMARINE" }, 0x007fffd4UL }, 870 { { "AZURE" }, 0x00f0ffffUL }, 871 { { "BEIGE" }, 0x00f5f5dcUL }, 872 { { "BISQUE" }, 0x00ffe4c4UL }, 873 { { "BLACK" }, 0x00000000UL }, 874 { { "BLANCHEDALMOND" }, 0x00ffebcdUL }, 875 { { "BLUE" }, 0x000000ffUL }, 876 { { "BLUEVIOLET" }, 0x008a2be2UL }, 877 { { "BROWN" }, 0x00a52a2aUL }, 878 { { "BURLYWOOD" }, 0x00deb887UL }, 879 { { "CADETBLUE" }, 0x005f9ea0UL }, 880 { { "CHARTREUSE" }, 0x007fff00UL }, 881 { { "CHOCOLATE" }, 0x00d2691eUL }, 882 { { "CORAL" }, 0x00ff7f50UL }, 883 { { "CORNFLOWERBLUE" }, 0x006495edUL }, 884 { { "CORNSILK" }, 0x00fff8dcUL }, 885 { { "CRIMSON" }, 0x00dc143cUL }, 886 { { "CYAN" }, 0x0000ffffUL }, 887 { { "DARKBLUE" }, 0x0000008bUL }, 888 { { "DARKCYAN" }, 0x00008b8bUL }, 889 { { "DARKGOLDENROD" }, 0x00b8860bUL }, 890 { { "DARKGRAY" }, 0x00a9a9a9UL }, 891 { { "DARKGREEN" }, 0x00006400UL }, 892 { { "DARKKHAKI" }, 0x00bdb76bUL }, 893 { { "DARKMAGENTA" }, 0x008b008bUL }, 894 { { "DARKOLIVEGREEN" }, 0x00556b2fUL }, 895 { { "DARKORANGE" }, 0x00ff8c00UL }, 896 { { "DARKORCHID" }, 0x009932ccUL }, 897 { { "DARKRED" }, 0x008b0000UL }, 898 { { "DARKSALMON" }, 0x00e9967aUL }, 899 { { "DARKSEAGREEN" }, 0x008fbc8fUL }, 900 { { "DARKSLATEBLUE" }, 0x00483d8bUL }, 901 { { "DARKSLATEGRAY" }, 0x002f4f4fUL }, 902 { { "DARKTURQUOISE" }, 0x0000ced1UL }, 903 { { "DARKVIOLET" }, 0x009400d3UL }, 904 { { "DEEPPINK" }, 0x00ff1493UL }, 905 { { "DEEPSKYBLUE" }, 0x0000bfffUL }, 906 { { "DIMGRAY" }, 0x00696969UL }, 907 { { "DODGERBLUE" }, 0x001e90ffUL }, 908 { { "FIREBRICK" }, 0x00b22222UL }, 909 { { "FLORALWHITE" }, 0x00fffaf0UL }, 910 { { "FORESTGREEN" }, 0x00228b22UL }, 911 { { "FUCHSIA" }, 0x00ff00ffUL }, 912 { { "GAINSBORO" }, 0x00dcdcdcUL }, 913 { { "GHOSTWHITE" }, 0x00f8f8ffUL }, 914 { { "GOLD" }, 0x00ffd700UL }, 915 { { "GOLDENROD" }, 0x00daa520UL }, 916 { { "GRAY" }, 0x00808080UL }, 917 { { "GREEN" }, 0x00008000UL }, 918 { { "GREENYELLOW" }, 0x00adff2fUL }, 919 { { "HONEYDEW" }, 0x00f0fff0UL }, 920 { { "HOTPINK" }, 0x00ff69b4UL }, 921 { { "INDIANRED" }, 0x00cd5c5cUL }, 922 { { "INDIGO" }, 0x004b0082UL }, 923 { { "IVORY" }, 0x00fffff0UL }, 924 { { "KHAKI" }, 0x00f0e68cUL }, 925 { { "LAVENDER" }, 0x00e6e6faUL }, 926 { { "LAVENDERBLUSH" }, 0x00fff0f5UL }, 927 { { "LAWNGREEN" }, 0x007cfc00UL }, 928 { { "LEMONCHIFFON" }, 0x00fffacdUL }, 929 { { "LIGHTBLUE" }, 0x00add8e6UL }, 930 { { "LIGHTCORAL" }, 0x00f08080UL }, 931 { { "LIGHTCYAN" }, 0x00e0ffffUL }, 932 { { "LIGHTGOLDENRODYELLOW" }, 0x00fafad2UL }, 933 { { "LIGHTGREEN" }, 0x0090ee90UL }, 934 { { "LIGHTGREY" }, 0x00d3d3d3UL }, 935 { { "LIGHTPINK" }, 0x00ffb6c1UL }, 936 { { "LIGHTSALMON" }, 0x00ffa07aUL }, 937 { { "LIGHTSEAGREEN" }, 0x0020b2aaUL }, 938 { { "LIGHTSKYBLUE" }, 0x0087cefaUL }, 939 { { "LIGHTSLATEGRAY" }, 0x00778899UL }, 940 { { "LIGHTSTEELBLUE" }, 0x00b0c4deUL }, 941 { { "LIGHTYELLOW" }, 0x00ffffe0UL }, 942 { { "LIME" }, 0x0000ff00UL }, 943 { { "LIMEGREEN" }, 0x0032cd32UL }, 944 { { "LINEN" }, 0x00faf0e6UL }, 945 { { "MAGENTA" }, 0x00ff00ffUL }, 946 { { "MAROON" }, 0x00800000UL }, 947 { { "MEDIUMAQUAMARINE" }, 0x0066cdaaUL }, 948 { { "MEDIUMBLUE" }, 0x000000cdUL }, 949 { { "MEDIUMORCHID" }, 0x00ba55d3UL }, 950 { { "MEDIUMPURPLE" }, 0x009370dbUL }, 951 { { "MEDIUMSEAGREEN" }, 0x003cb371UL }, 952 { { "MEDIUMSLATEBLUE" }, 0x007b68eeUL }, 953 { { "MEDIUMSPRINGGREEN" }, 0x0000fa9aUL }, 954 { { "MEDIUMTURQUOISE" }, 0x0048d1ccUL }, 955 { { "MEDIUMVIOLETRED" }, 0x00c71585UL }, 956 { { "MIDNIGHTBLUE" }, 0x00191970UL }, 957 { { "MINTCREAM" }, 0x00f5fffaUL }, 958 { { "MISTYROSE" }, 0x00ffe4e1UL }, 959 { { "MOCCASIN" }, 0x00ffe4b5UL }, 960 { { "NAVAJOWHITE" }, 0x00ffdeadUL }, 961 { { "NAVY" }, 0x00000080UL }, 962 { { "OLDLACE" }, 0x00fdf5e6UL }, 963 { { "OLIVE" }, 0x00808000UL }, 964 { { "OLIVEDRAB" }, 0x006b8e23UL }, 965 { { "ORANGE" }, 0x00ffa500UL }, 966 { { "ORANGERED" }, 0x00ff4500UL }, 967 { { "ORCHID" }, 0x00da70d6UL }, 968 { { "PALEGOLDENROD" }, 0x00eee8aaUL }, 969 { { "PALEGREEN" }, 0x0098fb98UL }, 970 { { "PALETURQUOISE" }, 0x00afeeeeUL }, 971 { { "PALEVIOLETRED" }, 0x00db7093UL }, 972 { { "PAPAYAWHIP" }, 0x00ffefd5UL }, 973 { { "PEACHPUFF" }, 0x00ffdab9UL }, 974 { { "PERU" }, 0x00cd853fUL }, 975 { { "PINK" }, 0x00ffc0cbUL }, 976 { { "PLUM" }, 0x00dda0ddUL }, 977 { { "POWDERBLUE" }, 0x00b0e0e6UL }, 978 { { "PURPLE" }, 0x00800080UL }, 979 { { "RED" }, 0x00ff0000UL }, 980 { { "ROSYBROWN" }, 0x00bc8f8fUL }, 981 { { "ROYALBLUE" }, 0x004169e1UL }, 982 { { "SADDLEBROWN" }, 0x008b4513UL }, 983 { { "SALMON" }, 0x00fa8072UL }, 984 { { "SANDYBROWN" }, 0x00f4a460UL }, 985 { { "SEAGREEN" }, 0x002e8b57UL }, 986 { { "SEASHELL" }, 0x00fff5eeUL }, 987 { { "SIENNA" }, 0x00a0522dUL }, 988 { { "SILVER" }, 0x00c0c0c0UL }, 989 { { "SKYBLUE" }, 0x0087ceebUL }, 990 { { "SLATEBLUE" }, 0x006a5acdUL }, 991 { { "SLATEGRAY" }, 0x00708090UL }, 992 { { "SNOW" }, 0x00fffafaUL }, 993 { { "SPRINGGREEN" }, 0x0000ff7fUL }, 994 { { "STEELBLUE" }, 0x004682b4UL }, 995 { { "TAN" }, 0x00d2b48cUL }, 996 { { "TEAL" }, 0x00008080UL }, 997 { { "THISTLE" }, 0x00d8bfd8UL }, 998 { { "TOMATO" }, 0x00ff6347UL }, 999 { { "TURQUOISE" }, 0x0040e0d0UL }, 1000 { { "VIOLET" }, 0x00ee82eeUL }, 1001 { { "WHEAT" }, 0x00f5deb3UL }, 1002 { { "WHITE" }, 0x00ffffffUL }, 1003 { { "WHITESMOKE" }, 0x00f5f5f5UL }, 1004 { { "YELLOW" }, 0x00ffff00UL }, 1005 { { "YELLOWGREEN" }, 0x009acd32UL } 1006 }; 1007 1008 extern "C" 1009 { 1010 1011 static int 1012 #if defined( WNT ) 1013 __cdecl 1014 #endif 1015 HTMLColorNameCompare( const void *pFirst, const void *pSecond) 1016 { 1017 int nRet = 0; 1018 if( HTML_NO_COLOR == ((HTML_ColorEntry*)pFirst)->nColor ) 1019 { 1020 if( HTML_NO_COLOR == ((HTML_ColorEntry*)pSecond)->nColor ) 1021 nRet = ((HTML_ColorEntry*)pFirst)->pUName->CompareTo( 1022 *((HTML_ColorEntry*)pSecond)->pUName ); 1023 else 1024 nRet = ((HTML_ColorEntry*)pFirst)->pUName->CompareToAscii( 1025 ((HTML_ColorEntry*)pSecond)->sName ); 1026 } 1027 else 1028 { 1029 if( HTML_NO_COLOR == ((HTML_ColorEntry*)pSecond)->nColor ) 1030 nRet = -1 * ((HTML_ColorEntry*)pSecond)->pUName->CompareToAscii( 1031 ((HTML_ColorEntry*)pFirst)->sName ); 1032 else 1033 nRet = strcmp( ((HTML_ColorEntry*)pFirst)->sName, 1034 ((HTML_ColorEntry*)pSecond)->sName ); 1035 } 1036 1037 return nRet; 1038 } 1039 1040 } 1041 1042 sal_uLong GetHTMLColor( const String& rName ) 1043 { 1044 if( !bSortColorKeyWords ) 1045 { 1046 qsort( (void*) aHTMLColorNameTab, 1047 sizeof( aHTMLColorNameTab ) / sizeof( HTML_ColorEntry ), 1048 sizeof( HTML_ColorEntry ), 1049 HTMLColorNameCompare ); 1050 bSortColorKeyWords = sal_True; 1051 } 1052 1053 sal_uLong nRet = ULONG_MAX; 1054 void* pFound; 1055 HTML_ColorEntry aSrch; 1056 aSrch.pUName = &rName; 1057 aSrch.nColor = HTML_NO_COLOR; 1058 1059 if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch, 1060 (void*) aHTMLColorNameTab, 1061 sizeof( aHTMLColorNameTab) / sizeof( HTML_ColorEntry ), 1062 sizeof( HTML_ColorEntry ), 1063 HTMLColorNameCompare ))) 1064 nRet = ((HTML_ColorEntry*)pFound)->nColor; 1065 1066 return nRet; 1067 } 1068 1069