This commit is contained in:
sicking%bigfoot.com 2003-06-05 21:43:20 +00:00
Родитель 4695e7c5eb
Коммит 6d84bf3b87
2 изменённых файлов: 26 добавлений и 25 удалений

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

@ -51,10 +51,12 @@ public:
*
* @return a pointer to the object that is the top of this stack.
*/
inline void* peek()
void* peek()
{
NS_ASSERTION(!isEmpty(), "peeking at empty stack");
return ElementAt(Count() - 1);
PRInt32 count = Count() - 1;
NS_ENSURE_TRUE(count >= 0, nsnull);
return ElementAt(count);
}
/**
@ -63,10 +65,9 @@ public:
* @param obj a pointer to the object that is to be added to the
* top of this stack.
*/
inline nsresult push(void* aObject)
nsresult push(void* aObject)
{
return InsertElementAt(aObject, Count()) ? NS_OK :
NS_ERROR_OUT_OF_MEMORY;
return AppendElement(aObject);
}
/**
@ -75,12 +76,13 @@ public:
*
* @return a pointer to the object that was the top of this stack.
*/
inline void* pop()
void* pop()
{
NS_ASSERTION(!isEmpty(), "popping from empty stack");
const PRInt32 count = Count() - 1;
PRInt32 count = Count() - 1;
NS_ENSURE_TRUE(count >= 0, nsnull);
void* object = ElementAt(count);
RemoveElementsAt(count, 1);
RemoveElementAt(count);
return object;
}
@ -89,7 +91,7 @@ public:
*
* @return true if there are no objects in the stack.
*/
inline PRBool isEmpty()
PRBool isEmpty()
{
return (Count() <= 0);
}
@ -99,7 +101,7 @@ public:
*
* @return the number of elements in the Stack.
*/
inline PRInt32 size()
PRInt32 size()
{
return Count();
}
@ -116,7 +118,6 @@ public:
*
* @param aStack the stack to create an iterator for.
*/
inline
txStackIterator(txStack* aStack) : mStack(aStack),
mPosition(0)
{
@ -127,7 +128,7 @@ public:
*
* @return .
*/
inline PRBool hasNext()
PRBool hasNext()
{
return (mPosition < mStack->Count());
}
@ -137,7 +138,7 @@ public:
*
* @return .
*/
inline void* next()
void* next()
{
if (mPosition == mStack->Count()) {
return nsnull;

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

@ -245,17 +245,17 @@ void txHTMLOutput::characters(const nsAString& aData, PRBool aDOE)
}
// Special-case script and style
if (!mCurrentElements.isEmpty()) {
txExpandedName* currentElement = (txExpandedName*)mCurrentElements.peek();
if (currentElement->mNamespaceID == kNameSpaceID_None &&
(currentElement->mLocalName == txHTMLAtoms::script ||
currentElement->mLocalName == txHTMLAtoms::style)) {
closeStartTag(MB_FALSE);
printUTF8Chars(aData);
return;
}
txExpandedName* currentElement = (txExpandedName*)mCurrentElements.peek();
if (currentElement &&
(currentElement->mNamespaceID == kNameSpaceID_None) &&
((currentElement->mLocalName == txHTMLAtoms::script) ||
(currentElement->mLocalName == txHTMLAtoms::style))) {
closeStartTag(MB_FALSE);
printUTF8Chars(aData);
}
else {
txXMLOutput::characters(aData, aDOE);
}
txXMLOutput::characters(aData, aDOE);
}
void txHTMLOutput::endElement(const nsAString& aName,