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