mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Fixing the content serializers to compile on Windows. Not part of the build.
This commit is contained in:
parent
2db1b458e6
commit
d50223fd65
@ -39,11 +39,11 @@
|
||||
static NS_DEFINE_CID(kParserServiceCID, NS_PARSERSERVICE_CID);
|
||||
static NS_DEFINE_CID(kEntityConverterCID, NS_ENTITYCONVERTER_CID);
|
||||
|
||||
#define kIndentStr " "
|
||||
#define kIndentStr NS_LITERAL_STRING(" ")
|
||||
#define kMozStr "_moz"
|
||||
#define kLessThan "<"
|
||||
#define kGreaterThan ">"
|
||||
#define kEndTag "</"
|
||||
#define kLessThan NS_LITERAL_STRING("<")
|
||||
#define kGreaterThan NS_LITERAL_STRING(">")
|
||||
#define kEndTag NS_LITERAL_STRING("</")
|
||||
|
||||
static const PRInt32 kLongLineLen = 128;
|
||||
|
||||
@ -257,7 +257,7 @@ nsHTMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
||||
|
||||
StartIndentation(name, hasDirtyAttr, aStr);
|
||||
|
||||
AppendToString(NS_LITERAL_STRING(kLessThan), aStr);
|
||||
AppendToString(kLessThan, aStr);
|
||||
|
||||
nsXPIDLString sharedName;
|
||||
name->GetUnicode(getter_Shares(sharedName));
|
||||
@ -265,7 +265,7 @@ nsHTMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
||||
|
||||
SerializeAttributes(content, name, aStr);
|
||||
|
||||
AppendToString(NS_LITERAL_STRING(kGreaterThan), aStr);
|
||||
AppendToString(kGreaterThan, aStr);
|
||||
|
||||
if (LineBreakAfterOpen(name, hasDirtyAttr)) {
|
||||
AppendToString(mLineBreak, aStr);
|
||||
@ -313,9 +313,9 @@ nsHTMLContentSerializer::AppendElementEnd(nsIDOMElement *aElement,
|
||||
|
||||
EndIndentation(name, hasDirtyAttr, aStr);
|
||||
|
||||
AppendToString(NS_LITERAL_STRING(kEndTag), aStr);
|
||||
AppendToString(kEndTag, aStr);
|
||||
AppendToString(sharedName, -1, aStr);
|
||||
AppendToString(NS_LITERAL_STRING(kGreaterThan), aStr);
|
||||
AppendToString(kGreaterThan, aStr);
|
||||
|
||||
if (LineBreakAfterClose(name, hasDirtyAttr)) {
|
||||
AppendToString(mLineBreak, aStr);
|
||||
@ -575,7 +575,7 @@ nsHTMLContentSerializer::StartIndentation(nsIAtom* aName,
|
||||
{
|
||||
if ((mDoFormat || aHasDirtyAttr) && !mPreLevel && !mColPos) {
|
||||
for (PRInt32 i = mIndent; --i >= 0; ) {
|
||||
AppendToString(NS_ConvertASCIItoUCS2(kIndentStr), -1,
|
||||
AppendToString(kIndentStr, -1,
|
||||
aStr);
|
||||
}
|
||||
}
|
||||
@ -610,7 +610,7 @@ nsHTMLContentSerializer::EndIndentation(nsIAtom* aName,
|
||||
|
||||
if ((mDoFormat || aHasDirtyAttr) && !mPreLevel && !mColPos) {
|
||||
for (PRInt32 i = mIndent; --i >= 0; ) {
|
||||
AppendToString(NS_ConvertASCIItoUCS2(kIndentStr), -1,
|
||||
AppendToString(kIndentStr, -1,
|
||||
aStr);
|
||||
}
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ nsXMLContentSerializer::AppendDoctype(nsIDOMDocumentType *aDoctype,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#define kXMLNS "xmlns"
|
||||
#define kXMLNS NS_LITERAL_STRING("xmlns")
|
||||
|
||||
nsresult
|
||||
nsXMLContentSerializer::PushNameSpaceDecl(const nsAReadableString& aPrefix,
|
||||
@ -293,7 +293,7 @@ PRBool
|
||||
nsXMLContentSerializer::ConfirmPrefix(nsAWritableString& aPrefix,
|
||||
const nsAReadableString& aURI)
|
||||
{
|
||||
if (aPrefix.Equals(NS_LITERAL_STRING(kXMLNS))) {
|
||||
if (aPrefix.Equals(kXMLNS)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
if (aURI.Length() == 0) {
|
||||
@ -373,7 +373,7 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
||||
|
||||
nsAutoString tagPrefix, tagLocalName, tagNamespaceURI;
|
||||
nsAutoString xmlnsStr, defaultnsStr;
|
||||
xmlnsStr.Assign(NS_LITERAL_STRING(kXMLNS));
|
||||
xmlnsStr.Assign(kXMLNS);
|
||||
defaultnsStr.Assign(NS_LITERAL_STRING(""));
|
||||
|
||||
aElement->GetPrefix(tagPrefix);
|
||||
@ -408,10 +408,10 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
||||
|
||||
content->GetAttribute(namespaceID, attrName, uriStr);
|
||||
if ((namespaceID == kNameSpaceID_XMLNS) ||
|
||||
prefixStr.Equals(NS_LITERAL_STRING(kXMLNS))) {
|
||||
prefixStr.Equals(kXMLNS)) {
|
||||
PushNameSpaceDecl(nameStr, uriStr, aElement);
|
||||
}
|
||||
else if (nameStr.Equals(NS_LITERAL_STRING(kXMLNS))) {
|
||||
else if (nameStr.Equals(kXMLNS)) {
|
||||
PushNameSpaceDecl(defaultnsStr, uriStr, aElement);
|
||||
}
|
||||
}
|
||||
@ -458,7 +458,7 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
||||
|
||||
addNSAttr = PR_FALSE;
|
||||
if (kNameSpaceID_XMLNS == namespaceID) {
|
||||
prefixStr.Assign(NS_LITERAL_STRING(kXMLNS));
|
||||
prefixStr.Assign(kXMLNS);
|
||||
}
|
||||
else if (nsmanager) {
|
||||
nsmanager->GetNameSpaceURI(namespaceID, uriStr);
|
||||
|
@ -39,11 +39,11 @@
|
||||
static NS_DEFINE_CID(kParserServiceCID, NS_PARSERSERVICE_CID);
|
||||
static NS_DEFINE_CID(kEntityConverterCID, NS_ENTITYCONVERTER_CID);
|
||||
|
||||
#define kIndentStr " "
|
||||
#define kIndentStr NS_LITERAL_STRING(" ")
|
||||
#define kMozStr "_moz"
|
||||
#define kLessThan "<"
|
||||
#define kGreaterThan ">"
|
||||
#define kEndTag "</"
|
||||
#define kLessThan NS_LITERAL_STRING("<")
|
||||
#define kGreaterThan NS_LITERAL_STRING(">")
|
||||
#define kEndTag NS_LITERAL_STRING("</")
|
||||
|
||||
static const PRInt32 kLongLineLen = 128;
|
||||
|
||||
@ -257,7 +257,7 @@ nsHTMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
||||
|
||||
StartIndentation(name, hasDirtyAttr, aStr);
|
||||
|
||||
AppendToString(NS_LITERAL_STRING(kLessThan), aStr);
|
||||
AppendToString(kLessThan, aStr);
|
||||
|
||||
nsXPIDLString sharedName;
|
||||
name->GetUnicode(getter_Shares(sharedName));
|
||||
@ -265,7 +265,7 @@ nsHTMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
||||
|
||||
SerializeAttributes(content, name, aStr);
|
||||
|
||||
AppendToString(NS_LITERAL_STRING(kGreaterThan), aStr);
|
||||
AppendToString(kGreaterThan, aStr);
|
||||
|
||||
if (LineBreakAfterOpen(name, hasDirtyAttr)) {
|
||||
AppendToString(mLineBreak, aStr);
|
||||
@ -313,9 +313,9 @@ nsHTMLContentSerializer::AppendElementEnd(nsIDOMElement *aElement,
|
||||
|
||||
EndIndentation(name, hasDirtyAttr, aStr);
|
||||
|
||||
AppendToString(NS_LITERAL_STRING(kEndTag), aStr);
|
||||
AppendToString(kEndTag, aStr);
|
||||
AppendToString(sharedName, -1, aStr);
|
||||
AppendToString(NS_LITERAL_STRING(kGreaterThan), aStr);
|
||||
AppendToString(kGreaterThan, aStr);
|
||||
|
||||
if (LineBreakAfterClose(name, hasDirtyAttr)) {
|
||||
AppendToString(mLineBreak, aStr);
|
||||
@ -575,7 +575,7 @@ nsHTMLContentSerializer::StartIndentation(nsIAtom* aName,
|
||||
{
|
||||
if ((mDoFormat || aHasDirtyAttr) && !mPreLevel && !mColPos) {
|
||||
for (PRInt32 i = mIndent; --i >= 0; ) {
|
||||
AppendToString(NS_ConvertASCIItoUCS2(kIndentStr), -1,
|
||||
AppendToString(kIndentStr, -1,
|
||||
aStr);
|
||||
}
|
||||
}
|
||||
@ -610,7 +610,7 @@ nsHTMLContentSerializer::EndIndentation(nsIAtom* aName,
|
||||
|
||||
if ((mDoFormat || aHasDirtyAttr) && !mPreLevel && !mColPos) {
|
||||
for (PRInt32 i = mIndent; --i >= 0; ) {
|
||||
AppendToString(NS_ConvertASCIItoUCS2(kIndentStr), -1,
|
||||
AppendToString(kIndentStr, -1,
|
||||
aStr);
|
||||
}
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ nsXMLContentSerializer::AppendDoctype(nsIDOMDocumentType *aDoctype,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#define kXMLNS "xmlns"
|
||||
#define kXMLNS NS_LITERAL_STRING("xmlns")
|
||||
|
||||
nsresult
|
||||
nsXMLContentSerializer::PushNameSpaceDecl(const nsAReadableString& aPrefix,
|
||||
@ -293,7 +293,7 @@ PRBool
|
||||
nsXMLContentSerializer::ConfirmPrefix(nsAWritableString& aPrefix,
|
||||
const nsAReadableString& aURI)
|
||||
{
|
||||
if (aPrefix.Equals(NS_LITERAL_STRING(kXMLNS))) {
|
||||
if (aPrefix.Equals(kXMLNS)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
if (aURI.Length() == 0) {
|
||||
@ -373,7 +373,7 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
||||
|
||||
nsAutoString tagPrefix, tagLocalName, tagNamespaceURI;
|
||||
nsAutoString xmlnsStr, defaultnsStr;
|
||||
xmlnsStr.Assign(NS_LITERAL_STRING(kXMLNS));
|
||||
xmlnsStr.Assign(kXMLNS);
|
||||
defaultnsStr.Assign(NS_LITERAL_STRING(""));
|
||||
|
||||
aElement->GetPrefix(tagPrefix);
|
||||
@ -408,10 +408,10 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
||||
|
||||
content->GetAttribute(namespaceID, attrName, uriStr);
|
||||
if ((namespaceID == kNameSpaceID_XMLNS) ||
|
||||
prefixStr.Equals(NS_LITERAL_STRING(kXMLNS))) {
|
||||
prefixStr.Equals(kXMLNS)) {
|
||||
PushNameSpaceDecl(nameStr, uriStr, aElement);
|
||||
}
|
||||
else if (nameStr.Equals(NS_LITERAL_STRING(kXMLNS))) {
|
||||
else if (nameStr.Equals(kXMLNS)) {
|
||||
PushNameSpaceDecl(defaultnsStr, uriStr, aElement);
|
||||
}
|
||||
}
|
||||
@ -458,7 +458,7 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
|
||||
|
||||
addNSAttr = PR_FALSE;
|
||||
if (kNameSpaceID_XMLNS == namespaceID) {
|
||||
prefixStr.Assign(NS_LITERAL_STRING(kXMLNS));
|
||||
prefixStr.Assign(kXMLNS);
|
||||
}
|
||||
else if (nsmanager) {
|
||||
nsmanager->GetNameSpaceURI(namespaceID, uriStr);
|
||||
|
Loading…
Reference in New Issue
Block a user