diff --git a/extensions/transformiix/source/xslt/txStylesheet.cpp b/extensions/transformiix/source/xslt/txStylesheet.cpp index 784eb66ca86c..74b227740d08 100644 --- a/extensions/transformiix/source/xslt/txStylesheet.cpp +++ b/extensions/transformiix/source/xslt/txStylesheet.cpp @@ -275,7 +275,8 @@ txStylesheet::getKeyMap() PRBool txStylesheet::isStripSpaceAllowed(Node* aNode, txIMatchContext* aContext) { - if (!aNode) { + PRInt32 frameCount = mStripSpaceTests.Count(); + if (!aNode || frameCount == 0) { return MB_FALSE; } @@ -283,7 +284,7 @@ txStylesheet::isStripSpaceAllowed(Node* aNode, txIMatchContext* aContext) case Node::ELEMENT_NODE: { // check Whitespace stipping handling list against given Node - PRInt32 i, frameCount = mStripSpaceTests.Count(); + PRInt32 i; for (i = 0; i < frameCount; ++i) { txStripSpaceTest* sst = NS_STATIC_CAST(txStripSpaceTest*, mStripSpaceTests[i]); @@ -304,10 +305,6 @@ txStylesheet::isStripSpaceAllowed(Node* aNode, txIMatchContext* aContext) return MB_FALSE; return isStripSpaceAllowed(aNode->getParentNode(), aContext); } - case Node::DOCUMENT_NODE: - { - return MB_TRUE; - } } return MB_FALSE; }