Make tagStack be an array of nsString instead of nsAutoString. Fixes bug 427941. r+sr=sicking, a=beltzner
This commit is contained in:
Родитель
cf962f4739
Коммит
8f0c9fb046
|
@ -3398,7 +3398,7 @@ nsContentUtils::CreateContextualFragment(nsIDOMNode* aContextNode,
|
|||
nsCOMPtr<nsIDocument> document = node->GetOwnerDoc();
|
||||
NS_ENSURE_TRUE(document, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
nsAutoTArray<nsAutoString, 32> tagStack;
|
||||
nsAutoTArray<nsString, 32> tagStack;
|
||||
nsAutoString uriStr, nameStr;
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(aContextNode);
|
||||
// just in case we have a text node
|
||||
|
@ -3406,7 +3406,7 @@ nsContentUtils::CreateContextualFragment(nsIDOMNode* aContextNode,
|
|||
content = content->GetParent();
|
||||
|
||||
while (content && content->IsNodeOfType(nsINode::eELEMENT)) {
|
||||
nsAutoString& tagName = *tagStack.AppendElement();
|
||||
nsString& tagName = *tagStack.AppendElement();
|
||||
NS_ENSURE_TRUE(&tagName, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
content->NodeInfo()->GetQualifiedName(tagName);
|
||||
|
|
|
@ -2524,7 +2524,7 @@ nsresult nsHTMLEditor::CreateDOMFragmentFromPaste(const nsAString &aInputString,
|
|||
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
||||
|
||||
// if we have context info, create a fragment for that
|
||||
nsAutoTArray<nsAutoString, 32> tagStack;
|
||||
nsAutoTArray<nsString, 32> tagStack;
|
||||
nsCOMPtr<nsIDOMDocumentFragment> contextfrag;
|
||||
nsCOMPtr<nsIDOMNode> contextLeaf, junk;
|
||||
if (!aContextStr.IsEmpty())
|
||||
|
@ -2609,7 +2609,7 @@ nsresult nsHTMLEditor::CreateDOMFragmentFromPaste(const nsAString &aInputString,
|
|||
|
||||
|
||||
nsresult nsHTMLEditor::ParseFragment(const nsAString & aFragStr,
|
||||
nsTArray<nsAutoString> &aTagStack,
|
||||
nsTArray<nsString> &aTagStack,
|
||||
nsIDocument* aTargetDocument,
|
||||
nsCOMPtr<nsIDOMNode> *outNode)
|
||||
{
|
||||
|
@ -2650,7 +2650,7 @@ nsresult nsHTMLEditor::ParseFragment(const nsAString & aFragStr,
|
|||
return res;
|
||||
}
|
||||
|
||||
nsresult nsHTMLEditor::CreateTagStack(nsTArray<nsAutoString> &aTagStack, nsIDOMNode *aNode)
|
||||
nsresult nsHTMLEditor::CreateTagStack(nsTArray<nsString> &aTagStack, nsIDOMNode *aNode)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
nsCOMPtr<nsIDOMNode> node= aNode;
|
||||
|
@ -2666,7 +2666,7 @@ nsresult nsHTMLEditor::CreateTagStack(nsTArray<nsAutoString> &aTagStack, nsIDOMN
|
|||
node->GetNodeType(&nodeType);
|
||||
if (nsIDOMNode::ELEMENT_NODE == nodeType)
|
||||
{
|
||||
nsAutoString* tagName = aTagStack.AppendElement();
|
||||
nsString* tagName = aTagStack.AppendElement();
|
||||
NS_ENSURE_TRUE(tagName, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
node->GetNodeName(*tagName);
|
||||
|
|
|
@ -641,7 +641,7 @@ protected:
|
|||
nsCOMPtr<nsIDOMNode> *outEndNode,
|
||||
PRInt32 *outStartOffset,
|
||||
PRInt32 *outEndOffset);
|
||||
nsresult ParseFragment(const nsAString & aStr, nsTArray<nsAutoString> &aTagStack,
|
||||
nsresult ParseFragment(const nsAString & aStr, nsTArray<nsString> &aTagStack,
|
||||
nsIDocument* aTargetDoc,
|
||||
nsCOMPtr<nsIDOMNode> *outNode);
|
||||
nsresult CreateListOfNodesToPaste(nsIDOMNode *aFragmentAsNode,
|
||||
|
@ -650,7 +650,7 @@ protected:
|
|||
PRInt32 aStartOffset,
|
||||
nsIDOMNode *aEndNode,
|
||||
PRInt32 aEndOffset);
|
||||
nsresult CreateTagStack(nsTArray<nsAutoString> &aTagStack,
|
||||
nsresult CreateTagStack(nsTArray<nsString> &aTagStack,
|
||||
nsIDOMNode *aNode);
|
||||
nsresult GetListAndTableParents( PRBool aEnd,
|
||||
nsCOMArray<nsIDOMNode>& aListOfNodes,
|
||||
|
|
|
@ -254,7 +254,7 @@ class nsIParser : public nsISupports {
|
|||
*/
|
||||
NS_IMETHOD ParseFragment(const nsAString& aSourceBuffer,
|
||||
void* aKey,
|
||||
nsTArray<nsAutoString>& aTagStack,
|
||||
nsTArray<nsString>& aTagStack,
|
||||
PRBool aXMLMode,
|
||||
const nsACString& aContentType,
|
||||
nsDTDMode aMode = eDTDMode_autodetect) = 0;
|
||||
|
|
|
@ -1474,7 +1474,7 @@ nsParser::Parse(const nsAString& aSourceBuffer,
|
|||
NS_IMETHODIMP
|
||||
nsParser::ParseFragment(const nsAString& aSourceBuffer,
|
||||
void* aKey,
|
||||
nsTArray<nsAutoString>& aTagStack,
|
||||
nsTArray<nsString>& aTagStack,
|
||||
PRBool aXMLMode,
|
||||
const nsACString& aMimeType,
|
||||
nsDTDMode aMode)
|
||||
|
@ -1566,7 +1566,7 @@ nsParser::ParseFragment(const nsAString& aSourceBuffer,
|
|||
endContext.AppendLiteral("</");
|
||||
}
|
||||
|
||||
nsAutoString& thisTag = aTagStack[theIndex];
|
||||
nsString& thisTag = aTagStack[theIndex];
|
||||
// was there an xmlns=?
|
||||
PRInt32 endOfTag = thisTag.FindChar(PRUnichar(' '));
|
||||
if (endOfTag == -1) {
|
||||
|
|
|
@ -220,7 +220,7 @@ class nsParser : public nsIParser,
|
|||
*/
|
||||
NS_IMETHOD ParseFragment(const nsAString& aSourceBuffer,
|
||||
void* aKey,
|
||||
nsTArray<nsAutoString>& aTagStack,
|
||||
nsTArray<nsString>& aTagStack,
|
||||
PRBool aXMLMode,
|
||||
const nsACString& aContentType,
|
||||
nsDTDMode aMode = eDTDMode_autodetect);
|
||||
|
|
|
@ -146,7 +146,7 @@ nsScriptableUnescapeHTML::ParseFragment(const nsAString &aFragment,
|
|||
|
||||
// Wrap things in a div or body for parsing, but it won't show up in
|
||||
// the fragment.
|
||||
nsAutoTArray<nsAutoString, 2> tagStack;
|
||||
nsAutoTArray<nsString, 2> tagStack;
|
||||
nsCAutoString base, spec;
|
||||
if (aIsXML) {
|
||||
// XHTML
|
||||
|
|
Загрузка…
Ссылка в новой задаче