This commit is contained in:
rickg%netscape.com 1998-08-04 19:04:14 +00:00
Родитель 4702ad1656
Коммит 10acda11aa
4 изменённых файлов: 6 добавлений и 28 удалений

Просмотреть файл

@ -37,17 +37,6 @@ static char* tagTable[] = {
"TR", "TT", "U", "UL", "VAR", "WBR", "XMP"
};
/**
* This method converts a tagname (string) into an int.
* Note that we use a caseless comparision, because the tag
* data we get is so inconsistent. It seems that doing a
* caseless compare is faster than constantly copying the
* tag name to a buffer, uppercasing, then comparing.
* @update gess8/4/98
* @param aTagname is the name of the tag to find an id for
* @return enumerated tag value (may be eHTMLTag_unknown).
*/
nsHTMLTag NS_TagToEnum(const char* aTagName) {
int low = 0;
int high = NS_HTML_TAG_MAX - 1;
@ -57,7 +46,7 @@ nsHTMLTag NS_TagToEnum(const char* aTagName) {
if (result == 0)
return (nsHTMLTag) (middle + 1);
if (result < 0)
high = middle - 1;
high = middle - 1;
else
low = middle + 1;
}

Просмотреть файл

@ -245,7 +245,7 @@ close(HEADER_FILE);
# Generate the source file
open(CPP_FILE, ">$file_base.cpp");
print CPP_FILE $copyright;
print CPP_FILE "#include <string.h>\n";
print CPP_FILE "#include \"nsCRT.h\"\n";
print CPP_FILE "#include \"$file_base.h\"\n\n";
# Print out table of tag names
@ -276,7 +276,7 @@ nsHTMLTag NS_TagToEnum(const char* aTagName) {
int high = NS_HTML_TAG_MAX - 1;
while (low <= high) {
int middle = (low + high) >> 1;
int result = strcmp(aTagName, tagTable[middle]);
int result = nsCRT::strcasecmp(aTagName, tagTable[middle]);
if (result == 0)
return (nsHTMLTag) (middle + 1);
if (result < 0)

Просмотреть файл

@ -37,17 +37,6 @@ static char* tagTable[] = {
"TR", "TT", "U", "UL", "VAR", "WBR", "XMP"
};
/**
* This method converts a tagname (string) into an int.
* Note that we use a caseless comparision, because the tag
* data we get is so inconsistent. It seems that doing a
* caseless compare is faster than constantly copying the
* tag name to a buffer, uppercasing, then comparing.
* @update gess8/4/98
* @param aTagname is the name of the tag to find an id for
* @return enumerated tag value (may be eHTMLTag_unknown).
*/
nsHTMLTag NS_TagToEnum(const char* aTagName) {
int low = 0;
int high = NS_HTML_TAG_MAX - 1;
@ -57,7 +46,7 @@ nsHTMLTag NS_TagToEnum(const char* aTagName) {
if (result == 0)
return (nsHTMLTag) (middle + 1);
if (result < 0)
high = middle - 1;
high = middle - 1;
else
low = middle + 1;
}

Просмотреть файл

@ -245,7 +245,7 @@ close(HEADER_FILE);
# Generate the source file
open(CPP_FILE, ">$file_base.cpp");
print CPP_FILE $copyright;
print CPP_FILE "#include <string.h>\n";
print CPP_FILE "#include \"nsCRT.h\"\n";
print CPP_FILE "#include \"$file_base.h\"\n\n";
# Print out table of tag names
@ -276,7 +276,7 @@ nsHTMLTag NS_TagToEnum(const char* aTagName) {
int high = NS_HTML_TAG_MAX - 1;
while (low <= high) {
int middle = (low + high) >> 1;
int result = strcmp(aTagName, tagTable[middle]);
int result = nsCRT::strcasecmp(aTagName, tagTable[middle]);
if (result == 0)
return (nsHTMLTag) (middle + 1);
if (result < 0)