зеркало из https://github.com/mozilla/gecko-dev.git
Convert users of nsC?String(), nsC?AutoString(), and NS_LITERAL_C?STRING("") to
using EmptyC?String instead. Bug 232691, patch by Charles Fenwick <clf03f@garnet.acns.fsu.edu>, r+sr=bzbarsky
This commit is contained in:
Родитель
f7932dc015
Коммит
248ac96fe6
|
@ -49,7 +49,7 @@
|
||||||
//Construct an Attribute object using the specified name and document owner
|
//Construct an Attribute object using the specified name and document owner
|
||||||
//
|
//
|
||||||
Attr::Attr(const nsAString& name, Document* owner):
|
Attr::Attr(const nsAString& name, Document* owner):
|
||||||
NodeDefinition(Node::ATTRIBUTE_NODE, name, nsString(), owner)
|
NodeDefinition(Node::ATTRIBUTE_NODE, name, EmptyString(), owner)
|
||||||
{
|
{
|
||||||
int idx = nodeName.FindChar(':');
|
int idx = nodeName.FindChar(':');
|
||||||
if (idx == kNotFound) {
|
if (idx == kNotFound) {
|
||||||
|
@ -78,7 +78,7 @@ Attr::Attr(const nsAString& name, Document* owner):
|
||||||
Attr::Attr(const nsAString& aNamespaceURI,
|
Attr::Attr(const nsAString& aNamespaceURI,
|
||||||
const nsAString& aName,
|
const nsAString& aName,
|
||||||
Document* aOwner) :
|
Document* aOwner) :
|
||||||
NodeDefinition(Node::ATTRIBUTE_NODE, aName, nsString(), aOwner)
|
NodeDefinition(Node::ATTRIBUTE_NODE, aName, EmptyString(), aOwner)
|
||||||
{
|
{
|
||||||
if (aNamespaceURI.IsEmpty())
|
if (aNamespaceURI.IsEmpty())
|
||||||
mNamespaceID = kNameSpaceID_None;
|
mNamespaceID = kNameSpaceID_None;
|
||||||
|
|
|
@ -372,7 +372,7 @@ class DocumentFragment : public NodeDefinition
|
||||||
private:
|
private:
|
||||||
friend class Document;
|
friend class Document;
|
||||||
DocumentFragment(Document* aOwner) :
|
DocumentFragment(Document* aOwner) :
|
||||||
NodeDefinition(Node::DOCUMENT_FRAGMENT_NODE, nsString(), aOwner)
|
NodeDefinition(Node::DOCUMENT_FRAGMENT_NODE, EmptyString(), aOwner)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
//Construct a Document. Currently no parameters are required, but the the
|
//Construct a Document. Currently no parameters are required, but the the
|
||||||
//node constructor is called to identify the node type.
|
//node constructor is called to identify the node type.
|
||||||
//
|
//
|
||||||
Document::Document() : NodeDefinition(Node::DOCUMENT_NODE, nsString(), NULL)
|
Document::Document() : NodeDefinition(Node::DOCUMENT_NODE, EmptyString(), NULL)
|
||||||
{
|
{
|
||||||
mIDMap.Init(0);
|
mIDMap.Init(0);
|
||||||
documentElement = nsnull;
|
documentElement = nsnull;
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
//type.
|
//type.
|
||||||
//
|
//
|
||||||
Element::Element(const nsAString& tagName, Document* owner) :
|
Element::Element(const nsAString& tagName, Document* owner) :
|
||||||
NodeDefinition(Node::ELEMENT_NODE, tagName, nsString(), owner)
|
NodeDefinition(Node::ELEMENT_NODE, tagName, EmptyString(), owner)
|
||||||
{
|
{
|
||||||
mAttributes.ownerElement = this;
|
mAttributes.ownerElement = this;
|
||||||
mNamespaceID = kNameSpaceID_Unknown;
|
mNamespaceID = kNameSpaceID_Unknown;
|
||||||
|
@ -69,7 +69,7 @@ Element::Element(const nsAString& tagName, Document* owner) :
|
||||||
Element::Element(const nsAString& aNamespaceURI,
|
Element::Element(const nsAString& aNamespaceURI,
|
||||||
const nsAString& aTagName,
|
const nsAString& aTagName,
|
||||||
Document* aOwner) :
|
Document* aOwner) :
|
||||||
NodeDefinition(Node::ELEMENT_NODE, aTagName, nsString(), aOwner)
|
NodeDefinition(Node::ELEMENT_NODE, aTagName, EmptyString(), aOwner)
|
||||||
{
|
{
|
||||||
Element(aTagName, aOwner);
|
Element(aTagName, aOwner);
|
||||||
if (aNamespaceURI.IsEmpty())
|
if (aNamespaceURI.IsEmpty())
|
||||||
|
|
|
@ -225,7 +225,7 @@ void txHTMLOutput::attribute(const nsAString& aName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!setAtt) {
|
if (!setAtt) {
|
||||||
setAtt = new txOutAttr(aNsID, localName, nsString());
|
setAtt = new txOutAttr(aNsID, localName, EmptyString());
|
||||||
setAtt->mShorthand = MB_TRUE;
|
setAtt->mShorthand = MB_TRUE;
|
||||||
mAttributes.add(setAtt);
|
mAttributes.add(setAtt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -958,7 +958,7 @@ txStartElement::execute(txExecutionState& aEs)
|
||||||
else {
|
else {
|
||||||
// we call characters with an empty string to "close" any element to
|
// we call characters with an empty string to "close" any element to
|
||||||
// make sure that no attributes are added
|
// make sure that no attributes are added
|
||||||
aEs.mResultHandler->characters(nsString(), PR_FALSE);
|
aEs.mResultHandler->characters(EmptyString(), PR_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = aEs.pushString(name);
|
rv = aEs.pushString(name);
|
||||||
|
|
|
@ -66,7 +66,7 @@ txMozillaTextOutput::txMozillaTextOutput(nsIDOMDocumentFragment* aDest)
|
||||||
aDest->GetOwnerDocument(getter_AddRefs(doc));
|
aDest->GetOwnerDocument(getter_AddRefs(doc));
|
||||||
NS_ASSERTION(doc, "unable to get ownerdocument");
|
NS_ASSERTION(doc, "unable to get ownerdocument");
|
||||||
nsCOMPtr<nsIDOMText> textNode;
|
nsCOMPtr<nsIDOMText> textNode;
|
||||||
nsresult rv = doc->CreateTextNode(nsString(),
|
nsresult rv = doc->CreateTextNode(EmptyString(),
|
||||||
getter_AddRefs(textNode));
|
getter_AddRefs(textNode));
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
return;
|
return;
|
||||||
|
@ -165,7 +165,7 @@ void txMozillaTextOutput::createResultDocument(nsIDOMDocument* aSourceDocument,
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMNSDocument> nsDoc = do_QueryInterface(mDocument);
|
nsCOMPtr<nsIDOMNSDocument> nsDoc = do_QueryInterface(mDocument);
|
||||||
if (nsDoc) {
|
if (nsDoc) {
|
||||||
nsDoc->SetTitle(nsString());
|
nsDoc->SetTitle(EmptyString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset and set up document
|
// Reset and set up document
|
||||||
|
@ -293,7 +293,7 @@ void txMozillaTextOutput::createResultDocument(nsIDOMDocument* aSourceDocument,
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMText> textNode;
|
nsCOMPtr<nsIDOMText> textNode;
|
||||||
mDocument->CreateTextNode(nsString(),
|
mDocument->CreateTextNode(EmptyString(),
|
||||||
getter_AddRefs(textNode));
|
getter_AddRefs(textNode));
|
||||||
NS_ASSERTION(textNode, "Failed to create the text node");
|
NS_ASSERTION(textNode, "Failed to create the text node");
|
||||||
if (!textNode) {
|
if (!textNode) {
|
||||||
|
|
|
@ -155,7 +155,7 @@ void txMozillaXMLOutput::attribute(const nsAString& aName,
|
||||||
// Outputting HTML as XHTML, lowercase attribute names
|
// Outputting HTML as XHTML, lowercase attribute names
|
||||||
nsAutoString lowerName;
|
nsAutoString lowerName;
|
||||||
TX_ToLowerCase(aName, lowerName);
|
TX_ToLowerCase(aName, lowerName);
|
||||||
element->SetAttributeNS(nsString(), lowerName,
|
element->SetAttributeNS(EmptyString(), lowerName,
|
||||||
aValue);
|
aValue);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -202,7 +202,7 @@ void txMozillaXMLOutput::endDocument()
|
||||||
if (mCreatingNewDocument && !mHaveTitleElement) {
|
if (mCreatingNewDocument && !mHaveTitleElement) {
|
||||||
nsCOMPtr<nsIDOMNSDocument> domDoc = do_QueryInterface(mDocument);
|
nsCOMPtr<nsIDOMNSDocument> domDoc = do_QueryInterface(mDocument);
|
||||||
if (domDoc) {
|
if (domDoc) {
|
||||||
domDoc->SetTitle(nsString());
|
domDoc->SetTitle(EmptyString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -688,7 +688,7 @@ txMozillaXSLTProcessor::reportError(nsresult aResult,
|
||||||
do_GetService(NS_STRINGBUNDLE_CONTRACTID);
|
do_GetService(NS_STRINGBUNDLE_CONTRACTID);
|
||||||
if (sbs) {
|
if (sbs) {
|
||||||
nsXPIDLString errorText;
|
nsXPIDLString errorText;
|
||||||
sbs->FormatStatusMessage(aResult, nsString().get(),
|
sbs->FormatStatusMessage(aResult, EmptyString().get(),
|
||||||
getter_Copies(errorText));
|
getter_Copies(errorText));
|
||||||
|
|
||||||
nsXPIDLString errorMessage;
|
nsXPIDLString errorMessage;
|
||||||
|
|
|
@ -65,7 +65,7 @@ void txUnknownHandler::endDocument()
|
||||||
// didn't create a document element. Switching to XML output mode
|
// didn't create a document element. Switching to XML output mode
|
||||||
// anyway.
|
// anyway.
|
||||||
|
|
||||||
nsresult rv = createHandlerAndFlush(eXMLOutput, nsString(),
|
nsresult rv = createHandlerAndFlush(eXMLOutput, EmptyString(),
|
||||||
kNameSpaceID_None);
|
kNameSpaceID_None);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return;
|
return;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче